Skip to content

Commit 6e99aa1

Browse files
committed
cast type
fix 'UserWarning: result dtype changed due to the removal of value-based promotion from NumPy'.
1 parent 0ab9d5c commit 6e99aa1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

wfdb/io/annotation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2237,8 +2237,8 @@ def proc_core_fields(filebytes, bpi):
22372237

22382238
# Not a skip - it is the actual sample number + annotation type store value
22392239
label_store = int(filebytes[bpi, 1]) >> 2
2240-
sample_diff += np.int64(filebytes[bpi, 0]) + 256 * np.int64(
2241-
filebytes[bpi, 1] & 3
2240+
sample_diff += np.int64(filebytes[bpi, 0]) + 256 * (
2241+
np.int64(filebytes[bpi, 1]) & 3
22422242
)
22432243
bpi = bpi + 1
22442244

@@ -2324,7 +2324,7 @@ def proc_extra_field(
23242324
aux_notebytes = filebytes[
23252325
bpi + 1 : bpi + 1 + int(np.ceil(aux_notelen / 2.0)), :
23262326
].flatten()
2327-
if aux_notelen & 1:
2327+
if int(aux_notelen) & 1:
23282328
aux_notebytes = aux_notebytes[:-1]
23292329
# The aux_note string
23302330
aux_note.append("".join([chr(char) for char in aux_notebytes]))

0 commit comments

Comments
 (0)