Conversation
…pth has issues; adding depth/area color coding to scatter plots
…se them for umap analysis; also removing all checkpoint files.
…' into feature/clustering
…e/visual_behavior_analysis into feature/clustering
…opying them, neuropil subtraction, dff computation
…ts pandas table is made
…ged for time trace
| a_data_now = a_data[a_data['area'].values==ars] | ||
| # a_data_now = a_data | ||
|
|
||
| ### ANOVA |
There was a problem hiding this comment.
You should remove outdated, commented-out code
| #################################################################################################### | ||
| #################################################################################################### | ||
|
|
||
| def add_tukey_lines(tukey_all, toana, ax, col, inds_v1, inds_lm, inds_pooled, top, top_sd, x_new): |
There was a problem hiding this comment.
you should document what functions do
| return extended_stimulus_presentations | ||
|
|
||
|
|
||
| def get_behavior_model_summary_table(): |
There was a problem hiding this comment.
Do you use the behavior model results? If not, I'd remove this bit of code, since its just clutter.
There was a problem hiding this comment.
i dont think so. should be fine to remove it, unless marina or others use it.
| from statsmodels.formula.api import ols | ||
| from statsmodels.stats.multicomp import (pairwise_tukeyhsd, MultiComparison) | ||
|
|
||
| def anova_tukey(svm_df, values_stat, label_stat='experience_levels', cres=['Slc17a7', 'Sst', 'Vip'], exp_level_all=['Familiar', 'Novel 1', 'Novel >1']): |
There was a problem hiding this comment.
Instead of using multiple # to make the top comment, use <stuff>, that way it gets parsed by automated documentation viewers.
There was a problem hiding this comment.
not sure i'm following you here. Are you saying that instead of using # to make comments, I should use something else? I sometimes use """ or ''' .... but seems like you wrote something else? Can you clarify?
There was a problem hiding this comment.
Its better to use:
def example():
` ` `
This is a multiline
comment
` ` `
Than
def example():
# This is a multiline
# comment
There was a problem hiding this comment.
I see my original comment is confusing because github's markdown rendered my ``` as a code block.
| # Convert a time window (relative to trial onset) to frames units, relative to "trace" begining; i.e. index on the trace whose time 0 is trace[samps_bef]. | ||
| # samps_bef: number of frames before image/omission | ||
|
|
||
| import numpy as np |
There was a problem hiding this comment.
Generally bad to include import statements within a function. Especially bad since numpy here is also imported in the entire module
There was a problem hiding this comment.
why should they not be included within a function? do you mean they should be written outside the function, before it starts?
There was a problem hiding this comment.
Lots of reasons to import outside of functions. And yes, I mean all the import statements should be at the top of the module.
- If you have
import numpy as npinside every function, then it gets imported over and over again, and is simply slow - Its harder to update or debug the code if every function is importing different modules, which makes the code less transparent.
- The python documentation says its best practice to have all import statements at the top of the module: https://docs.python.org/3/tutorial/modules.html
No description provided.