From c5b2ce11ebb0cea8b58f180867a714a8547067fc Mon Sep 17 00:00:00 2001 From: Reema Gupta Date: Fri, 6 Feb 2026 11:40:52 +0100 Subject: [PATCH 1/3] fix TdtRawIO multi-block SEV file lookup (wrong path + case mismatch) --- neo/rawio/tdtrawio.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/neo/rawio/tdtrawio.py b/neo/rawio/tdtrawio.py index a0e3cb673..cd6a0e49b 100644 --- a/neo/rawio/tdtrawio.py +++ b/neo/rawio/tdtrawio.py @@ -283,11 +283,12 @@ def _parse_header(self): raise ValueError("Dtype is changing!!") # data buffer test if SEV file exists otherwise TEV - # path = self.dirname / segment_name if self.tdt_block_mode == "multi": # for multi block datasets the names of sev files are fixed - sev_stem = f"{tankname}_{segment_name}_{stream_name}_ch{chan_id}" - sev_filename = (path / sev_stem).with_suffix(".sev") + block_path = self.dirname / segment_name + sev_regex = f"{tankname}_{segment_name}_{stream_name}_[cC]h{chan_id}.sev" + sev_filename = list(block_path.glob(sev_regex)) + sev_filename = sev_filename[0] if len(sev_filename) == 1 else None else: # for single block datasets the exact name of sev files is not known sev_regex = f"*_[cC]h{chan_id}.sev" From b7d8cac3a745ff25a2bcca53310b16c118a4c990 Mon Sep 17 00:00:00 2001 From: Reema Gupta <59512969+ree-gupta@users.noreply.github.com> Date: Wed, 11 Feb 2026 19:23:11 +0100 Subject: [PATCH 2/3] Apply suggestion from @h-mayorquin See related issue #1817 --- neo/rawio/tdtrawio.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/neo/rawio/tdtrawio.py b/neo/rawio/tdtrawio.py index cd6a0e49b..35b9d8fec 100644 --- a/neo/rawio/tdtrawio.py +++ b/neo/rawio/tdtrawio.py @@ -288,7 +288,12 @@ def _parse_header(self): block_path = self.dirname / segment_name sev_regex = f"{tankname}_{segment_name}_{stream_name}_[cC]h{chan_id}.sev" sev_filename = list(block_path.glob(sev_regex)) - sev_filename = sev_filename[0] if len(sev_filename) == 1 else None +if len(sev_filename) == 1: + sev_filename = sev_filename[0] +elif len(sev_filename) == 0: + sev_filename = None # Indirect flag for TEV Format, see issue 1087 +else: + raise ValueError(f"Multiple SEV files matched for channel {chan_id}: {sev_filename}") else: # for single block datasets the exact name of sev files is not known sev_regex = f"*_[cC]h{chan_id}.sev" From 9f334df5e4784963370ff38a8301b504b04e0202 Mon Sep 17 00:00:00 2001 From: Reema Gupta Date: Wed, 11 Feb 2026 19:32:27 +0100 Subject: [PATCH 3/3] fix intendation --- neo/rawio/tdtrawio.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/neo/rawio/tdtrawio.py b/neo/rawio/tdtrawio.py index 35b9d8fec..e5b5b88e3 100644 --- a/neo/rawio/tdtrawio.py +++ b/neo/rawio/tdtrawio.py @@ -288,12 +288,12 @@ def _parse_header(self): block_path = self.dirname / segment_name sev_regex = f"{tankname}_{segment_name}_{stream_name}_[cC]h{chan_id}.sev" sev_filename = list(block_path.glob(sev_regex)) -if len(sev_filename) == 1: - sev_filename = sev_filename[0] -elif len(sev_filename) == 0: - sev_filename = None # Indirect flag for TEV Format, see issue 1087 -else: - raise ValueError(f"Multiple SEV files matched for channel {chan_id}: {sev_filename}") + if len(sev_filename) == 1: + sev_filename = sev_filename[0] + elif len(sev_filename) == 0: + sev_filename = None # Indirect flag for TEV Format, see issue 1087 + else: + raise ValueError(f"Multiple SEV files matched for channel {chan_id}: {sev_filename}") else: # for single block datasets the exact name of sev files is not known sev_regex = f"*_[cC]h{chan_id}.sev"