Repository navigation
API Deprecate the orphaned public API listed in #1442 - #1734
Merged
bruAristimunha merged 5 commits intoNov 21, 2026
Merged
bruAristimunha merged 5 commits into
bruAristimunha merged 5 commits into
Conversation
MaxNormConstraintCallback, load_bbci_sets_from_folder, is_registered_dataset, IntermediateOutputWrapper, StatLayer and the util functions get_balanced_batches, read_all_file_names, corr and cov have no user in braindecode. Each now emits a DeprecationWarning and will be removed in 2.2. MeanLayer and the other stat layers keep working without a warning because they now build on a private _StatLayer.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1734 +/- ##
==========================================
+ Coverage 92.26% 93.78% +1.51%
==========================================
Files 185 190 +5
Lines 24325 24956 +631
==========================================
+ Hits 22443 23404 +961
+ Misses 1882 1552 -330 🚀 New features to boost your workflow:
|
…y the docs - Restore braindecode/modules/stats.py to master and drop the StatLayer test cases. StatLayer is not orphaned: it is the class behind MeanLayer, MaxLayer, VarLayer, StdLayer, LogVarLayer and LogPowerLayer, which FBCNet, FBMSNet and FBLightConvNet build. The restructure changed isinstance and type names for code written against v2.0.0. - Warn with FutureWarning instead of DeprecationWarning. The default Python filters hide a DeprecationWarning raised from a user's imported module, and every other 2.1 deprecation uses FutureWarning. - Move each .. deprecated:: note out of the Returns and Examples sections to just after the summary, so numpydoc no longer reads it as a return value. - Shorten the changelog entry to 3 lines. - test_util.py ignores the new warning; test_orphan_deprecations checks it.
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
The checklist in #1442 asks to "Deprecate the orphaned public API listed above". Nine public names have no user in braindecode. This PR makes each emit a
DeprecationWarningand announces removal in 2.2.VectorQuantizeris left out because BrainOmni, MEGXL and NeuroRVQTokenizer now use it.Part of #1442
Changes
_warn_orphaned_apihelper inbraindecode/util.py. It warns at the caller's line.MaxNormConstraintCallback,load_bbci_sets_from_folder,is_registered_dataset,IntermediateOutputWrapper,StatLayer,get_balanced_batches,read_all_file_names,corrandcov. Each docstring gets a.. deprecated:: 2.1note.MeanLayer,MaxLayer,VarLayer,StdLayer,LogVarLayerandLogPowerLayerare used by FBCNet and FBLightConvNet. They now build on a private_StatLayer, so they do not warn.StatLayeris a thin subclass that warns.corrcalls a private_cov, so it emits one warning, not two.docs/whats_new.rstentry in "API and behavior changes".Testing
python -m pytest -n 2 -q test/unit_tests/test_orphan_deprecations.py test/unit_tests/test_util.py test/unit_tests/modules test/unit_tests/training: 1862 passed, 68 skipped.python -m pytest -q test/unit_tests/test_orphan_deprecations.pyafter a last test edit: 10 passed.ruff formaton the changed files. I did not runpre-commit, because it is not installed in the shared environment.I did not run the model and dataset test suites.
New or changed behavior is covered by relevant regression tests
Style checks recorded
docs/whats_new.rstupdatedNotes for reviewers
StatLayerwas not fully orphaned: the stat layer partials wrap it. The private base keeps those layers silent.AI disclosure: this PR was prepared with AI assistance (Claude, Anthropic).