Skip to content

Commit 1e07f0d

Browse files
author
Benjamin Moody
committed
test_infer_sig_len: test inferring length of multi-frequency record.
If the header file does not specify the signal length, rdrecord should calculate it from the size of the signal file. Test that this works correctly for multi-frequency records.
1 parent a14af14 commit 1e07f0d

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

sample-data/drive02-no-len.hea

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
drive02-no-len 5 15.5
2+
drive02.dat 16x32 1000 16 0 -1236 14736 0 ECG
3+
drive02.dat 16x2 1000 16 0 1802 13501 0 foot GSR
4+
drive02.dat 16 1.0001/bpm 16 0 75 -19070 0 HR
5+
drive02.dat 16 100 16 0 0 -9226 0 marker
6+
drive02.dat 16x2 500 16 0 5804 -14191 0 RESP

tests/test_record.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -701,9 +701,9 @@ def test_infer_sig_len(self):
701701
Read two headers. The records should be the same.
702702
"""
703703

704-
record = wfdb.rdrecord('sample-data/100')
705-
record_2 = wfdb.rdrecord('sample-data/100-no-len')
706-
record_2.record_name = '100'
704+
record = wfdb.rdrecord('sample-data/drive02')
705+
record_2 = wfdb.rdrecord('sample-data/drive02-no-len')
706+
record_2.record_name = record.record_name
707707

708708
assert record_2.__eq__(record)
709709

0 commit comments

Comments
 (0)