-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Origin/decoding #803
base: master
Are you sure you want to change the base?
Origin/decoding #803
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should document what functions do
@@ -975,6 +975,14 @@ def get_extended_stimulus_presentations_for_session(session): | |||
return extended_stimulus_presentations | |||
|
|||
|
|||
def get_behavior_model_summary_table(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 np
inside 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.