Skip to content

Use ProbeGroup object instead of contact_vector property#4465

Open
alejoe91 wants to merge 17 commits intoSpikeInterface:mainfrom
alejoe91:probegroup
Open

Use ProbeGroup object instead of contact_vector property#4465
alejoe91 wants to merge 17 commits intoSpikeInterface:mainfrom
alejoe91:probegroup

Conversation

@alejoe91
Copy link
Copy Markdown
Member

@alejoe91 alejoe91 added this to the 0.105.0 milestone Mar 24, 2026
@alejoe91 alejoe91 added the core Changes to core module label Mar 24, 2026
Co-authored-by: Alessio Buccino <alejoe9187@gmail.com>
@alejoe91 alejoe91 marked this pull request as draft March 25, 2026 08:53
@alejoe91 alejoe91 marked this pull request as ready for review March 25, 2026 14:01
)
# check that multiple probes are non-overlapping
all_probes = recording.get_probegroup().probes
check_probe_do_not_overlap(all_probes)
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.

This is removed because when we split_by and aggregate probes might overlap

@h-mayorquin
Copy link
Copy Markdown
Collaborator

I would like to take a look to this. I can do it this week.

@samuelgarcia
Copy link
Copy Markdown
Member

I guess that @zm711 and @h-mayorquin are now dancing on their seat just reading this PR.

Let me read it slowly.

Copy link
Copy Markdown
Collaborator

@h-mayorquin h-mayorquin left a comment

Choose a reason for hiding this comment

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

As we discussed previously I think this is a step in the direction direction.

Is _build_probegroup_from_properties only for backwwards compatbility?

I think we can segregate the backward-compatibility serialization logic (_build_probegroup_from_properties) from the main class methods by moving it into the deserialization hooks. _extra_metadata_from_dict already runs after properties are set (base.py:1202), so it can check for "probegroup" first and fall back to reconstructing from contact_vector. For the folder path, load_metadata_from_folder (base.py:639) needs to swap lines 643 and 646 so .npy properties load before _extra_metadata_from_folder runs, giving the hook access to legacy contact_vector when there is no probe.json. This has the side effect of a cleaner design where has_probe() becomes return self._probegroup is not None with no mutation at check time.

@alejoe91
Copy link
Copy Markdown
Member Author

alejoe91 commented Apr 2, 2026

As we discussed previously I think this is a step in the direction direction.

Is _build_probegroup_from_properties only for backwwards compatbility?

I think we can segregate the backward-compatibility serialization logic (_build_probegroup_from_properties) from the main class methods by moving it into the deserialization hooks. _extra_metadata_from_dict already runs after properties are set (base.py:1202), so it can check for "probegroup" first and fall back to reconstructing from contact_vector. For the folder path, load_metadata_from_folder (base.py:639) needs to swap lines 643 and 646 so .npy properties load before _extra_metadata_from_folder runs, giving the hook access to legacy contact_vector when there is no probe.json. This has the side effect of a cleaner design where has_probe() becomes return self._probegroup is not None with no mutation at check time.
_extra_metadata_from_folder

Let's check also how zarr does it. If we don't have a separate function for zarr, we can also add it to __init__

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.

4 participants