Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions wfdb/io/_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,9 +698,9 @@ def convert_dtype(self, physical, return_res, smooth_frames):
N/A

"""
if physical is True:
if physical:
return_dtype = 'float'+str(return_res)
if smooth_frames is True:
if smooth_frames:
current_dtype = self.p_signal.dtype
if current_dtype != return_dtype:
self.p_signal = self.p_signal.astype(return_dtype, copy=False)
Expand All @@ -715,7 +715,7 @@ def convert_dtype(self, physical, return_res, smooth_frames):
self.p_signal[ch] = self.p_signal[ch].astype(return_dtype, copy=False)
else:
return_dtype = 'int'+str(return_res)
if smooth_frames is True:
if smooth_frames:
current_dtype = self.d_signal.dtype
if current_dtype != return_dtype:
# Do not allow changing integer dtype to lower value due to over/underflow
Expand Down Expand Up @@ -1891,7 +1891,7 @@ def _np_dtype(bit_res, discrete):
if bit_res <= np_res:
break

if discrete is True:
if discrete:
return 'int' + str(np_res)
else:
# No float8 dtype
Expand Down
4 changes: 2 additions & 2 deletions wfdb/io/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,12 +409,12 @@ def check_read_inputs(self, sampfrom, sampto, channels, physical,

if return_res not in [64, 32, 16, 8]:
raise ValueError("return_res must be one of the following: 64, 32, 16, 8")
if physical is True and return_res == 8:
if physical and return_res == 8:
raise ValueError("return_res must be one of the following when physical is True: 64, 32, 16")

# Cannot expand multiple samples/frame for multi-segment records
if isinstance(self, MultiRecord):
if smooth_frames is False:
if not smooth_frames:
raise ValueError('This package version cannot expand all samples when reading multi-segment records. Must enable frame smoothing.')


Expand Down