MIT-LCP / MIT-LCP/wfdb-python

wrsamp: IndexError: Channel 0 contains values outside the allowed range [-32768, 32767] for fmt 16

Aperta
#521 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Jupyter Notebook
Stelle
853
Fork
322
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

We're encountering an issue when trying to write data to WFDB files using the wrsamp function. Specifically, we’re seeing an error that prevents us from writing the files correctly. When attempting to call wrsamp to save our data, we receive the following error message:

IndexError: Channel 0 contains values outside the allowed range [-32768, 32767] for fmt 16.

To investigate the issue further, we modified the WFDB source code to provide additional debugging information. The csv file we’re attempting to convert to wfdb has values ranging between:

Minimum: -90.113269
Maximum: 622.269327

But this is being scaled to -32767 and 32772 after calling wrsamp, so the max value allowed in fmt 16 is being exceeded.

We are using package versions:

Please see a screenshot below depicting the error we get using:
wfdb==4.1.2
pandas==2.2.3
numpy==2.1.2
image001

We have a minimal reproducible sample that we sent to Ben Moody and Tom Pollard.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia riproducendo la chiamata a wrsamp con l’intervallo di input indicato e verifica come vengono ridimensionati i valori per fmt 16 prima del controllo dell’intervallo. Il payload non indica file sorgente né test; il lavoro è completato quando i dati descritti possono essere scritti senza produrre valori al di fuori dell’intervallo fmt 16 consentito, con copertura di regressione per il caso.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
data
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.