You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
src/eegprep/functions/popfunc/eeg_picard.py sets params['w_init'] = np.eye(n_components) whenever the caller doesn't pass w_init. This makes the result deterministic and matches MATLAB. But picard only uses random_state to generate w_init, so eeg_picard(EEG, random_state=42) and eeg_picard(EEG, random_state=123) always return identical icaweights. The argument is accepted without any warning and has no effect.
A non-strict xfail test documented this (test_eeg_picard_different_random_states, which cited the Fable 5 epic #193). #429 removed it because a non-strict xfail can never fail.
Options:
Default to w_init = I only when neither w_init nor random_state is given, so an explicit random_state is honored. Default runs keep MATLAB parity.
Reject or warn on random_state, and document that w_init is the way to vary the starting point.
Whichever is chosen, write a failing test first: two runs with different random_state must either differ (option 1) or raise/warn (option 2). Keep TestEegPicard::test_picard_engines passing.
Confirmed with actual Picard calls: seeds 42 and 123 produce exactly identical weights because EEGPrep always inserts identity w_init. Python Picard uses random_state only when w_init is None; the current upstream EEGLAB wrapper defaults to identity through picard_python_port, so honoring explicit Python seeds does not require changing the default path. No overlapping implementation PR was found.
eeg_picard(random_state=...) → injected identity w_init → picard bypasses seeded initialization. Insert identity only when neither w_init nor random_state was supplied, preserving explicit w_init precedence and the existing default; write regressions first for repeatable/different seeds, reduced-rank PCA, and the unchanged identity path, then run the existing MATLAB engine comparison and document seed behavior.
🤖 Fixed in draft PR #438 at ea26580: explicit Python Picard random_state now controls initialization, preserving default identity initialization and explicit w_init precedence. Full-rank/PCA regressions and the existing MATLAB engine comparison pass; the MATLAB comparison reports component correlations of 1.0000 (evidence).
All four platform test jobs, pre-commit, Ruff/ty, and documentation CI passed. The automated Claude review failed immediately after initialization with is_error:true and zero model usage, producing no code findings; this limitation is tracked separately in eegprep-aug. The PR remains a draft.
Activity
suraj-ranganath commentedon Oct 7, 2026
🤖
Research
Confirmed with actual Picard calls: seeds 42 and 123 produce exactly identical weights because EEGPrep always inserts identity w_init. Python Picard uses random_state only when w_init is None; the current upstream EEGLAB wrapper defaults to identity through picard_python_port, so honoring explicit Python seeds does not require changing the default path. No overlapping implementation PR was found.
Relevant code
Proposed Fix
eeg_picard(random_state=...) → injected identity w_init → picardbypasses seeded initialization. Insert identity only when neither w_init nor random_state was supplied, preserving explicit w_init precedence and the existing default; write regressions first for repeatable/different seeds, reduced-rank PCA, and the unchanged identity path, then run the existing MATLAB engine comparison and document seed behavior.suraj-ranganath commentedon Oct 7, 2026
🤖 Fixed in draft PR #438 at ea26580: explicit Python Picard random_state now controls initialization, preserving default identity initialization and explicit w_init precedence. Full-rank/PCA regressions and the existing MATLAB engine comparison pass; the MATLAB comparison reports component correlations of 1.0000 (evidence).
All four platform test jobs, pre-commit, Ruff/ty, and documentation CI passed. The automated Claude review failed immediately after initialization with is_error:true and zero model usage, producing no code findings; this limitation is tracked separately in eegprep-aug. The PR remains a draft.