Repository navigation
fix: filter clean EEG intervals separately around BAD annotations - #224
Open
viranovskaya wants to merge 1 commit into
Open
viranovskaya wants to merge 1 commit into
viranovskaya wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #224 +/- ##
==========================================
+ Coverage 98.21% 98.28% +0.07%
==========================================
Files 8 8
Lines 894 932 +38
==========================================
+ Hits 878 916 +38
Misses 16 16 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
viranovskaya
marked this pull request as ready for review
November 29, 2026 14:25
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Description
Closes #223.
With
reject_by_annotation="omit", detrending the entire recording could spread NaNs from a BAD interval into otherwise usable EEG channels before channel assessment. This change detrends the retained intervals separately inReferenceand applies line-noise removal separately inPrepPipeline. BAD samples are left untouched by line-noise removal. If a clean interval is too short for the multitaper notch, it is retained and a warning is emitted rather than filtering across the gap.The whole-recording path is preserved when there is no interval to split and the notch can run normally.
Runnable example: a two-second gap shared by 32 EEG channels
This example uses the same annotated NaN gap for both entry points. The EEG channels share signal components but have independent noise, so channel rejection is not driven by independent white noise. Explicit channel names work with both APIs.
AI assistance: OpenAI Codex assisted with implementation, regression tests, and review.
Merge Checklist
closes #<issue-number>to automatically close an issueCITATION.cfffile