Skip to content

REVE: keep the resolved on_non_divisible in a str variable (mypy and ruff format after #1517) - #1519

Merged
bruAristimunha merged 2 commits into
braindecode:masterfrom
bruAristimunha:bd2-fix-reve-mypy
Nov 2, 2026
Merged

bruAristimunha merged 2 commits into
braindecode:masterfrom
bruAristimunha:bd2-fix-reve-mypy

Conversation

@bruAristimunha

Copy link
Copy Markdown
Collaborator

#1517 was merged without CI, and pre-commit now fails on master in braindecode/models/reve.py:

  • mypy reports 4 arg-type errors (str | None passed where str is expected, lines 330, 339, 424 and 517);
  • ruff format wants to reflow one line.

This PR:

  • resolves the unset on_non_divisible into a separate str variable (mode) and stores that on self.on_non_divisible;
  • applies ruff's reformat;
  • adds a whats_new line.

Behaviour is unchanged: unset still means "crop" with a FutureWarning when the window is not tiled.

Checked in a Voyager Job (prcheck-reve, base a4de2dc):

  • pre-commit run --files on the changed files: mypy passes, and ruff format passes after the second commit;
  • test_on_non_divisible.py plus test_models.py -k "REVE or reve or non_divisible": 25 passed, 4 skipped;
  • narrow Sphinx build of whats_new and the REVE pages: no new warnings.

Copilot AI balanced review requested due to automatic review settings November 2, 2026 13:41

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 are reported for the REVE type-checking fix.

No open issues 🎉

What changed in this PR

This PR fixes REVE’s type-checking regression after #1517 while preserving the default cropping behavior and warning for untiled windows.

Changes:

  • Resolves optional on_non_divisible into a string-valued mode used for validation, storage, and padding checks.
  • Applies the requested formatting adjustment.
  • Adds a changelog entry documenting the typing fix.
File Description
docs/​whats_new.rst Documents the mypy fix and unchanged behavior.
braindecode/​models/​reve.py Introduces the resolved mode variable and reformats the tiling check.

Review effort: Balanced

@bruAristimunha
bruAristimunha merged commit df00c41 into braindecode:master Nov 2, 2026
7 checks passed
bruAristimunha added a commit to bruAristimunha/braindecode that referenced this pull request Nov 2, 2026
bruAristimunha added a commit that referenced this pull request Nov 2, 2026
…rop_last_window removal moved to 3.0 (#1520)

* whats_new: Breaking changes in 2.0, corrected PR references; drop_last_window removal moves to 3.0

* whats_new: PR references from #1237 (NeuroRVQ, llms.txt, BrainTokenizer, BrainOmni, Deep4Net, AvgPool2dWithConv, TimeDistributed, Chomp1d, #1166), BaRISTA #1175 entry, MIRepNet (#1146) under the current section

* whats_new: cite #1519
@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.34%. Comparing base (7c25ac0) to head (c8f63b8).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1519      +/-   ##
==========================================
+ Coverage   91.33%   91.34%   +0.01%     
==========================================
  Files         170      170              
  Lines       22100    22105       +5     
==========================================
+ Hits        20184    20192       +8     
+ Misses       1916     1913       -3     
🚀 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