From 5ca4276d2a8a3feef12fadf9d3a35c3cdc01f5ae Mon Sep 17 00:00:00 2001 From: Heberto Mayorquin Date: Mon, 12 Oct 2026 17:11:46 -0600 Subject: [PATCH 1/2] Fix probe attachment in serialization fixture builders --- .github/scripts/serialization/objects.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/scripts/serialization/objects.py b/.github/scripts/serialization/objects.py index 78fb3aed0b..c1d3b96308 100644 --- a/.github/scripts/serialization/objects.py +++ b/.github/scripts/serialization/objects.py @@ -108,7 +108,8 @@ def _build_recording_with_probe(): if parse(si_version) <= parse("0.105.0"): rec_with_probe = rec.set_probe(probe, in_place=False) # old API returns a new recording; portable across versions else: - rec_with_probe = rec.set_probe(probe) # new API returns a new recording; portable across versions + rec.set_probe(probe) # new API modifies the recording in place + rec_with_probe = rec return rec_with_probe @@ -155,7 +156,8 @@ def _build_recording_with_interleaved_probes(): if parse(si_version) <= parse("0.105.0"): rec_with_probe = rec.set_probegroup(probegroup, in_place=False) # old API returns a new recording; portable across versions else: - rec_with_probe = rec.set_probegroup(probegroup) # new API returns a new recording; portable across versions + rec.set_probegroup(probegroup) # new API modifies the recording in place + rec_with_probe = rec return rec_with_probe From 03f11db3f8f87f727f3491e8b98ead9de546b52f Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Tue, 13 Oct 2026 11:37:57 +0200 Subject: [PATCH 2/2] test: simplify rec_with_probe return in serialization --- .github/scripts/serialization/objects.py | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/.github/scripts/serialization/objects.py b/.github/scripts/serialization/objects.py index c1d3b96308..798301f93c 100644 --- a/.github/scripts/serialization/objects.py +++ b/.github/scripts/serialization/objects.py @@ -105,12 +105,9 @@ def _build_recording_with_probe(): rec = generate_recording(num_channels=8, durations=[DEFAULT_DURATION], sampling_frequency=30000.0, seed=0) probe = generate_linear_probe(num_elec=8) probe.set_device_channel_indices(np.arange(8)) - if parse(si_version) <= parse("0.105.0"): - rec_with_probe = rec.set_probe(probe, in_place=False) # old API returns a new recording; portable across versions - else: - rec.set_probe(probe) # new API modifies the recording in place - rec_with_probe = rec - return rec_with_probe + # old API returns a new recording, new API >=0.105.0 returns None and sets the probe in place + rec_with_probe = rec.set_probe(probe) + return rec_with_probe if rec_with_probe is not None else rec def _build_recording_with_timestamps(): @@ -152,13 +149,9 @@ def _build_recording_with_interleaved_probes(): probegroup.add_probe(probe0) probegroup.add_probe(probe1) probegroup.set_global_device_channel_indices([0, 2, 4, 6, 1, 3, 5, 7]) - # Interleave the two probes' channels: channel i alternates between probe0 and probe1. - if parse(si_version) <= parse("0.105.0"): - rec_with_probe = rec.set_probegroup(probegroup, in_place=False) # old API returns a new recording; portable across versions - else: - rec.set_probegroup(probegroup) # new API modifies the recording in place - rec_with_probe = rec - return rec_with_probe + # old API returns a new recording, new API >=0.105.0 returns None and sets the probe in place + rec_with_probe = rec.set_probegroup(probegroup) + return rec_with_probe if rec_with_probe is not None else rec def _check_recording_with_interleaved_probes(rec):