Skip to content

Commit c098e38

Browse files
author
Benjamin Moody
committed
rdann: store sample as an array of int64.
For long records, annotation timestamps (sample numbers) can easily exceed the range of a numpy 'int' on 32-bit architectures. Therefore, store the 'sample' array as 'int64' instead.
1 parent 94449b8 commit c098e38

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

wfdb/io/annotation.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1653,8 +1653,11 @@ def rdann(record_name, extension, sampfrom=0, sampto=None, shift_samps=False,
16531653
subtype, chan, num, aux_note)
16541654

16551655
# Convert lists to numpy arrays dtype='int'
1656-
(sample, label_store, subtype,
1657-
chan, num) = lists_to_int_arrays(sample, label_store, subtype, chan, num)
1656+
(label_store, subtype,
1657+
chan, num) = lists_to_int_arrays(label_store, subtype, chan, num)
1658+
1659+
# Convert sample numbers to a numpy array of 'int64'
1660+
sample = np.array(sample, dtype='int64')
16581661

16591662
# Try to get fs from the header file if it is not contained in the
16601663
# annotation file

0 commit comments

Comments
 (0)