Skip to content

MAINT: Update Infomax ICA tests for SciPy 1.15+ compatibility - #14559

Merged
drammock merged 1 commit into
mne-tools:mainfrom
viranovskaya:test/infomax-modern-t-2026-11-17
Nov 17, 2026
Merged

drammock merged 1 commit into
mne-tools:mainfrom
viranovskaya:test/infomax-modern-t-2026-11-17

Conversation

@viranovskaya

Copy link
Copy Markdown
Contributor

Reference issue (if any)

#14382 (comment)

What does this implement/fix?

Summary

Update the Infomax ICA tests to support the newer SciPy distribution API while maintaining compatibility with older SciPy versions.

SciPy 1.15 introduced stats.make_distribution, providing an alternative to the existing stats.t.rvs sampling interface.

Changes

  • Add a shared _sample_student_t helper in test_infomax.py.
  • Use stats.make_distribution(stats.t)(df=1) with SciPy 1.15 and newer.
  • Retain stats.t.rvs for older SciPy versions.
  • Replace duplicated sampling logic in test_infomax_blowup and test_infomax_simple.
  • Preserve the existing random seed, test assertions, and tolerances.

The changes are limited to test code. The Infomax implementation itself remains unchanged.

Additional information

AI assistance disclosure

I used OpenAI Codex to assist with investigating the SciPy API compatibility issue, identifying the affected tests, and preparing the initial patch.

I personally reviewed the complete diff, checked the proposed changes against the relevant SciPy APIs, and tested the updated code. I also verified that the changes are limited to the intended test functions and do not alter the Infomax implementation or existing test assertions.

The final changes were reviewed and validated by me. Codex was used as a development assistant, not as a substitute for independent review and testing.

@drammock
drammock marked this pull request as ready for review November 17, 2026 21:56
@drammock
drammock enabled auto-merge (squash) November 17, 2026 21:57
@drammock
drammock merged commit 8d90e76 into mne-tools:main Nov 17, 2026
34 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants