Skip to content

Commit 169f25d

Browse files
authored
Merge pull request #343 from MIT-LCP/convert-dtype-bug
Record.convert_dtype should fail if expected data is missing
2 parents 0d41603 + 19c1eb3 commit 169f25d

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

wfdb/io/_signal.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -705,14 +705,9 @@ def convert_dtype(self, physical, return_res, smooth_frames):
705705
if current_dtype != return_dtype:
706706
self.p_signal = self.p_signal.astype(return_dtype, copy=False)
707707
else:
708-
if self.e_p_signal is not None:
709-
for ch in range(self.n_sig):
710-
if self.e_p_signal[ch].dtype != return_dtype:
711-
self.e_p_signal[ch] = self.e_p_signal[ch].astype(return_dtype, copy=False)
712-
else:
713-
for ch in range(self.n_sig):
714-
if self.p_signal[ch].dtype != return_dtype:
715-
self.p_signal[ch] = self.p_signal[ch].astype(return_dtype, copy=False)
708+
for ch in range(self.n_sig):
709+
if self.e_p_signal[ch].dtype != return_dtype:
710+
self.e_p_signal[ch] = self.e_p_signal[ch].astype(return_dtype, copy=False)
716711
else:
717712
return_dtype = 'int'+str(return_res)
718713
if smooth_frames:

0 commit comments

Comments
 (0)