IndexError when plotting annotations out of range
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 853
- Forks
- 322
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the plot_items and plot_wfdb entry points and reproduce the IndexError using annotations outside the supplied signal range. Compare the requested hide-versus-plot behavior and decide how the default should work for plot_wfdb. Done means the chosen behavior is exposed as an option and out-of-range annotations no longer cause the reported error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100