OverflowError with rdann on LUED annotations w/numpy 2.2
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 45/100
Piste de recherche
Commencez dans wfdb/io/annotation.py, au niveau de rdann, proc_ann_bytes et proc_core_fields, là où le traceback atteint le dépassement de capacité de uint8. Exécutez les exemples rdann de LUDB avec NumPy 2.2.1 et 1.26.4, puis vérifiez que le chargement des annotations se termine sans OverflowError avec la version la plus récente.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Another area of incompatibility with numpy 2.2 I fear...
If I try
wfdb.rdann('physionet.org/files/ludb/1.0.0/1', extension='atr_ii')
or (for version 1.0.1)
wfdb.rdann('physionet.org/files/ludb/1.0.1/1', extension='ii')
I get:
---------------------------------------------------------------------------
OverflowError Traceback (most recent call last)
Cell In[38], line 2
1 # os.path.join(folder_path, str(pid))
----> 2 wfdb.rdann('physionet.org/files/ludb/1.0.0/1', extension='atr_ii')
File ~/miniconda3/envs/pytorch-aline/lib/python3.12/site-packages/wfdb/io/annotation.py:1953, in rdann(record_name, extension, sampfrom, sampto, shift_samps, pn_dir, return_label_elements, summarize_labels)
1950 filebytes = load_byte_pairs(record_name, extension, pn_dir)
1952 # Get WFDB annotation fields from the file bytes
-> 1953 (sample, label_store, subtype, chan, num, aux_note) = proc_ann_bytes(
1954 filebytes, sampto
1955 )
1957 # Get the indices of annotations that hold definition information about
1958 # the entire annotation file, and other empty annotations to be removed.
1959 potential_definition_inds, rm_inds = get_special_inds(
1960 sample, label_store, aux_note
1961 )
File ~/miniconda3/envs/pytorch-aline/lib/python3.12/site-packages/wfdb/io/annotation.py:2154, in proc_ann_bytes(filebytes, sampto)
2146 # Process annotations. Iterate across byte pairs.
2147 # Sequence for one ann is:
2148 # - SKIP pair (if any)
2149 # - samp + sym pair
2150 # - other pairs (if any)
2151 # The last byte pair of the file is 0 indicating eof.
2152 while bpi < filebytes.shape[0] - 1:
2153 # Get the sample and label_store fields of the current annotation
-> 2154 sample_diff, current_label_store, bpi = proc_core_fields(filebytes, bpi)
2155 sample_total = sample_total + sample_diff
2156 sample.append(sample_total)
File ~/miniconda3/envs/pytorch-aline/lib/python3.12/site-packages/wfdb/io/annotation.py:2240, in proc_core_fields(filebytes, bpi)
2238 # Not a skip - it is the actual sample number + annotation type store value
2239 label_store = filebytes[bpi, 1] >> 2
-> 2240 sample_diff += int(filebytes[bpi, 0] + 256 * (filebytes[bpi, 1] & 3))
2241 bpi = bpi + 1
2243 return sample_diff, label_store, bpi
OverflowError: Python integer 256 out of bounds for uint8
Using the command line rdann works fine, and it works after downgrading numpy 1.26. Seems likely related to #493 ?
Pertinent versions:
wfdb-python == 4.1.2
numpy == 2.2.1 (broken)
numpy == 1.26.4 (works)
python == 3.12
- Langage dominant
- Jupyter Notebook
- Étoiles
- 853
- Forks
- 323
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de MIT-LCP/wfdb-python
-
`find_local_peaks` ignores the sample at `i + radius`, so points on a rising slope are returned as peaksPeut-être pris @rmz-oz l’a pris il y a 7 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
MIT-LCP/wfdb-python#572 ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
MIT-LCP/wfdb-python#568 ·
-
Add validation of segments when writing a `MultiRecord`Peut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 48/100
MIT-LCP/wfdb-python#557 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 58/100
MIT-LCP/wfdb-python#554 ·
-
WFDB path ignoredOuverte
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
MIT-LCP/wfdb-python#545 ·
Toutes les issues de MIT-LCP/wfdb-python
Issues similaires
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
semantica-agi/semantica#1968 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
IBM/ai-atlas-nexus#295 ·
Les mainteneurs répondent en général sous 6 jours
-
area:retrieval
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
RailtownAI/railtracks#1652 ·
Les mainteneurs répondent en général sous 2 jours
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
aeon-toolkit/aeon-neuro#177 ·
Les mainteneurs répondent en général sous 1 jour
-
Time_ns.Span.to_parts, to_unit_of_time and to_short_string are wrong for min_value_representableOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
janestreet/core#183 ·