Skip to content

Commit 2731729

Browse files
committed
changed the regex for compatibility with test data
1 parent 2db450e commit 2731729

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

neo/rawio/tdtrawio.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -249,23 +249,23 @@ def _parse_header(self):
249249
sev_filename = (path / sev_stem).with_suffix('.sev')
250250
else:
251251
# for single block datasets the exact name of sev files in not known
252-
store = info['StoreName'].decode('ascii')
253-
# sev_regex = f".*_ch{chan_id}.sev"
254-
sev_regex = f'*_{store}_Ch{chan_id}.sev'
252+
sev_regex = f"*_Ch{chan_id}.sev"
255253
sev_filename = list(self.dirname.parent.glob(str(sev_regex)))
254+
# in case multiple sev files are found, try to find the one for current stream
255+
if len(sev_filename) > 1:
256+
store = info['StoreName'].decode('ascii')
257+
sev_regex = f'*_{store}_Ch{chan_id}.sev'
258+
sev_filename = list(self.dirname.parent.glob(str(sev_regex)))
256259

257260
# in case non or multiple sev files are found for current stream + channel
258261
if len(sev_filename) != 1:
259262
missing_sev_channels.append(chan_id)
260263
sev_filename = None
261264
else:
262265
sev_filename = sev_filename[0]
263-
266+
264267
if (sev_filename is not None) and sev_filename.exists():
265268
data = np.memmap(sev_filename, mode='r', offset=0, dtype='uint8')
266-
# sev_info = tdt.read_sev(sev_filename)
267-
# data = sev_info[store].data
268-
# sampling_rate = sev_info[store].fs
269269
else:
270270
data = self._tev_datas[seg_index]
271271
assert data is not None, 'no TEV nor SEV'

0 commit comments

Comments
 (0)