-
Notifications
You must be signed in to change notification settings - Fork 202
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
Fix aggregate_channels
merging of channel ids with different string sub type
#3740
base: main
Are you sure you want to change the base?
Conversation
The error comes from the token limit : P |
chan_id in parents_chan_ids for chan_id in self._channel_ids | ||
), "ChannelSliceRecording : channel ids are not all in parents" | ||
is_channel_in_parent = [chan_id in parents_chan_ids.tolist() for chan_id in self._channel_ids.tolist()] | ||
assert all(is_channel_in_parent), "ChannelSliceRecording : channel ids are not all in parents" |
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.
Could be helpful to list them? Something like
channels_not_in_parents = [chan_id for chan_id in self._challen_ids.tolist() if chan_id not in parents_chan_ids.tolist()]
assert len(channels_not_in_parents) == 0, f"ChannelSliceRecording : channel ids {channels_not_in_parents} are not all in parent ids {parents_chan_ids}"
Or maybe this is totally overwhelming for large dense probes?
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 think it would be good to add the channel list in the error message
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.
Good idea. I will add in the next commit.
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.
Done.
@@ -118,5 +118,19 @@ def test_channel_aggregation_does_not_preserve_ids_not_the_same_type(): | |||
assert list(aggregated_recording.get_channel_ids()) == ["0", "1", "2", "3", "4"] | |||
|
|||
|
|||
def test_channel_aggregation_with_string_dtypes_of_different_size(): |
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.
Lovely test!
Would be nice to have a docstring with a brief description.
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.
Added a docstring. Let me know what you think.
Works for me, and looks less hacky than my proposed solution. Just made some doc-y comments. |
This will fix @chrishalcrow bug on #3733.
The current check for
all_channels_have_same_type
is too strict. I added a test.