Repository navigation
Handle ASR calibrations that cannot form a stable RMS fit - #527
Merged
suraj-ranganath merged 8 commits intoNov 5, 2026
Merged
Conversation
Contributor
|
Claude encountered an error after 0s —— View job I'll analyze this and get back to you. |
cursor
Bot
force-pushed
the
cursor/fix-short-asr-calibration-524-5a24
branch
from
November 4, 2026 20:34
1eaea83 to
39b1fc2
Compare
pop_clean_rawdata warns and leaves the burst stage unchanged when the recording cannot form two calibration windows. clean_asr still raises. Co-authored-by: Suraj Ranganath <[email protected]>
pop_clean_rawdata still cleans two or three RMS windows. EEGLAB indexes a rounded width of zero and returns the recording unchanged. Co-authored-by: Suraj Ranganath <[email protected]>
A synthetic dataset used while shrinking has no pnts field. The zero-width check read that field before deciding the case was not a short calibration. Co-authored-by: Suraj Ranganath <[email protected]>
Name the function, the sample counts, and the longer-recording fix in both calibrators. Co-authored-by: Suraj Ranganath <[email protected]>
A constant recording makes the mixing-matrix eigendecomposition fail on Windows before the short-calibration error is raised. Co-authored-by: Suraj Ranganath <[email protected]>
A constant recording now raises ASRCalibrationError instead of failing in the eigendecomposition. Co-authored-by: Suraj Ranganath <[email protected]>
cursor
Bot
force-pushed
the
cursor/fix-short-asr-calibration-524-5a24
branch
from
November 4, 2026 21:25
beabc17 to
0f44b0a
Compare
A parallel OpenBLAS reduction on Windows moved the recorded relative gap by 1.4e-9, past the existing 1e-9 lock. The absolute gap and the calibration were unchanged. Co-authored-by: Suraj Ranganath <[email protected]>
Co-authored-by: Suraj Ranganath <[email protected]>
suraj-ranganath
marked this pull request as ready for review
November 5, 2026 02:25
Contributor
There was a problem hiding this comment.
If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.
Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.
Contributor
|
Claude encountered an error after 0s —— View job I'll analyze this and get back to you. |
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.
pop_clean_rawdata warns and leaves the burst stage unchanged when calibration is shorter than one 0.5 s RMS window or yields fewer than two windows. With reference selection on, clean_asr.m:144-153 falls back to the whole recording, asr_calibrate.m:160-161 and 189-204 then error, and clean_artifacts.m:270-275 returns before window removal at line 318 and before restoring srate at line 311. Issue 466 only skipped a non-monotonic spectral filter. A requested window stage still runs here.
Two or three RMS windows are a different case. With reference selection off, clean_asr.m:155-157 uses the whole recording and asr_calibrate.m:180 calibrates it. asr_calibrate.m:201 builds the windows with round(1:N*(1-window_overlap):S-N). For 89 samples at 128 Hz, N is 64 and that colon is two windows. asr_calibrate.m:206 calls the local fit, and asr_calibrate.m:392-395 indexes X(m,:) at m=0, the same invalid index as fit_eeg_distribution.m:112-115. clean_artifacts.m:270-275 catches that and returns the input. EEGPrep skips the non-positive widths and still cleans. The fuzz harness treats that unchanged EEGLAB result as the known difference, using the existing clean_asr tolerance.
Distance='riemannian' warns and skips the same way. clean_artifacts.m:267-268 calls Riemannian clean_asr outside the try/catch at lines 270-275, so EEGLAB lets that error propagate. Both calibrators raise ASRCalibrationError and name the function, the sample counts, and the choice to record more data or set BurstCriterion off. The old phrases Not enough calibration data and Fewer than 2 calibration windows stay in the messages.
Fixes #524
Fixes #526