Skip to content

Remove deprecated aliases overdue since v1.4 (EEGNetv4, SleepStagerEldele2021, TSceptionV1, BNCI2014001)#1045

Open
bkowshik wants to merge 3 commits into
braindecode:masterfrom
bkowshik:remove-deprecated-v1.4-aliases
Open

Remove deprecated aliases overdue since v1.4 (EEGNetv4, SleepStagerEldele2021, TSceptionV1, BNCI2014001)#1045
bkowshik wants to merge 3 commits into
braindecode:masterfrom
bkowshik:remove-deprecated-v1.4-aliases

Conversation

@bkowshik

Copy link
Copy Markdown

Summary

Removes four public deprecated aliases that were scheduled for removal in v1.4. The development tree is now 1.6.1dev0 (latest release v1.5.1), so these are two minor versions past their planned removal.

Removed alias Use instead Deprecated in Where it lived
EEGNetv4 EEGNet v1.2 (#775) braindecode.models (exported)
SleepStagerEldele2021 AttnSleep v1.2 (#775) braindecode.models.attn_sleep
TSceptionV1 TSception v1.2 (#775) braindecode.models.tsinception
BNCI2014001 BNCI2014_001 v1.3 (#826) braindecode.datasets.moabb

Why now

Each deprecation message advertised removal in v1.14 (and rename in v1.12 / v1.13), which made the removal look far in the future. Those version strings are typos — an extra 1 was inserted after v1.:

  • The three model renames actually landed in v1.2.0version.py at the rename commit read 1.2.0, and they're documented under the "Current 1.2" section of whats_new.rst.
  • The BNCI2014001 rename actually landed in v1.3.0 (Rename deprecated BNCI2014001 to BNCI2014_001 #826).
  • The intended removal version was therefore v1.4, not v1.14.

Read correctly, these aliases were due for removal in v1.4. They have now been deprecated for four-plus releases, which is an ample deprecation window, so this PR finishes the job (and removes the misleading version strings in the process).

Migration

# before
from braindecode.models import EEGNetv4
from braindecode.models.attn_sleep import SleepStagerEldele2021
from braindecode.models.tsinception import TSceptionV1
from braindecode.datasets.moabb import BNCI2014001

# after
from braindecode.models import EEGNet, AttnSleep, TSception
from braindecode.datasets import BNCI2014_001

Note: only EEGNetv4 was re-exported at the package level (in braindecode.models.__all__); the other three were only reachable from their submodules.

Changes

  • Remove the four alias classes and their now-unused from mne.utils import deprecated imports (kept warn where it is still used in the same module).
  • braindecode/models/__init__.py: drop EEGNetv4 from the import and from __all__.
  • braindecode/models/util.py: remove the EEGNetv4 special-case in _init_models_dict() — it existed only to hide the alias from the model registry.
  • test/unit_tests/models/test_util.py: drop the matching EEGNetv4 exclusion in test_models_dict so the registry/models_dict equality check stays exact.
  • test/unit_tests/models/test_config.py: use EEGNet instead of EEGNetv4.
  • docs/whats_new.rst: add an entry under "API and behavior changes" for the current release cycle. Historical changelog entries that mention the old names are left untouched as a record.

Testing

  • pytest test/unit_tests/models/test_util.py test/unit_tests/models/test_config.py136 passed.
  • ruff check is clean on all modified files (no unused imports, no undefined names).
  • No remaining references to the removed names in .py sources.

Notes

This is a backward-incompatible removal of public API. Happy to retarget it to a specific release if you prefer to batch breaking changes for a particular version.

EEGNetv4, SleepStagerEldele2021, TSceptionV1, and BNCI2014001 were
deprecated in v1.2/v1.3 and scheduled for removal in v1.4 (the
messages' v1.12/v1.13/v1.14 were typos). Tree is now 1.6.x, so they
are past due. Removes the alias classes, the EEGNetv4 export and
model-registry special-case, updates tests to the new names, and adds
a whats_new entry.
Comment thread docs/whats_new.rst
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.

2 participants