Skip to content

Commit

Permalink
Test reading variable-layout signals in expanded format.
Browse files Browse the repository at this point in the history
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.)
  • Loading branch information
Benjamin Moody committed Oct 13, 2021
1 parent 9d76714 commit e746de3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/test_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ def test_multi_variable_b(self):

def test_multi_variable_c(self):
"""
Multi-segment, variable layout, entire signal, physical
Multi-segment, variable layout, entire signal, physical, expanded
The reference signal creation cannot be made with rdsamp
directly because the WFDB c package (10.5.24) applies the single
Expand All @@ -678,8 +678,14 @@ def test_multi_variable_c(self):
- Last 2 segments have same 3 channels, length 97500
"""
record = wfdb.rdrecord('sample-data/multi-segment/s25047/s25047-2704-05-04-10-44')
sig_round = np.round(record.p_signal, decimals=8)
record = wfdb.rdrecord(
'sample-data/multi-segment/s25047/s25047-2704-05-04-10-44',
smooth_frames=False)

# convert expanded to uniform array and round to 8 digits
sig_round = np.zeros((record.sig_len, record.n_sig))
for i in range(record.n_sig):
sig_round[:, i] = np.round(record.e_p_signal[i], decimals=8)

sig_target_a = np.full((25740,3), np.nan)
sig_target_b = np.concatenate(
Expand Down

0 comments on commit e746de3

Please sign in to comment.