Skip to content

Commit 7399610

Browse files
authored
Fix get_probe set_probe annotations propagation (#4300)
1 parent 5b2e738 commit 7399610

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/spikeinterface/core/baserecordingsnippets.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def _set_probes(self, probe_or_probegroup, group_mode="auto", in_place=False):
237237
probes_info = []
238238
for probe in probegroup.probes:
239239
probes_info.append(probe.annotations)
240-
self.annotate(probes_info=probes_info)
240+
sub_recording.annotate(probes_info=probes_info)
241241

242242
return sub_recording
243243

@@ -264,6 +264,12 @@ def get_probegroup(self):
264264
probegroup.add_probe(probe)
265265
else:
266266
probegroup = ProbeGroup.from_numpy(arr)
267+
268+
if "probes_info" in self.get_annotation_keys():
269+
probes_info = self.get_annotation("probes_info")
270+
for probe, probe_info in zip(probegroup.probes, probes_info):
271+
probe.annotations = probe_info
272+
267273
for probe_index, probe in enumerate(probegroup.probes):
268274
contour = self.get_annotation(f"probe_{probe_index}_planar_contour")
269275
if contour is not None:

0 commit comments

Comments
 (0)