Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OverflowError on wfdb.rdann() #524

Open
marty-thane opened this issue Jan 14, 2025 · 2 comments
Open

OverflowError on wfdb.rdann() #524

marty-thane opened this issue Jan 14, 2025 · 2 comments

Comments

@marty-thane
Copy link

I am trying to read annotations from NSRDB like this:

>>> import wfdb
>>> wfdb.rdann("nsrdb/16265", "atr")

I keep getting the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/marty/Documents/ujep2/pzs/seminarka/.venv/lib/python3.12/site-packages/wfdb/io/annotation.py", line 1953, in rdann
    (sample, label_store, subtype, chan, num, aux_note) = proc_ann_bytes(
                                                          ^^^^^^^^^^^^^^^
  File "/home/marty/Documents/ujep2/pzs/seminarka/.venv/lib/python3.12/site-packages/wfdb/io/annotation.py", line 2154, in proc_ann_bytes
    sample_diff, current_label_store, bpi = proc_core_fields(filebytes, bpi)
                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/marty/Documents/ujep2/pzs/seminarka/.venv/lib/python3.12/site-packages/wfdb/io/annotation.py", line 2240, in proc_core_fields
    sample_diff += int(filebytes[bpi, 0] + 256 * (filebytes[bpi, 1] & 3))
                                           ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
OverflowError: Python integer 256 out of bounds for uint8

I am running Python 3.12.7 and NumPy 2.2.0.

A similar issue is already open (#522).

@marty-thane
Copy link
Author

Furthermore, a similar issue is discussed in #493.

I should also mention that i am running WFDB 4.1.2.

@robinjmf
Copy link

got the same problem for extracting .atr files from MIT-BIH dataset

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants