Skip to content

Keep the 1.8.1 positional parameters of Labram, CBraMod and LUNA - #1514

Merged
bruAristimunha merged 1 commit into
braindecode:masterfrom
bruAristimunha:bd2-fix-on-non-divisible-position
Nov 2, 2026
Merged

bruAristimunha merged 1 commit into
braindecode:masterfrom
bruAristimunha:bd2-fix-on-non-divisible-position

Conversation

@bruAristimunha

Copy link
Copy Markdown
Collaborator

Restores the 1.8.1 positional order of Labram, CBraMod and LUNA. #1226 inserted on_non_divisible in the middle of their signatures, so a positional call written for 1.8.1 raised ValueError on master. The parameter now sits at the end, as a new keyword.

A new test pins the 1.8.1 positional order of all 61 models that existed in 1.8.1, so this cannot slip again before 2.0. It fails on master and passes here; test/unit_tests/models passes (514 passed, 0 failed).

Found by the v1.8.1 → master compatibility audit for the 2.0 release.

braindecode#1226 inserted on_non_divisible after patch_size/learned_patcher, so a
positional call written for 1.8.1 passed embed_dim (Labram),
dim_feedforward (CBraMod) or num_queries (LUNA) as on_non_divisible.
Move it after the 1.8.1 parameters and pin the 1.8.1 positional order of
every 1.8.1 model in a test.
Copilot AI balanced review requested due to automatic review settings November 2, 2026 13:24
@bruAristimunha
bruAristimunha merged commit 234aeb7 into braindecode:master Nov 2, 2026
4 of 7 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.

🟢 Approval recommended

No active review issues were identified for the changes restoring positional-call compatibility in Labram, CBraMod, and LUNA.

No open issues 🎉

What changed in this PR

Restores braindecode 1.8.1 positional-call compatibility for Labram, CBraMod, and LUNA, correcting parameter shifts introduced by #1226.

Changes:

  • Moves on_non_divisible after the existing 1.8.1 parameters in all three constructors, preserving its "pad" default.
  • Adds a regression test that checks the positional parameter order of all 61 models covered by the 1.8.1 baseline.
File Description
test/​unit_tests/​models/​test_positional_compat.py Pins the 1.8.1 positional parameter order for 61 models.
braindecode/​models/​luna.py Restores LUNA’s original positional parameter order.
braindecode/​models/​labram.py Restores Labram’s original positional parameter order.
braindecode/​models/​cbramod.py Restores CBraMod’s original positional parameter order.

Review effort: Balanced

@codecov

codecov Bot commented Nov 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.33%. Comparing base (7c25ac0) to head (ec49196).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1514   +/-   ##
=======================================
  Coverage   91.33%   91.33%           
=======================================
  Files         170      170           
  Lines       22100    22100           
=======================================
  Hits        20184    20184           
  Misses       1916     1916           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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