Skip to content

Commit b7d8cac

Browse files
authored
Apply suggestion from @h-mayorquin
See related issue NeuralEnsemble#1817
1 parent c5b2ce1 commit b7d8cac

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

neo/rawio/tdtrawio.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,12 @@ def _parse_header(self):
288288
block_path = self.dirname / segment_name
289289
sev_regex = f"{tankname}_{segment_name}_{stream_name}_[cC]h{chan_id}.sev"
290290
sev_filename = list(block_path.glob(sev_regex))
291-
sev_filename = sev_filename[0] if len(sev_filename) == 1 else None
291+
if len(sev_filename) == 1:
292+
sev_filename = sev_filename[0]
293+
elif len(sev_filename) == 0:
294+
sev_filename = None # Indirect flag for TEV Format, see issue 1087
295+
else:
296+
raise ValueError(f"Multiple SEV files matched for channel {chan_id}: {sev_filename}")
292297
else:
293298
# for single block datasets the exact name of sev files is not known
294299
sev_regex = f"*_[cC]h{chan_id}.sev"

0 commit comments

Comments
 (0)