-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add pytype testing options #499
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
Merged
Nic-Ma
merged 4 commits into
Project-MONAI:master
from
BRAINSia:add-pytype-testing-options
Jun 10, 2020
Merged
Add pytype testing options #499
Nic-Ma
merged 4 commits into
Project-MONAI:master
from
BRAINSia:add-pytype-testing-options
Jun 10, 2020
Conversation
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
11 tasks
wyli
reviewed
Jun 6, 2020
1a91a35
to
80c9b0d
Compare
wyli
approved these changes
Jun 9, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you!
80c9b0d
to
6dbbaf7
Compare
Nic-Ma
reviewed
Jun 9, 2020
6dbbaf7
to
308cb58
Compare
- Add type concept for index selection types - Enable precise return checking for invalid function calls - Test solve unknown types to label with structural types Add conceptual type for dictionary selection variables Values used to select dictionary subsets must be containers of hashable elements. File "monai/monai/transforms/io/dictionary.py", line 55, in __init__: Function LoadNiftid.__init__ was called with the wrong arguments [wrong-arg-types] Expected: (self, keys: Container[Hashable]) Actually passed: (self, keys: Hashable) The following methods aren't implemented on Hashable: __iter__
File "monai/monai/transforms/croppad/dictionary.py", line 136, in randomize: Function monai.utils.misc.ensure_tuple was called with the wrong arguments [wrong-arg-types] Expected: (vals: Iterable) Actually passed: (vals: slice) The following methods aren't implemented on slice: __iter__
For backward compatibility, allow `keys` to accept either a collection or a hashable item. change self.keys to have the required more strict value type than the function parameter `keys`.
fa40d62
to
0acdefc
Compare
monai/transforms/intensity/dictionary.py:334: error: Incompatible types in assignment (expression has type "Union[Tuple[Any, ...], List[Any]]", variable has type "Tuple[float, Any]")
0acdefc
to
6359e43
Compare
@Nic-Ma I think all the requested changes have been made. |
Nic-Ma
approved these changes
Jun 10, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me now.
Thanks.
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.
Related to #476
Description
Add additional pytype checks, and address the newly identified warnings.
Status
Ready
Types of changes