Skip to content

Commit

Permalink
cast type
Browse files Browse the repository at this point in the history
fix 'UserWarning: result dtype changed due to the removal of value-based promotion from NumPy'.
  • Loading branch information
tompollard committed Oct 11, 2024
1 parent 0ab9d5c commit 6e99aa1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions wfdb/io/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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]))
Expand Down

0 comments on commit 6e99aa1

Please sign in to comment.