-
Notifications
You must be signed in to change notification settings - Fork 150
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
Ticket/psb-171: Various fixes for VBO release #2707
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
d4ef208
to
d81262c
Compare
d36597a
to
264764e
Compare
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 understand that the output from these fixes has been approved by Marina. However, I noticed one of your action items wasn't implemented. "Drop max_correction values from session cell table."
https://alleninstitute-brainscience.atlassian.net/browse/PSB-171?focusedCommentId=84596
found, return input_df unmodified. | ||
""" | ||
if "omitted" in input_df.columns and len(input_df) > 0: | ||
first_row = input_df.iloc[0] | ||
if not pd.isna(first_row["omitted"]): |
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.
Is there any value for first_row{"omitted"] such that is not pd.isna(first_row["omitted"])
and if first_row["omitted"] is False
?
Edit: 0 and False would qualify.
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.
Omitted can be nan for certain sessions. This is basically just a cautions test as the behaviors can be different for numpy and pandas NA/nan values (pd.NA returns errors as ambiguous and if np.nan
evaluates as true). If the omitted value is nan we can continue as it's not "True".
if not pd.isna(first_row["omitted"]): | ||
if first_row["omitted"]: | ||
df = df.drop(first_row.name, axis=0) | ||
return df | ||
input_df.drop(first_row.name, axis=0, inplace=True) |
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 don't see a reason for changing inplace=True for this. This method is returning the df.
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.
Setting inplace=True might cause unexpected issues if this method is implemented elsewhere with the same dataframe.
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.
We usually just use the functions to overwrite the dataframe in the code but I've changed it back to df = df[modify.]
Dropping the "max_correction" values ended up breaking unittests in a non-trivial way so I ended up not doing it after approval from Marina as dropping the columns is not strictly necessary or fixing any bug. |
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.
thanks for the changes
5265529
to
5a6fbbd
Compare
Create function for dropping first row omitted. Add to "from_stimulus_file" Change repeat -> movie_repeat Add description of max_correction usage to docstring. Add Int64 check to enforce_int_typing. Change name of movie accessor.
5a6fbbd
to
64e334f
Compare
enforce_df_int_typing
to return Int64 types.repeat
tomovie_repeat