[MAINT] ASR: fit_eeg_distribution docstring fixes + asr_calibrate input guards - #121
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #121 +/- ##
==========================================
- Coverage 83.10% 83.10% -0.01%
==========================================
Files 25 25
Lines 2818 2823 +5
==========================================
+ Hits 2342 2346 +4
- Misses 476 477 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Closed
…ut guards - fit_eeg_distribution: correct the transposed min_clean_fraction / max_dropout_fraction default values in the docstring, and describe X as the 1-D amplitude vector it actually is (not a 2-D array). - asr_calibrate: zero non-finite samples before filtering so a NaN/Inf in the calibration data no longer propagates into a silent all-NaN threshold; and raise clear errors when the calibration data is too short to form at least two analysis windows, instead of an obscure downstream IndexError.
nbara
force-pushed
the
fix/asr-calibrate-guards-docs
branch
from
July 16, 2026 07:15
58ac67f to
be557df
Compare
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.
A small bundle of documentation and defensive-hardening fixes:
fit_eeg_distributiondocstring: themin_clean_fraction/max_dropout_fractiondefault values were transposed relative to the signature (0.25/0.1); corrected. AlsoXwas described as a 2-D(n_channels, n_samples)array, but the function operates on a 1-D vector of amplitude values (it doesnp.sort(X); n=len(X)) — description fixed.asr_calibratenon-finite guard: aNaN/Infin the calibration data previously propagated silently through the filter intoM/T(an all-NaNthreshold, no error). Non-finite samples are now zeroed before filtering so calibration degrades gracefully.asr_calibrateinsufficient-data guards: raise a clearValueErrorwhen the calibration data is too short to form one analysis window, or yields fewer than two threshold-estimation windows — instead of an obscure downstream error.Testing
Adds tests that non-finite calibration input yields finite
M/T, and that too-short calibration raises a clearValueError. Fulltests/test_asr.py+tests/test_cov.pypass;ruffclean.Note: includes the
nonlinear_eigenspacereproducibility fix from #118 so the riemann CI test is stable regardless of what this PR changes. Once #118 merges first, that commit drops out on rebase.