Make most arguments keyword-only, enforced by PLR0917 (#1288) - #1297
Open
selmanozleyen wants to merge 5 commits into
Open
selmanozleyen wants to merge 5 commits into
selmanozleyen wants to merge 5 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1297 +/- ##
==========================================
+ Coverage 78.63% 78.74% +0.10%
==========================================
Files 64 64
Lines 9604 9653 +49
Branches 1613 1613
==========================================
+ Hits 7552 7601 +49
Misses 1497 1497
Partials 555 555
🚀 New features to boost your workflow:
|
selmanozleyen
marked this pull request as draft
September 29, 2026 14:11
selmanozleyen
marked this pull request as ready for review
September 29, 2026 16:06
selmanozleyen
requested review from
timtreis
and removed request for
timtreis
September 29, 2026 21:47
Ruff's PLR0917 (preview, selected explicitly) now flags any function with more than five positional arguments. - Public functions take only their data object positionally; everything after it is keyword-only. Released functions keep accepting the old positional calls through legacy-api-wrap, with a FutureWarning naming the arguments. Experimental functions don't: that API promises no stability. - Private functions change only where the rule flags them: arguments with a default become keyword-only, and helpers whose arguments are all required keep only their first argument positional. Numba kernels are exempted, since numba needs positional arguments. - Left as on main: the deprecated calculate_niche and its validator (removed in v1.9.0), and ImageContainer until it is deprecated. - Internal and test callers pass the moved arguments by name. Tests are exempted from the rule, since pytest passes fixtures by name. Preview mode also caught an undefined apply_stain_normalization in squidpy.experimental.im.__all__, removed here. Also documents these rules and the rng conventions in the contribution guide, and drops the unused docs/release/notes-dev.md: release notes come from the PR changelog.
… name v1.9.0 in the warning
selmanozleyen
force-pushed
the
chore/kwonly-args
branch
from
October 1, 2026 12:22
e523269 to
75b4beb
Compare
This branch has not been deployed
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.
fixes: #1288 plus I also removed notes-dev.md as it's old. I also added some items to the contribution guide.
The rule: every public function takes only its data object positionally (adata, *, ...), everything after it is keyword-only. Private helpers that take an AnnData or SpatialData first follow the same rule; other private helpers only need to pass PLR0917.
The ones I didn't include:
Tests changed because
Follow-ups