Fix all 216 pytest warnings across the test suite#995
Merged
bruAristimunha merged 12 commits intodevelopfrom Feb 28, 2026
Merged
Fix all 216 pytest warnings across the test suite#995bruAristimunha merged 12 commits intodevelopfrom
bruAristimunha merged 12 commits intodevelopfrom
Conversation
Address root causes of warnings emitted during test runs: - Clear Epochs annotations before concatenation in paradigm processing - Replace lambda with named function in test pipelines to avoid hash warning - Suppress MNE non-standard config warning in FakeDataset (intentional usage) - Suppress OptunaSearchCV ExperimentalWarning at init via functools.wraps patch - Suppress mne_bids format conversion warnings during BIDS write - Re-apply montage after add_reference_channels for proper channel locations - Handle sklearn TimeSeriesSplit groups parameter warning in splitters - Add filterwarnings markers for pyriemann numerical issues in SSVEP tests
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 29c77530db
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- fake.py: Use os.environ instead of mne.set_config to avoid non-standard config key warnings (~60 warnings) - preprocessing.py: Remove montage before adding reference channels then re-apply, instead of suppressing location warnings - splitters.py: Use GroupsConsumerMixin to detect group-aware cv_classes and conditionally pass groups parameter (~6 warnings). LearningCurveSplitter now inherits GroupsConsumerMixin since it genuinely uses groups.
…echX/moabb into fix/resolve-test-warnings # Conflicts: # moabb/evaluations/splitters.py
…nce matrices The cross-covariance blocks passed to pyriemann's mean_covariance were not guaranteed to be well-conditioned SPD matrices, causing 'Convergence not reached' and 'invalid value encountered in log' warnings. Symmetrize each matrix and clamp small eigenvalues to bound the condition number at 1e4 before computing the Riemannian/log-Euclidean mean. Remove the corresponding filterwarnings suppressions from the test.
…ping Replace manual eigenvalue decomposition and clamping with pyriemann's Shrinkage estimator and trace normalization to regularize ill-conditioned cross-covariance matrices before computing the Riemannian mean.
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.
Summary
pytest moabb/tests -W all, bringing the count to 0 warningsWarning fixes by category
moabb/paradigms/base.pyconcatenate_epochsmoabb/datasets/fake.pymoabb/tests/test_evaluations.pylambda x: xwith named_identityfunctionmoabb/evaluations/utils.py__init__withfunctools.wrapsto suppress upstream warningmoabb/datasets/bids_interface.pywrite_raw_bidscall (format explicitly requested)moabb/evaluations/splitters.pysplit()call — sklearn accepts groups everywhere but warnsmoabb/tests/test_classification.py@pytest.mark.filterwarningson SSVEP_TRCA testsmoabb/datasets/preprocessing.pyadd_reference_channelsTest plan
pytest moabb/tests -W all— 1060 passed, 0 warningstest_lambda_warningstill verifies the intentional warning workstest_eval_grid_search_optunapasses (sklearn clone compatibility preserved)test_custom_inner_cvpasses with TimeSeriesSplittest_BaseImagery_cachepasses (no dtype regression)