Skip to content

Implement copy/get_slice/get_global_contact_positions for probegroup#416

Open
alejoe91 wants to merge 5 commits intoSpikeInterface:mainfrom
alejoe91:probegroup-get-slice
Open

Implement copy/get_slice/get_global_contact_positions for probegroup#416
alejoe91 wants to merge 5 commits intoSpikeInterface:mainfrom
alejoe91:probegroup-get-slice

Conversation

@alejoe91
Copy link
Member

As in title

Copy link
Collaborator

@h-mayorquin h-mayorquin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good tme, some small comments.

return ProbeGroup()

# Map selection to indices of individual probes
d = self.to_dict(array_as_list=False)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not used.

sliced_probes.append(sliced_probe)

sliced_probe_group = ProbeGroup()
sliced_probe_group.probes = sliced_probes
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Return type?

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.

2 participants