Skip to content

Commit f278706

Browse files
committed
EVTYPE_STREAM_VARIANT as a global variable and changed regex to match old behaviour
1 parent 49e4338 commit f278706

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

neo/rawio/tdtrawio.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def _parse_header(self):
199199
# get data index
200200
tsq = self._tsq[seg_index]
201201
mask = ((tsq['evtype'] == EVTYPE_STREAM) | \
202-
(tsq['evtype'] == int(33041))) & \
202+
(tsq['evtype'] == EVTYPE_STREAM_VARIANT)) & \
203203
(tsq['evname'] == info['StoreName']) & \
204204
(tsq['channel'] == chan_id)
205205
data_index = tsq[mask].copy()
@@ -250,7 +250,7 @@ def _parse_header(self):
250250
sev_filename = (path / sev_stem).with_suffix('.sev')
251251
else:
252252
# for single block datasets the exact name of sev files in not known
253-
sev_regex = f"*_Ch{chan_id}.sev"
253+
sev_regex = f"*_[cC]h{chan_id}.sev"
254254
sev_filename = list(self.dirname.parent.glob(str(sev_regex)))
255255
# in case multiple sev files are found, try to find the one for current stream
256256
if len(sev_filename) > 1:
@@ -570,6 +570,7 @@ def read_tbk(tbk_filename):
570570
EVTYPE_STROFF = int('00000102', 16) # 258
571571
EVTYPE_SCALAR = int('00000201', 16) # 513
572572
EVTYPE_STREAM = int('00008101', 16) # 33025
573+
EVTYPE_STREAM_VARIANT = int(33041)
573574
EVTYPE_SNIP = int('00008201', 16) # 33281
574575
EVTYPE_MARK = int('00008801', 16) # 34817
575576
EVTYPE_HASDATA = int('00008000', 16) # 32768

0 commit comments

Comments
 (0)