Refactor probegroup to be array-based#420
Refactor probegroup to be array-based#420alejoe91 wants to merge 2 commits intoSpikeInterface:mainfrom
Conversation
for more information, see https://pre-commit.ci
| from .probe import Probe | ||
|
|
||
|
|
||
| class ProbeGroup: |
There was a problem hiding this comment.
@alejoe91 we should make a very clear doc here for the new behavior.
We could explain teh why (need of global conact order across probes)
And also metioning the previous behavior (list of probe) and what cannot be possible now (annotate after)
|
There is still an issue with this PR we need to solve : the to_dict/from_dict() and json will NOT preserve the contact order... We need to find something for it!!! Give me a chance to add more complex test for orderings the probe group and global channel indices. I propose a switch of version to 0.4. |
|
I am taking a look. I will publish a review later today |
|
I think this PR is doing too big of a change and we don't need to go that far. First, some context. Currently we use Having The move away from a simple list-based container, however, has real costs. For the array-backend to work, There is a middle way. SpikeInterface does not need the full probe state flattened into a channel-ordered array, only a subset of it. I suggest we add a private This is a narrower change that delivers what #4465 makes possible without the costs described above. To make this concrete, here are PRs that implement the idea here #425 and in SpikeInterface #4531. Concretely, this would:
|
In #416 we extended the
ProbeGroupwith aget_slicemethod. However, the current probe-centric implementation makes it difficult to slice in device channel indices from different probes are interleaved.This PR refactors the
ProbeGroupto be based on a_self.contact_array:_self.contact_arrayand we store probe contours and annotations (contact_annotations are in the array)probesis not a property that reconstructs the probes on-the-flyannotate_probe(probe_index, **kwargs)to annotate probes in the probe groupRelated to SpikeInterface/spikeinterface#4465, since we want to store a
probegroupobject directly, but we need to sort it/silce it according to thedevice_channel_indices