Skip to content
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

Should aggregate channels preserve the channel_ids? #2789

Closed
h-mayorquin opened this issue Apr 30, 2024 · 3 comments · Fixed by #2797
Closed

Should aggregate channels preserve the channel_ids? #2789

h-mayorquin opened this issue Apr 30, 2024 · 3 comments · Fixed by #2797
Labels
core Changes to core module

Comments

@h-mayorquin
Copy link
Collaborator

The following code fails:

from spikeinterface.core import aggregate_channels

recording1 = generate_recording(num_channels=3, durations=[10], set_probe=False)  # To avoid location check
recording1 = recording1.rename_channels(new_channel_ids=["a", "b", "c"])
recording2 = generate_recording(num_channels=2, durations=[10], set_probe=False)  
recording2 = recording2.rename_channels(new_channel_ids=["d", "e"])

aggregated_recording = aggregate_channels([recording1, recording2])  
assert aggregated_recording.get_num_channels() == 5
assert list(aggregated_recording.get_channel_ids()) == ['a', 'b', 'c', 'd', 'e']

The channel_ids of the aggregated recording are:

[0, 1, 2, 3, 4]

I think that the channel_ids should be preserved? Thoughts? Unforseen complexities?

@h-mayorquin h-mayorquin added the core Changes to core module label Apr 30, 2024
@zm711
Copy link
Collaborator

zm711 commented May 1, 2024

Could there ever be a case where the channel_ids are ['a', 'b', 'c'] and ['a', 'b'] such that by keeping them you would mess up the indexing post-aggregating? I'm not sure why this would happen (combining two recordings that shouldn't be combined...?) but that is the only thing I could think of.

@alejoe91
Copy link
Member

alejoe91 commented May 1, 2024

Yes, in that case we should rename channels. IMO, if the channel ids are unique, then we can preserve them

@samuelgarcia
Copy link
Member

And also the same dtype.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Changes to core module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants