Skip to content

Commit 5f38498

Browse files
committed
use int for indexing
1 parent 4b31fbb commit 5f38498

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

wfdb/_rdann.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def get_sample_freq(filebytes,bpi):
2929
# Length of the auxilliary string that includes the fs written into
3030
# the file.
3131
auxlen = testbytes[2]
32-
testbytes = filebytes[:(12 + np.ceil(auxlen / 2.)), :].flatten()
32+
testbytes = filebytes[:(12 + int(np.ceil(auxlen / 2.))), :].flatten()
3333
annfs = int("".join([chr(char)
3434
for char in testbytes[24:auxlen + 4]]))
3535
# byte pair index to start reading actual annotations.
@@ -76,11 +76,11 @@ def proc_extra_fields(AT,subtype,ai,filebytes,bpi,num,chan,cpychan,cpynum,aux):
7676
# length of aux string. Max 256? No need to check other bits of
7777
# second byte?
7878
auxlen = filebytes[bpi, 0]
79-
auxbytes = filebytes[bpi + 1:bpi + 1 + np.ceil(auxlen / 2.),:].flatten()
79+
auxbytes = filebytes[bpi + 1:bpi + 1 + int(np.ceil(auxlen / 2.)),:].flatten()
8080
if auxlen & 1:
8181
auxbytes = auxbytes[:-1]
8282
aux[ai] = "".join([chr(char) for char in auxbytes]) # The aux string
83-
bpi = bpi + 1 + np.ceil(auxlen / 2.)
83+
bpi = bpi + 1 + int(np.ceil(auxlen / 2.))
8484
return subtype,bpi,num,chan,cpychan,cpynum,aux
8585

8686
def apply_annotation_range(annsamp,sampfrom,sampto,anntype,num,subtype,chan,aux):

0 commit comments

Comments
 (0)