Skip to content

Commit 5f8cdb7

Browse files
authored
Merge pull request #1071 from JuliaSprenger/add/tdt_tests
[tdt] Add new entities to tdt tests and fix file header parsing
2 parents d26589c + 87e8e3e commit 5f8cdb7

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

neo/rawio/tdtrawio.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,8 @@ def read_tbk(tbk_filename):
522522

523523
# parse into a dict
524524
info = OrderedDict()
525-
pattern = br'NAME=(\S+);TYPE=(\S+);VALUE=(\S+);'
525+
# name and type have to be words, but value can contain floating numbers
526+
pattern = br'NAME=(\w+);TYPE=(\w+);VALUE=(\S+);'
526527
r = re.findall(pattern, chan_grp_header)
527528
for name, _type, value in r:
528529
info[name.decode('ascii')] = value

neo/test/iotest/test_tdtio.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ class TestTdtIO(BaseTestIO, unittest.TestCase, ):
1414
'tdt'
1515
]
1616
entities_to_test = [
17-
'tdt/aep_05'
17+
# test structure directory with multiple blocks
18+
'tdt/aep_05',
19+
# test single block
20+
'tdt/dataset_0_single_block/512ch_reconly_all-181123_B24_rest.Tdx',
21+
'tdt/dataset_1_single_block/ECTest-220207-135355_ECTest_B1.Tdx',
22+
'tdt/aep_05/Block-1/aep_05_Block-1.Tdx'
1823
]
1924

2025
def test_signal_group_mode(self):

neo/test/rawiotest/test_tdtrawio.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ class TestTdtRawIO(BaseTestRawIO, unittest.TestCase, ):
1212
'tdt'
1313
]
1414
entities_to_test = [
15+
# test structure directory with multiple blocks
1516
'tdt/aep_05',
17+
# test single block
18+
'tdt/dataset_0_single_block/512ch_reconly_all-181123_B24_rest.Tdx',
19+
'tdt/dataset_1_single_block/ECTest-220207-135355_ECTest_B1.Tdx',
1620
'tdt/aep_05/Block-1/aep_05_Block-1.Tdx'
1721
]
1822

0 commit comments

Comments
 (0)