Skip to content
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

Mypy warning: Signature of "__call__" incompatible with supertype "Transform" #495

Closed
hjmjohnson opened this issue Jun 5, 2020 · 0 comments · Fixed by #521
Closed

Mypy warning: Signature of "__call__" incompatible with supertype "Transform" #495

hjmjohnson opened this issue Jun 5, 2020 · 0 comments · Fixed by #521

Comments

@hjmjohnson
Copy link
Contributor

Describe the bug
Mypy reported warnings related to inconsistent function prototypes.

To Reproduce
Steps to reproduce the behavior:

  1. Remove # type: ignore suppression comments from
monai/transforms/utility/array.py:121: error: Signature of "__call__" incompatible with supertype "Transform"
monai/transforms/utility/array.py:164: error: Signature of "__call__" incompatible with supertype "Transform"
monai/transforms/utility/array.py:212: error: Signature of "__call__" incompatible with supertype "Transform"
monai/transforms/spatial/array.py:82: error: Signature of "__call__" incompatible with supertype "Transform"
monai/transforms/spatial/array.py:165: error: Signature of "__call__" incompatible with supertype "Transform"
monai/transforms/spatial/array.py:264: error: Signature of "__call__" incompatible with supertype "Transform"
monai/transforms/spatial/array.py:332: error: Signature of "__call__" incompatible with supertype "Transform"
monai/transforms/spatial/array.py:474: error: Signature of "__call__" incompatible with supertype "Transform"
monai/transforms/spatial/array.py:570: error: Signature of "__call__" incompatible with supertype "Transform"
monai/transforms/spatial/array.py:674: error: Signature of "__call__" incompatible with supertype "Transform"
monai/transforms/spatial/array.py:890: error: Signature of "__call__" incompatible with supertype "Transform"
monai/transforms/spatial/array.py:980: error: Signature of "__call__" incompatible with supertype "Transform"
monai/transforms/spatial/array.py:1064: error: Signature of "__call__" incompatible with supertype "Transform"
monai/transforms/spatial/array.py:1161: error: Signature of "__call__" incompatible with supertype "Transform"
monai/transforms/post/array.py:41: error: Signature of "__call__" incompatible with supertype "Transform"
monai/transforms/post/array.py:72: error: Signature of "__call__" incompatible with supertype "Transform"
monai/transforms/post/array.py:121: error: Signature of "__call__" incompatible with supertype "Transform"
monai/transforms/croppad/array.py:56: error: Signature of "__call__" incompatible with supertype "Transform"
  1. MYPYPATH=$(pwd)/monai mypy $(pwd)

Expected behavior
Clean static testing.

hjmjohnson added a commit to BRAINSia/MONAI that referenced this issue Jun 5, 2020
hjmjohnson added a commit to BRAINSia/MONAI that referenced this issue Jun 5, 2020
hjmjohnson added a commit to BRAINSia/MONAI that referenced this issue Jun 5, 2020
hjmjohnson added a commit to BRAINSia/MONAI that referenced this issue Jun 5, 2020
hjmjohnson added a commit to BRAINSia/MONAI that referenced this issue Jun 5, 2020
hjmjohnson added a commit to BRAINSia/MONAI that referenced this issue Jun 5, 2020
hjmjohnson added a commit to BRAINSia/MONAI that referenced this issue Jun 5, 2020
hjmjohnson added a commit to BRAINSia/MONAI that referenced this issue Jun 5, 2020
hjmjohnson added a commit to BRAINSia/MONAI that referenced this issue Jun 6, 2020
wyli pushed a commit that referenced this issue Jun 6, 2020
* Add subcommands to the individual codeformat test

One often wants to run the very fast codeformatting tests without
running any of the unit tests. Add a commands to allow this
behavior with "./runtests.sh [--black|--pytype|--mypy|--flake8]".

One often wants the `black` formatting tool to automatically
fix formatting violations without requiring explicit
manual call. Use "./runtests.sh --black-fix"

Add mypy static checking tool to monai

Run the complete mypy static checking tool during evaluations
of code format style checks.

Related to #476 subtask for enable mypy

Expand the documentation for runtest.sh script.  Provide more expressive
documentation for `-h`

The dryrun request to print the commands used for static
and format checking without actually running the commands.

* Temporarily add branch needed to trigger CI of this codebase.

* Suppress mypy warnings about incompatible superclass signature

Related to #495

* Suppress mypy error: Cannot assign to a method

Related to #494

* Mypy potential type mismatch resolved with assertion.

* Mypy type ambiguity resolved.
ghost pushed a commit to BRAINSia/MONAI that referenced this issue Jun 8, 2020
Co-authored-by: Cameron Trentz <[email protected]>
Co-authored-by: Hans Johnson <[email protected]>
ghost pushed a commit to BRAINSia/MONAI that referenced this issue Jun 9, 2020
Co-authored-by: Cameron Trentz <[email protected]>
Co-authored-by: Hans Johnson <[email protected]>
ghost pushed a commit to BRAINSia/MONAI that referenced this issue Jun 9, 2020
hjmjohnson added a commit to BRAINSia/MONAI that referenced this issue Jun 9, 2020
Avoid linting warnings like: Overriding a method without ensuring that
both methods accept the same number and type of parameters has the
potential to cause an error when there is a mismatch.

Resolves Project-MONAI#495
ghost pushed a commit to BRAINSia/MONAI that referenced this issue Jun 9, 2020
…th supertype "Transform")

Co-authored-by: Cameron Trentz <[email protected]>
hjmjohnson added a commit to BRAINSia/MONAI that referenced this issue Jun 9, 2020
Avoid linting warnings like: Overriding a method without ensuring that
both methods accept the same number and type of parameters has the
potential to cause an error when there is a mismatch.

Resolves Project-MONAI#495
hjmjohnson added a commit to BRAINSia/MONAI that referenced this issue Jun 10, 2020
Avoid linting warnings like: Overriding a method without ensuring that
both methods accept the same number and type of parameters has the
potential to cause an error when there is a mismatch.

Resolves Project-MONAI#495
hjmjohnson pushed a commit to BRAINSia/MONAI that referenced this issue Jun 10, 2020
…th supertype "Transform")

Co-authored-by: Cameron Trentz <[email protected]>
hjmjohnson pushed a commit to BRAINSia/MONAI that referenced this issue Jun 10, 2020
…th supertype "Transform")

Co-authored-by: Cameron Trentz <[email protected]>
hjmjohnson added a commit to BRAINSia/MONAI that referenced this issue Jun 10, 2020
Avoid linting warnings like: Overriding a method without ensuring that
both methods accept the same number and type of parameters has the
potential to cause an error when there is a mismatch.

Resolves Project-MONAI#495
ghost pushed a commit to BRAINSia/MONAI that referenced this issue Jun 10, 2020
ghost pushed a commit to BRAINSia/MONAI that referenced this issue Jun 10, 2020
hjmjohnson added a commit to BRAINSia/MONAI that referenced this issue Jun 11, 2020
Avoid linting warnings like: Overriding a method without ensuring that
both methods accept the same number and type of parameters has the
potential to cause an error when there is a mismatch.

Resolves Project-MONAI#495
@wyli wyli closed this as completed in #521 Jun 11, 2020
wyli pushed a commit that referenced this issue Jun 11, 2020
Avoid linting warnings like: Overriding a method without ensuring that
both methods accept the same number and type of parameters has the
potential to cause an error when there is a mismatch.

Resolves #495
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant