Fix plotly code - #106
Conversation
|
|
||
| def plot_session_in_time_plotly( # noqa: C901 pragma: no cover | ||
| df_events, df_trials=None, fip_df=None, adjust_time=True, title=None, smooth_factor=5 | ||
| nwb_list, fip=[], adjust_time=True, title=None, smooth_factor=5 |
There was a problem hiding this comment.
Instead of changing the API from tidy dfs to nwb_list, could you create a small wrapper that prepares the dfs from nwb_list (essentially your code from L581-614)? Two considerations:
- separating data preparation and plotting is always a good practice
- to keep backward compatibility for the use case here, where one can call this function from other data sources than nwb_util
There was a problem hiding this comment.
the main issue is the lack of fip list. users should be able to plot the channels that they want. plus, G_1_preprocessed is an outdated preprocessing suffix for the channels...!
Also, if we're matching "plot_session_in_time," it's taking in an nwb and a list of FIP, not dataframes.
@alexpiet , thoughts?
There was a problem hiding this comment.
I'm confused, it seems like we are talking about two issues - whether to have a wrapper function that accepts a list of NWB files, and how to input which FIP channels to plot?
There was a problem hiding this comment.
I decided that there should always be an input for FIP channels to plot (the default would have plotted no FIP channels unless we rename channels).
I did add the wrapper function after all to help preserve han's use case.
|
Han, I've updated with the wrapper function so you can keep your functionality. I did change the FIP plotting because it was wrong with the default fip_channel list and it should allow users to pick the channels. Since this is just to mirror the function (and not exactly match) I think having a wrapper is fair. I'll wait until Alex gets back with his thoughts. |
hanhou
left a comment
There was a problem hiding this comment.
I tested on my side and it works. Thanks!
improving some of the plotly code:
for plot_foraging_session_plotly
-> Adding a plot_foraging_session_nwb_plotly version that takes in an NWB instead of choice/reward history.
for plot_session_in_time_plotly:
->Added a plot_session_in_time_nwb_plotly that takes in an NWB instead of tidy dataframes. This will match plot_session_scroller better.
-> allows user to pick which FIP to use (G_1_preprocessed is outdated channel name)