Skip to content

Commit f1f805b

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 90b8e3b commit f1f805b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tests/test_record.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ def test_multi_variable_b(self):
823823

824824
def test_multi_variable_c(self):
825825
"""
826-
Multi-segment, variable layout, entire signal, physical
826+
Multi-segment, variable layout, entire signal, physical, expanded
827827
828828
The reference signal creation cannot be made with rdsamp
829829
directly because the WFDB c package (10.5.24) applies the single
@@ -846,9 +846,14 @@ def test_multi_variable_c(self):
846846
847847
"""
848848
record = wfdb.rdrecord(
849-
"sample-data/multi-segment/s25047/s25047-2704-05-04-10-44"
849+
"sample-data/multi-segment/s25047/s25047-2704-05-04-10-44",
850+
smooth_frames=False,
850851
)
851-
sig_round = np.round(record.p_signal, decimals=8)
852+
853+
# convert expanded to uniform array and round to 8 digits
854+
sig_round = np.zeros((record.sig_len, record.n_sig))
855+
for i in range(record.n_sig):
856+
sig_round[:, i] = np.round(record.e_p_signal[i], decimals=8)
852857

853858
sig_target_a = np.full((25740, 3), np.nan)
854859
sig_target_b = np.concatenate(

0 commit comments

Comments
 (0)