Skip to content

Commit dc05f44

Browse files
author
Benjamin Moody
committed
adc (inplace=True, expanded=False): refactor for clarity.
1 parent 05b3fde commit dc05f44

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

wfdb/io/_signal.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -556,12 +556,13 @@ def adc(self, expanded=False, inplace=False):
556556
self.e_d_signal = self.e_p_signal
557557
self.e_p_signal = None
558558
else:
559-
nanlocs = np.isnan(self.p_signal)
560-
np.multiply(self.p_signal, self.adc_gain, self.p_signal)
561-
np.add(self.p_signal, self.baseline, self.p_signal)
562-
np.round(self.p_signal, 0, self.p_signal)
563-
self.p_signal = self.p_signal.astype(intdtype, copy=False)
564-
self.d_signal = self.p_signal
559+
p_signal = self.p_signal
560+
nanlocs = np.isnan(p_signal)
561+
np.multiply(p_signal, self.adc_gain, p_signal)
562+
np.add(p_signal, self.baseline, p_signal)
563+
np.round(p_signal, 0, p_signal)
564+
d_signal = p_signal.astype(intdtype, copy=False)
565+
self.d_signal = d_signal
565566
self.p_signal = None
566567

567568
# Return the variable

0 commit comments

Comments
 (0)