Fix annotation of last sample#308
Fix annotation of last sample#308larsoner merged 4 commits intomne-tools:mainfrom richardkoehler:fix-index-bug
Conversation
- raise upper limit of RawViewBox to xmax + 1 sample, so that new annotations can extend above the recording
- raise upper limit of AnnotRegion to xmax + 1 sample for all annotations
- to allow for 1-sample annotations at the beginning (0) and end (xmax) of recording in the AnnotationDock :
- raise maximum of an annotation start to xmax
- lower the minimum of an annotation end/stop to 0
- raise maximum of an annotation end to xmax + 1 sample
|
@richardkoehler can you look at modifying some test such that it would fail on |
Add tests that check: - annotations that extend above the recording end - 1-sample (0 duration) annotations
|
@larsoner Sure, it took me a while to get the hang of the simulated clicks and drags, but I managed now. I implemented two new tests that pass here but fail in main. One other test also fails in main, but passes in mine, since it was checking start<stop (and vice versa), which we changed to <=. |
larsoner
left a comment
There was a problem hiding this comment.
Beautiful, thanks @richardkoehler !
|
No problem, thanks for the support and the merge! |
Reference issue
Fixes issue #12893 in mne-python (mne-tools/mne-python#12893)
The issue is also discussed in PR #12895 in mne-python (mne-tools/mne-python#12895)
What does this implement/fix?
Currently, when annotating bad epochs in mne-qt-browser, annotations were limited to the last sample of the recording, so that the last sample of the recording would not actually be rejected.
This fixes this issue, and additionally allows for 1-sample annotations at the start (t=0) and end (t=xmax) of the recording.