From 7915e7a5884663c413d43b9720afe2a345222e0c Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Tue, 9 Jun 2026 12:18:59 +0200 Subject: [PATCH] fix: openephysbinary stream with empty timestamps --- neo/rawio/openephysbinaryrawio.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/neo/rawio/openephysbinaryrawio.py b/neo/rawio/openephysbinaryrawio.py index 72022c574..c139a9ae6 100644 --- a/neo/rawio/openephysbinaryrawio.py +++ b/neo/rawio/openephysbinaryrawio.py @@ -860,8 +860,12 @@ def _parse_folder_structure(dirname, experiment_names=None): else: timestamp_file = recording_folder / "continuous" / info["folder_name"] / "timestamps.npy" timestamps = np.load(str(timestamp_file), mmap_mode="r") - timestamp0 = timestamps[0] - t_start = timestamp0 / info["sample_rate"] + if len(timestamps) == 0: + timestamp0 = 0 + t_start = 0.0 + else: + timestamp0 = timestamps[0] + t_start = timestamp0 / info["sample_rate"] # TODO for later : gap checking signal_stream = info.copy()