MIT-LCP / MIT-LCP/wfdb-python

IndexError when plotting annotations out of range

Offen
#344 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Jupyter Notebook
Sterne
853
Forks
322
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

If you pass annotations to plot_items or plot_wfdb that are before the start or after the end of the supplied signals, it will give an error

Exception: IndexError: try setting shift_samps=True in the "rdann" function?

The error message has a valid point, in that if you load a subset using sampfrom then the default behavior of rdrecord and rdann is different, which can be confusing.

Still, it's quite possible to load annotations that are outside the time range of the signals you're plotting. In such a case it's often desirable to either:

  • hide all annotations that occur before/after the signal time range

  • plot the annotations anyway (with a y-value of zero), and extend the horizontal range of the plot (or maybe not)

So it'd be nice to have one or both of these behaviors as an option at least. Not sure what the default for plot_wfdb should be.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit den Einstiegspunkten plot_items und plot_wfdb und reproduziere den IndexError mit Annotationen außerhalb des bereitgestellten Signalbereichs. Vergleiche das angeforderte Verhalten zum Ausblenden gegenüber dem Darstellen und entscheide, wie der Standard für plot_wfdb funktionieren soll. Als abgeschlossen gilt die Aufgabe, wenn das gewählte Verhalten als Option verfügbar ist und Annotationen außerhalb des gültigen Bereichs den gemeldeten Fehler nicht mehr verursachen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
data-visualization
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
38/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.