Implement copy/get_slice/get_global_contact_positions for probegroup#416
Open
alejoe91 wants to merge 5 commits intoSpikeInterface:mainfrom
Open
Implement copy/get_slice/get_global_contact_positions for probegroup#416alejoe91 wants to merge 5 commits intoSpikeInterface:mainfrom
alejoe91 wants to merge 5 commits intoSpikeInterface:mainfrom
Conversation
for more information, see https://pre-commit.ci
…face into probegroup-get-slice
for more information, see https://pre-commit.ci
h-mayorquin
approved these changes
Mar 24, 2026
Collaborator
h-mayorquin
left a comment
There was a problem hiding this comment.
Looks good tme, some small comments.
| return ProbeGroup() | ||
|
|
||
| # Map selection to indices of individual probes | ||
| d = self.to_dict(array_as_list=False) |
| sliced_probes.append(sliced_probe) | ||
|
|
||
| sliced_probe_group = ProbeGroup() | ||
| sliced_probe_group.probes = sliced_probes |
Collaborator
There was a problem hiding this comment.
why not use the method here?
| selection = np.asarray(selection) | ||
| if selection.dtype == "bool": | ||
| assert selection.shape == (n,), ( | ||
| f"if array of bool given it must be the same size " "as the number of contacts {selection.shape} != {n}" |
Collaborator
There was a problem hiding this comment.
You are missing an f on the second string or accidentally creating a quote in the middle.
| contact_positions = np.vstack([probe.contact_positions for probe in self.probes]) | ||
| return contact_positions | ||
|
|
||
| def get_slice(self, selection: np.ndarray[bool | int]): |
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.
As in title