diff --git a/.github/scripts/serialization/objects.py b/.github/scripts/serialization/objects.py index 78fb3aed0b..798301f93c 100644 --- a/.github/scripts/serialization/objects.py +++ b/.github/scripts/serialization/objects.py @@ -105,11 +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_with_probe = rec.set_probe(probe) # new API returns a new recording; portable across versions - 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(): @@ -151,12 +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_with_probe = rec.set_probegroup(probegroup) # new API returns a new recording; portable across versions - 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):