Skip to content

Probe refactoring with wiring#4548

Open
h-mayorquin wants to merge 33 commits into
SpikeInterface:mainfrom
h-mayorquin:probe_refactoring_with_wiring
Open

Probe refactoring with wiring#4548
h-mayorquin wants to merge 33 commits into
SpikeInterface:mainfrom
h-mayorquin:probe_refactoring_with_wiring

Conversation

@h-mayorquin
Copy link
Copy Markdown
Collaborator

@h-mayorquin h-mayorquin commented Apr 21, 2026

More ambitious, more complete, greater, faster, stronger.

See: #4553

@h-mayorquin
Copy link
Copy Markdown
Collaborator Author

From the discussion today with @samuelgarcia

get_probe should by default turn the Probe object already re-ordered by channels.

@alejoe91 alejoe91 added the core Changes to core module label May 5, 2026
Comment on lines +1162 to +1170
if "probegroup" in dic:
from probeinterface import ProbeGroup

probegroup = ProbeGroup.from_dict(dic["probegroup"])
# The `wiring` per-channel property was restored above by the standard
# property-load loop; we just attach the probegroup object.
extractor._probegroup = probegroup
elif "contact_vector" in dic.get("properties", {}):
_restore_probegroup_from_legacy_contact_vector(extractor)
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.

this should not be in base, since it's specific to the BaseRecordingSnippets

return extractor


def _restore_probegroup_from_legacy_contact_vector(extractor) -> None:
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.

same

key_to_int = {k: i for i, k in enumerate(unique_keys)}
groups = np.array([key_to_int[k] for k in group_keys_per_channel], dtype="int64")

target.set_property("location", locations)
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.

As part of this effort, I think we should get rid of the location property and only keep back-compatibility to re-intantiate a probe object

Comment on lines +411 to +412
# when a probe is attached, derive groups on the fly from the `wiring`
# property + probegroup state (probe_id + shank_ids + contact_sides)
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.

Why do we need to do this on the fly? I think that the current implementation of setting the group property based on some group_mode (auto, by_probe, by_side, etc.) was explicit and clear. No?

"""

_main_properties = ["group", "location", "gain_to_uV", "offset_to_uV"]
_main_properties = ["group", "location", "wiring", "gain_to_uV", "offset_to_uV"]
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.

Suggested change
_main_properties = ["group", "location", "wiring", "gain_to_uV", "offset_to_uV"]
_main_properties = ["group", "wiring", "gain_to_uV", "offset_to_uV"]

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.

2 participants