Add the ProbeGroup._global_contact_order concept.#446
Open
samuelgarcia wants to merge 8 commits into
Open
Conversation
Member
|
Thanks camarade. Can you fix tests? |
…into group_order # Conflicts: # src/probeinterface/probegroup.py
for more information, see https://pre-commit.ci
Member
|
Fix typo https://github.com/SpikeInterface/probeinterface/actions/runs/27208057889/job/80329128446?pr=446 and pre-commit? |
alejoe91
reviewed
Jun 9, 2026
Co-authored-by: Alessio Buccino <alejoe9187@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#416 added a get_slices() at ProbeGroup level but this PR has enhanced after long debates and discussions the fact that the ProbeGroup has a strong problem : the order of contact with to_numpy()/from_numpy() or to_dict()/form_dict() can be lost!
This can append when contact of sevral Probe are interleaved. This was not possible before but given the
Probegrorup.get_slice()contacts of several can be interleaved!This PR add the hidden concept of
ProbeGroup._global_contact_order.pg2 = ProbeGroup.from_numpy(pg1.to_numpy(complete=True))to maintain any abritory orderpg2 = ProbeGroup.from_dict(pg1.to_dict())to maintain any abritory orderThe get_slice is now on top of to_numpy() after the ordering.
This PR is validated:
and garanty fancy ordering.
Important note: the
_global_contact_orderis NOT theglobal_device_channel_indices. It can be any order.(Even if the main use case is to order by global_device_channel_indices on spikeinterface side).
In short, this PR garanty the order after the json write/read.
@alejoe91 @chrishalcrow @h-mayorquin
Test need to be done after validation.