Skip to content

Honor explicit Picard random seeds - #438

Merged
suraj-ranganath merged 1 commit into
developfrom
agent/20261007-fix-431
Oct 12, 2026
Merged

suraj-ranganath merged 1 commit into
developfrom
agent/20261007-fix-431

Conversation

@suraj-ranganath

Copy link
Copy Markdown
Member

Honor explicit random_state when initializing Python Picard, while preserving default identity initialization and explicit w_init precedence. Add full-rank and PCA regressions for seed behavior and direct Picard agreement, document seed usage, and verify the existing MATLAB engine comparison.

Fixes #431

@claude

claude Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

@suraj-ranganath

Copy link
Copy Markdown
Member Author

🤖 The full-rank and PCA seed regressions failed before the fix because different seeds produced identical weights. They now verify reproducibility for seed 0, different early iterates for seeds 0/123, agreement with direct Python Picard, unchanged default identity initialization, and explicit w_init precedence; stopping after two iterations tests initialization without assuming different starts must converge to different ICA solutions.

Compared against upstream Picard revision 617ce6ae669cfbd1dfedba6a5fce39a602b99ac3: its current eeg_picard wrapper calls picard_python_port with identity initialization by default. Existing TestEegPicard::test_picard_engines passed with MATLAB R2026a and that unchanged upstream wrapper, reporting minimum and mean component correlations of 1.0000 and no non-unique matches. MATLAB Engine was supplied through uv run --with /Applications/MATLAB_R2026a.app/extern/engines/python; project dependencies were unchanged.

QT_QPA_PLATFORM=offscreen EEGPREP_SKIP_MATLAB=1 uv run pytest tests/test_eeg_picard.py tests/test_gui_pop_runica.py -q: 15 passed, 1 deliberately skipped MATLAB test; that test passed separately as described above (with 4 subtests). Required staged pre-commit, changed-file Ruff lint/format, global ty, and Sphinx HTML build with gallery execution disabled passed. Local runs emitted NumPy matmul warnings; Sphinx warnings were outside the changed page plus a plot_gallery command-line type warning. CI is pending.

@suraj-ranganath

Copy link
Copy Markdown
Member Author

🤖 Final CI at ea26580: Linux Python 3.12/3.13, macOS/Windows Python 3.12, pre-commit, Ruff/ty, and documentation all passed. The automated review failed immediately after initialization with is_error:true and zero model usage, without code findings or an underlying diagnostic cause; tracked in existing Beads issue eegprep-aug. PR remains a draft.

@suraj-ranganath
suraj-ranganath marked this pull request as ready for review October 7, 2026 09:56

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Code review skipped — your organization has no extra usage available to pay for this review.

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

claude Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

@suraj-ranganath
suraj-ranganath merged commit 4a32d91 into develop Oct 12, 2026
11 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ICA] eeg_picard silently ignores random_state

1 participant