Skip to content

Preserve identity on Probe.copy()#428

Merged
alejoe91 merged 2 commits into
SpikeInterface:mainfrom
h-mayorquin:fix_copy_and_deepcopy
May 14, 2026
Merged

Preserve identity on Probe.copy()#428
alejoe91 merged 2 commits into
SpikeInterface:mainfrom
h-mayorquin:fix_copy_and_deepcopy

Conversation

@h-mayorquin
Copy link
Copy Markdown
Collaborator

Closes #421. Probe.copy() was dropping contact_ids, shank_ids, contact_sides, annotations, and contact_annotations; the only exclusion that was ever intentional is device_channel_indices (wiring, not identity). I fixed it by routing copy() through the existing to_dict / from_dict pair, which is already the canonical enumeration of a probe's serializable state via _dump_attr_names, and popping device_channel_indices from the intermediate dict. This gives one source of truth for what a probe "is" and means any attribute added to _dump_attr_names later will automatically round-trip through copy().

@h-mayorquin h-mayorquin marked this pull request as ready for review April 24, 2026 02:13
@h-mayorquin h-mayorquin requested a review from alejoe91 May 12, 2026 23:48
@alejoe91 alejoe91 merged commit 5a18f74 into SpikeInterface:main May 14, 2026
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Probe.copy() should preserve contact_ids

2 participants