Skip to content

Commit d7cf324

Browse files
committed
fix test and add default option to adc expandframe
1 parent 33c21ad commit d7cf324

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

tests/test_records.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,15 @@ def test_2b(self):
127127
# Target file created with: rdsamp -r sampledata/100_3chan -P | cut -f 2- >
128128
# target2c
129129
def test_2c(self):
130-
sig, fields = wfdb.srdsamp('sampledata/100_3chan')
131-
siground = np.round(sig, decimals=8)
130+
record = wfdb.rdsamp('sampledata/100_3chan')
131+
siground = np.round(record.p_signals, decimals=8)
132132
targetsig = np.genfromtxt('tests/targetoutputdata/target2c')
133133

134134
# Test file writing
135+
record.d_signals = record.adc()
135136
record.wrsamp()
136-
recordwrite = wfdb.rdsamp('100_3chan', physical=False)
137+
recordwrite = wfdb.rdsamp('100_3chan')
138+
record.d_signals = None
137139

138140
assert np.array_equal(siground, targetsig)
139141
assert record.__eq__(recordwrite)
@@ -276,8 +278,8 @@ def test_4c(self):
276278
assert np.array_equal(siground, targetsig)
277279
assert np.array_equal(sig, pbsig) and fields == pbfields
278280
assert np.array_equal(sig, writesig) and fields == writefields
279-
280-
281+
282+
281283
# Format 16 multi-samples per frame and skew, read expanded signals
282284
# Target file created with: rdsamp -r sampledata/test01_00s_skewframe -P -H | cut
283285
# -f 2- > target4d

wfdb/_signals.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def set_d_features(self, do_adc = False, singlefmt = 1, expanded=False):
261261

262262
# Returns the analogue to digital conversion for the physical signal stored in p_signals.
263263
# The p_signals, fmt, gain, and baseline fields must all be valid.
264-
def adc(self, expanded):
264+
def adc(self, expanded=False):
265265

266266
# The digital nan values for each channel
267267
dnans = digi_nan(self.fmt)

0 commit comments

Comments
 (0)