SpikeInterface / SpikeInterface/probeinterface
Slice Probe and ProbeGroup by stable identifiers, not positional integers
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 85
- Forks
- 49
- Avg merge
- 13h 47m
- Merged PRs (30d)
- 3
Description
Currently get_slice's argument is array-based: selection is positional indices or a boolean mask. I think this is a bad pattern, and I'd like to either change it or add a method that doesn't rely on it, select_contacts, mirroring SpikeInterface's select_channels. I think this should be the blessed public API for sub-selecting contacts of both Probe and ProbeGroup.
Why? Our libraries merge results from different sources (the recording, the probe, and probably headstage information later), and a positional index keeps an implicit "position i here is position j there" map that collides when those sources are combined and goes stale the moment one of them is sliced or reordered. That is how users get bitten, see the reorder-on-attach case in SpikeInterface #4565. The standard solution in the field is to do what databases do: identify a record by a stable primary key rather than by its position. That is, we create object identifiers that are independent of the internal representation.
Using that in SpikeInterface, for example, would solve the metadata propagation bugs related to slicing, grouping and aggregating #4545, #4546, and #4547. It would also remove the need to solve the annotation feature on the array-like slicing, which does not have natural semantics #446.
Finally, I think it is semantically appropriate for the domain. Probes are not arrays, and we should not have a method that assumes they are.
Note that if you think this idea is good we would require #429 (auto-generate contact_ids when not explicitly set). The ProbeGroup unique identifier is an implementation detail that we can discuss if we think this idea is sound.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing get_slice and the Probe and ProbeGroup APIs, then read the linked discussions and PRs #429 and #446. The work is complete when a stable-identifier-based public selection API and the ProbeGroup identifier behavior have been agreed and implemented for both object types.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend-api-design, data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100