Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions .github/scripts/serialization/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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):
Expand Down
Loading