Skip to content

Use ProbeGroup object instead of contact_vector property#4638

Closed
alejoe91 wants to merge 31 commits into
SpikeInterface:mainfrom
alejoe91:probegroup-only
Closed

Use ProbeGroup object instead of contact_vector property#4638
alejoe91 wants to merge 31 commits into
SpikeInterface:mainfrom
alejoe91:probegroup-only

Conversation

@alejoe91

@alejoe91 alejoe91 commented Jul 2, 2026

Copy link
Copy Markdown
Member

Replaces #4465 (as suggested by @h-mayorquin )

After SpikeInterface/probeinterface#446, we can go all in on the use of ProbeGroup instead of contact_vector, since the use case with interleaved contacts after device channel indices slicing is handled gracefully by the new _global_contact_order array, stored in the probegroup dictionary.
Now the recording has a _probegroup attribute, which is propagated as metadata. The probegroup.get_slice takes care of all metadata propagation.
In this refactoring, the duplicated location property has also been dropped.

Note that this implementation is alternative to what is proposed in #4553 and implemented in #4548 : here we keep a ProbeGroup object attached to the recording, after sorting it by device_channel_indices, instead of adding a wiring property. You lose the original probe contact order, but we argue that the contacts in a probegroup do not really have a "default" order, but are rather a set of contacts that become ordered when wired (see #3498).

Some additional points:

Tests for aggregation/slicing

Added more tests for aggregation/slicing behavior and metadata propagation

Fixes #4545 #4546 #4547 #4549 #4553

Tests for backward compatibility

Added a test for bakward compatibility, which saves a recording to binary/zarr with v0.104.* and reloads it with the current version to check that the probegroup is reloaded correctly.

alejoe91 and others added 30 commits December 29, 2025 15:43
Co-authored-by: Alessio Buccino <alejoe9187@gmail.com>
@alejoe91 alejoe91 added the core Changes to core module label Jul 2, 2026
return self._annotations.get("is_filtered", False)

def set_probe(self, probe, group_mode="auto", in_place=False):
def reset_probe(self):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a reset is when you remove then add something all at once. I would prefer something like remove_probe for this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in #4465

@alejoe91

alejoe91 commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

Closing in favor of #4465

@alejoe91 alejoe91 closed this Jul 2, 2026
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 this pull request may close these issues.

aggregate_channels loses per-probe metadata

3 participants