From 6e99aa1dead27971011dd01046586bc93eff693e Mon Sep 17 00:00:00 2001 From: Tom Pollard Date: Fri, 11 Oct 2024 15:54:41 -0400 Subject: [PATCH] cast type fix 'UserWarning: result dtype changed due to the removal of value-based promotion from NumPy'. --- wfdb/io/annotation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wfdb/io/annotation.py b/wfdb/io/annotation.py index 611268bf..6ceb2680 100644 --- a/wfdb/io/annotation.py +++ b/wfdb/io/annotation.py @@ -2237,8 +2237,8 @@ def proc_core_fields(filebytes, bpi): # Not a skip - it is the actual sample number + annotation type store value label_store = int(filebytes[bpi, 1]) >> 2 - sample_diff += np.int64(filebytes[bpi, 0]) + 256 * np.int64( - filebytes[bpi, 1] & 3 + sample_diff += np.int64(filebytes[bpi, 0]) + 256 * ( + np.int64(filebytes[bpi, 1]) & 3 ) bpi = bpi + 1 @@ -2324,7 +2324,7 @@ def proc_extra_field( aux_notebytes = filebytes[ bpi + 1 : bpi + 1 + int(np.ceil(aux_notelen / 2.0)), : ].flatten() - if aux_notelen & 1: + if int(aux_notelen) & 1: aux_notebytes = aux_notebytes[:-1] # The aux_note string aux_note.append("".join([chr(char) for char in aux_notebytes]))