Skip to content

Commit c4a1257

Browse files
author
Benjamin Moody
committed
Test reading variable-layout signals in expanded format.
Modify the existing test case test_multi_variable_c to check that we can read a single-frequency variable-layout record using smooth_frames=False (which should retrieve the same data as smooth_frames=True, but represented as a list of arrays rather than a single array.)
1 parent d698e0e commit c4a1257

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tests/test_record.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ def test_multi_variable_b(self):
690690

691691
def test_multi_variable_c(self):
692692
"""
693-
Multi-segment, variable layout, entire signal, physical
693+
Multi-segment, variable layout, entire signal, physical, expanded
694694
695695
The reference signal creation cannot be made with rdsamp
696696
directly because the WFDB c package (10.5.24) applies the single
@@ -712,8 +712,14 @@ def test_multi_variable_c(self):
712712
- Last 2 segments have same 3 channels, length 97500
713713
714714
"""
715-
record = wfdb.rdrecord('sample-data/multi-segment/s25047/s25047-2704-05-04-10-44')
716-
sig_round = np.round(record.p_signal, decimals=8)
715+
record = wfdb.rdrecord(
716+
'sample-data/multi-segment/s25047/s25047-2704-05-04-10-44',
717+
smooth_frames=False)
718+
719+
# convert expanded to uniform array and round to 8 digits
720+
sig_round = np.zeros((record.sig_len, record.n_sig))
721+
for i in range(record.n_sig):
722+
sig_round[:, i] = np.round(record.e_p_signal[i], decimals=8)
717723

718724
sig_target_a = np.full((25740,3), np.nan)
719725
sig_target_b = np.concatenate(

0 commit comments

Comments
 (0)