-
Notifications
You must be signed in to change notification settings - Fork 241
to_pynapple_tsgroup : attach_unit_properties, export sorting properties #4360
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
base: main
Are you sure you want to change the base?
Conversation
Added option to attach unit properties from sorting to the TsGroup object.
for more information, see https://pre-commit.ci
Changed attach_unit_properties to True by default and updated property_data assignment to convert to list.
|
Cool! |
| for property_key in property_keys: # loop through sorting's properties | ||
| property_data = sorting.get_property(property_key) | ||
| property_df[property_key] = list(property_data) | ||
| metadata_list.append(property_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.
The tests are failing when there are no sorting properties. I would put these four lines inside a if len(property_keys) > 0, so that the metadata_list is only updated if there are some property keys.
| # Look for good metadata to add, if there is a sorting analyzer | ||
| if attach_unit_metadata and isinstance(sorting_analyzer_or_sorting, SortingAnalyzer): | ||
|
|
||
| metadata_list = [] |
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 noticed that this metadata_list = [] is not needed! A bug from me when I first coded this. Could you remove it please - thanks!
Added option to attach unit properties from sorting to the TsGroup object.
#4346