Skip to content

release: v1.8.2 - #1533

Merged
bruAristimunha merged 4 commits into
braindecode:maint/1.8.xfrom
bruAristimunha:maint/1.8.x
Nov 2, 2026
Merged

bruAristimunha merged 4 commits into
braindecode:maint/1.8.xfrom
bruAristimunha:maint/1.8.x

Conversation

@bruAristimunha

Copy link
Copy Markdown
Collaborator

Patch release 1.8.2 on the new maint/1.8.x branch (created at v1.8.1, 85b8b5c). Four commits:

Verified in Voyager Jobs against the installed wheel, with the source tree removed from the test root:

  • py3.12 + torch 2.15: 3417 passed, 0 failed
  • py3.12 + torch 2.6: 3417 passed, 0 failed
  • py3.14 with the latest versions of everything: 3319 passed, 0 failed
  • pre-commit on all changed files: clean

For comparison, v1.8.1 on torch 2.15 gives 6 failures.

Merge with Rebase and merge so the backports stay separate commits and release: v1.8.2 stays last. This branch must not be merged into master.

bruAristimunha and others added 4 commits November 2, 2026 16:25
…ecode#1501)

* FIX FilterBankLayer TorchScript with PyTorch 2.15

PyTorch 2.15 added torch.autograd.Function.input_grad_buffers, annotated
tuple[Tensor | None, ...], which TorchScript cannot parse. Scripting
FilterBankLayer compiles torchaudio's lfilter, whose DifferentiableFIR and
DifferentiableIIR are autograd.Function subclasses, so FBCNet, FBMSNet,
FBLightConvNet and IFNet no longer script.

Eager filtering keeps calling torchaudio. The scripted path runs the ops
torchaudio's own scripted path runs (FIR conv1d, then its IIR core loop),
so scripted outputs are unchanged. _apply_iir calls lfilter or filtfilt in
an if/else, since the helpers no longer take torchaudio's clamp argument.

* DOC whats_new: PR number for braindecode#1501

* TST cover the scripted lfilter ops in eager mode

Coverage cannot trace code that only runs inside TorchScript. Call the
scripted ops directly as well and check them against torchaudio bit for
bit, and check the Python core-loop fallback against torchaudio's loop.

(cherry picked from commit 9db6051)
…decode#1164)

* Fix FutureWarning for renamed standard montages on MNE >= 1.13

MNE 1.13 renamed standard_1005/standard_1020 to colin27_1005/
colin27_1020 and deprecated the legacy names, which will raise in
MNE 1.14. braindecode supports mne>=1.11, where only the legacy
names exist, so the spelling is now resolved against the installed
MNE version via the new braindecode.util.resolve_montage_name() and
used at every internal montage lookup (eegpt, dgcnn, interpolated,
tuh, augmentation transforms).

Fixes braindecode#1163

* Make test_always_mode_uses_mne_even_when_names_match numerically robust

The old assertion required the MNE spline matrix for a channel set
interpolated onto its own positions to have off-diagonal structure
> 1e-6, but self-interpolation is (correctly) numerically exact
identity, so the test failed on all CI platforms.

Rework the test to use the same channel names at different positions:
name_match yields the permutation matrix, while always mode must
compute the MNE spline onto the new positions, which mixes several
sources per target row (off-diagonal weights O(0.1-1), stable across
platforms) and preserves constant signals (row sums = 1).

---------

Co-authored-by: LiQing <[email protected]>
(cherry picked from commit f6144d3)
…chaudio < 2.11

Backport of the master test fix (bd2deep/lfilter-test-torch26): on the
torch/torchaudio 2.6 floor, torchaudio's eager IIR recursion rounds
differently from the ops of its scripted path.
Patch release of the 1.8 series: version 1.8.2 and its whats_new section.
Backports braindecode#1501 (TorchScript of the filter-bank models on PyTorch 2.15) and
braindecode#1164 (MNE >= 1.13 montage renames: FutureWarning at import, error from
MNE 1.14).
Copilot AI balanced review requested due to automatic review settings November 2, 2026 20:55
@bruAristimunha

Copy link
Copy Markdown
Collaborator Author

CI note: tests.yml and whats-new.yml filter pull_request on branches: ['*'], and * does not match /, so they do not start for the base maint/1.8.x. Only pre-commit runs here, and it passed. Codacy is advisory. The release commit updates docs/whats_new.rst. The test evidence for head c440cd25 comes from Voyager Jobs run against the installed wheel: 3417 passed / 0 failed on py3.12 + torch 2.15, 3417 / 0 on py3.12 + torch 2.6, and 3319 / 0 on py3.14 latest. The squash keeps the tree of c440cd25 unchanged.

@bruAristimunha
bruAristimunha merged commit 7c673e3 into braindecode:maint/1.8.x Nov 2, 2026
2 of 3 checks passed

Copilot AI 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.

🟡 Changes recommended

On MNE versions before 1.13, the new Colin27 montage names are not translated to their legacy equivalents, breaking documented support for either spelling.

1 open issue
What changed in this PR

This patch release prepares Braindecode 1.8.2 with compatibility backports for PyTorch filtering and MNE montage names.

Changes:

  • Add TorchScript-safe filtering helpers while preserving eager torchaudio behavior.
  • Resolve renamed MNE montages across affected models, datasets, and augmentations.
  • Update regression tests, API documentation, release notes, and the package version.
File Description
test/​unit_tests/​test_util.py Add montage-resolution and warning regression tests.
test/​unit_tests/​models/​test_modules.py Test scripted filtering, fallback recursion, and version-dependent tolerances.
test/​unit_tests/​models/​test_interpolation.py Use distinct positions to distinguish interpolation modes.
docs/​whats_new.rst Document the 1.8.2 fixes and contributor credit.
docs/​api.rst Expose the montage resolver in API documentation.
braindecode/​version.py Set the version to 1.8.2.
braindecode/​util.py Add version-aware montage-name resolution.
braindecode/​modules/​filter.py Route filtering through TorchScript-safe helpers.
braindecode/​models/​interpolated.py Resolve montage names before building channel metadata.
braindecode/​models/​eegpt.py Resolve montage names during channel initialization.
braindecode/​models/​dgcnn.py Resolve the montage used to infer electrode positions.
braindecode/​functional/​_lfilter.py Add eager and scripted filtering implementations.
braindecode/​datasets/​tuh.py Resolve montages for channel naming and positioning.
braindecode/​augmentation/​transforms.py Resolve sensor-position montages and annotate the example.
braindecode/​augmentation/​functional.py Annotate the montage rename in the rotation example.

Review effort: Balanced

Comment thread braindecode/util.py
Comment on lines +379 to +382
new_name = _RENAMED_STANDARD_MONTAGES.get(name)
if new_name is not None and new_name in mne.channels.get_builtin_montages():
return new_name
return name
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