Closed dougollerenshaw closed 3 years ago
It would be nice to finish this feature request. https://github.com/AllenInstitute/visual_behavior_analysis/issues/720
https://github.com/alexpiet/licking_behavior/blob/master/src/psy_metrics_tools.py#L54
@alexpiet I added two columns to address your comment. I also had to change the input to the function from the licks dataframe to the entire session object so that the function would have access to both licks and rewards.
@matchings this conflicts with some of the work you added in PR #726. I propose that we merge this first, then strip the redundant stuff from your PR. Some comments:
@alexpiet Thanks for pointing out the fields that I missed in the docstring in your slack comment. PR is updated with missing information added.
Adds a function to utilities.py that will annotate the licks dataframe with some useful columns (partially stolen from @alexpiet's implementation in visual_behavior_glm (https://github.com/AllenInstitute/visual_behavior_glm/blob/86a816ebc4dcc8d450f83f77611c2ee7afdf7b93/visual_behavior_glm/GLM_fit_tools.py#L1022)
Optionally operates in place.
Example use:
get dataset, view default licks dataframe:
import
annotate_licks
:return annotated licks df as a new variable:
annotate licks in place:
ALSO: fixes a bug in plotting.event_triggered_raster