Repository navigation
[clean_rawdata] Document the short-calibration return and the one-row fit crash - #667
Conversation
…n return clean_windows raises when a fit width rounds to 1, which is the bsxfun crash in fit_eeg_distribution.m:126. The fuzz harness records that crash, and the clean_artifacts early return after a 28-sample calibration, as documented differences. Co-authored-by: Suraj Ranganath <[email protected]>
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.
|
Claude finished @suraj-ranganath's task in 1m 13s —— View job Code review
BlockingNone. ImportantNone. Nits
Test gapsNone. Both crops are replayed, and each new classifier has a negative case that still diverges. EEGLAB parity notes
Not done
· Branch: |
| prepared = _pop_clean_rawdata_variant(eeg, params, WindowCriterion="off") | ||
| except Exception: | ||
| return False | ||
| count = _clean_windows_count(int(prepared["pnts"]), float(prepared["srate"]), 1.0, 0.66) |
There was a problem hiding this comment.
Nit: 0.66 repeats _CLEAN_WINDOW_OVERLAP (
Lines 432 to 434 in 84d34a8
| count = _clean_windows_count(int(prepared["pnts"]), float(prepared["srate"]), 1.0, 0.66) | |
| count = _clean_windows_count(int(prepared["pnts"]), float(prepared["srate"]), 1.0, _CLEAN_WINDOW_OVERLAP) |
|
I verified the MATLAB line references against
— orchestrator |
Co-authored-by: Suraj Ranganath <[email protected]>
…awdata-fuzz-663-664-bdb7 Co-authored-by: Suraj Ranganath <[email protected]> # Conflicts: # docs/source/changelog.rst
Two pop_clean_rawdata crops diverge for different reasons. Neither is the flat-channel repair (#649) or the zero fit width (#655).
On the 1024-sample crop starting at sample 1034, channel cleaning leaves 26 channels and the calibration section is 28 samples, so asr_calibrate.m line 190 errors. clean_artifacts.m lines 270-275 then return that 26 by 1024 array before window removal (clean_windows.m is never reached). EEGPrep skips the burst and still removes windows, keeping 551 samples. The harness classifies that pair as a documented difference when the oracle equals the channel-cleaned recording, clean_asr raises ASRCalibrationError on it, and EEGPrep equals the same call with BurstCriterion off.
On the crop starting at sample 1183, burst rejection leaves 5 windows. fit_eeg_distribution.m descends the default width grid, and at width 1 histc of the one-row slice is a row while logq(1:end-1,:) is empty, so line 126 raises MATLAB:bsxfun:arrayDimensionsMustMatch from clean_windows.m line 106 and clean_artifacts.m line 320. The nested copy in asr_calibrate.m transposes that row at line 397 and does not hit the bsxfun. clean_windows now raises ValueError naming clean_windows, the rounded width, and WindowCriterion 'off'. The harness accepts that pair only when the identifier, the fit_eeg_distribution and clean_windows stack, and the window count agree.
test_channel_cleaned_short_calibration_return_is_not_a_divergence and test_final_window_row_histogram_is_not_a_divergence replay both crops. A wrong identifier, a mismatched window count, and an oracle that is still the original array still diverge. Tolerances are unchanged. The MATLAB reference suite was not run.
Fixes #663
Fixes #664