-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: Fix type annotations in b-vals iterators #29
Open
jhlegarreta
wants to merge
3
commits into
nipreps:main
Choose a base branch
from
jhlegarreta:FixbvalIteratorsTypeAnnotations
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
ENH: Fix type annotations in b-vals iterators #29
jhlegarreta
wants to merge
3
commits into
nipreps:main
from
jhlegarreta:FixbvalIteratorsTypeAnnotations
Conversation
This file contains 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
Add `None` to b-vals iterators `size` parameter annotations. Edit the parameter types accordingly in the docstrings and describe what happens when `None` is provided. Fixes: ``` src/nifreeze/utils.py:30: error: Incompatible default for argument "size" (default has type "None", argument has type "int") [assignment] src/nifreeze/utils.py:30: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True src/nifreeze/utils.py:30: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase src/nifreeze/utils.py:59: error: Incompatible default for argument "size" (default has type "None", argument has type "int") [assignment] src/nifreeze/utils.py:59: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True src/nifreeze/utils.py:59: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase src/nifreeze/utils.py:108: error: Incompatible default for argument "size" (default has type "None", argument has type "int") [assignment] src/nifreeze/utils.py:108: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True src/nifreeze/utils.py:108: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase src/nifreeze/utils.py:135: error: Incompatible default for argument "size" (default has type "None", argument has type "int") [assignment] src/nifreeze/utils.py:135: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True src/nifreeze/utils.py:135: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase ``` raised for example in: https://github.com/nipreps/nifreeze/actions/runs/12437972140/job/34728973936#step:8:32
Make `linear_iterator` return an iterator: `range` is an iterable, so call `iter` on `range` in order to return an iterator. Fixes: ``` src/nifreeze/utils.py:56: error: Incompatible return value type (got "range", expected "Iterator[int]") [return-value] src/nifreeze/utils.py:56: note: "range" is missing following "Iterator" protocol member: src/nifreeze/utils.py:56: note: __next__ ``` raised for example in: https://github.com/nipreps/nifreeze/actions/runs/12437972140/job/34728973936#step:8:35
jhlegarreta
force-pushed
the
FixbvalIteratorsTypeAnnotations
branch
from
December 22, 2024 01:07
f29739a
to
539250c
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #29 +/- ##
=======================================
Coverage 65.84% 65.84%
=======================================
Files 18 18
Lines 931 931
Branches 119 119
=======================================
Hits 613 613
Misses 274 274
Partials 44 44 ☔ View full report in Codecov by Sentry. |
Remove unused parameter from method `bvalue_iterator` prototype and docstring. Use the `*_` to denote unused arguments.
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.
size
parameter annotationslinear_iterator
return an iteratorbvalue_iterator
prototype