Skip to content

Commit 4b31fbb

Browse files
committed
ceil available in np
1 parent 10cca96 commit 4b31fbb

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

wfdb/_rdann.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import numpy as np
66
import os
7-
import math
87

98
def loaddata(recordname, annot):
109
with open(recordname + '.' + annot, 'rb') as f:
@@ -30,7 +29,7 @@ def get_sample_freq(filebytes,bpi):
3029
# Length of the auxilliary string that includes the fs written into
3130
# the file.
3231
auxlen = testbytes[2]
33-
testbytes = filebytes[:(12 + math.ceil(auxlen / 2.)), :].flatten()
32+
testbytes = filebytes[:(12 + np.ceil(auxlen / 2.)), :].flatten()
3433
annfs = int("".join([chr(char)
3534
for char in testbytes[24:auxlen + 4]]))
3635
# byte pair index to start reading actual annotations.
@@ -77,11 +76,11 @@ def proc_extra_fields(AT,subtype,ai,filebytes,bpi,num,chan,cpychan,cpynum,aux):
7776
# length of aux string. Max 256? No need to check other bits of
7877
# second byte?
7978
auxlen = filebytes[bpi, 0]
80-
auxbytes = filebytes[bpi + 1:bpi + 1 + math.ceil(auxlen / 2.),:].flatten()
79+
auxbytes = filebytes[bpi + 1:bpi + 1 + np.ceil(auxlen / 2.),:].flatten()
8180
if auxlen & 1:
8281
auxbytes = auxbytes[:-1]
8382
aux[ai] = "".join([chr(char) for char in auxbytes]) # The aux string
84-
bpi = bpi + 1 + math.ceil(auxlen / 2.)
83+
bpi = bpi + 1 + np.ceil(auxlen / 2.)
8584
return subtype,bpi,num,chan,cpychan,cpynum,aux
8685

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

0 commit comments

Comments
 (0)