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

New issue introduced in mypy 1.11.0 #7940

Closed
KumoLiu opened this issue Jul 22, 2024 · 0 comments · Fixed by #7941
Closed

New issue introduced in mypy 1.11.0 #7940

KumoLiu opened this issue Jul 22, 2024 · 0 comments · Fixed by #7941

Comments

@KumoLiu
Copy link
Contributor

KumoLiu commented Jul 22, 2024

mypy 1.11.0 (compiled: yes)
monai/data/meta_tensor.py:508:5: error: Signature of "new_empty" incompatible with supertype "TensorBase"  [override]
monai/data/meta_tensor.py:508:5: note:      Superclass:
monai/data/meta_tensor.py:508:5: note:          @overload
monai/data/meta_tensor.py:508:5: note:          def new_empty(self, size: Sequence[Union[int, SymInt]], *, dtype: Optional[dtype] = ..., layout: Optional[layout] = ..., device: Optional[Union[str, device, int]] = ..., pin_memory: Optional[bool] = ..., requires_grad: Optional[bool] = ...) -> Tensor
monai/data/meta_tensor.py:508:5: note:          @overload
monai/data/meta_tensor.py:508:5: note:          def new_empty(self, *size: int, dtype: Optional[dtype] = ..., layout: Optional[layout] = ..., device: Optional[Union[str, device, int]] = ..., pin_memory: Optional[bool] = ..., requires_grad: Optional[bool] = ...) -> Tensor
monai/data/meta_tensor.py:508:5: note:      Subclass:
monai/data/meta_tensor.py:508:5: note:          def new_empty(self, size: Any, dtype: Any = ..., device: Any = ..., requires_grad: Any = ...) -> Any
monai/data/meta_tensor.py:583:5: error: Signature of "__repr__" incompatible with supertype "Tensor"  [override]
monai/data/meta_tensor.py:583:5: note:      Superclass:
monai/data/meta_tensor.py:583:5: note:          def __repr__(self, *, Any = ...) -> Any
monai/data/meta_tensor.py:583:5: note:      Subclass:
monai/data/meta_tensor.py:583:5: note:          def __repr__(self) -> Any
monai/transforms/utility/array.py:1661:55: error: Argument "kernel_size" to "median_filter" has incompatible type "int"; expected "Sequence[int]"  [arg-type]
monai/visualize/class_activation_maps.py:305:5: error: Signature of "__call__" incompatible with supertype "CAMBase"  [override]
monai/visualize/class_activation_maps.py:305:5: note:      Superclass:
monai/visualize/class_activation_maps.py:305:5: note:          def __call__(self) -> Any
monai/visualize/class_activation_maps.py:305:5: note:      Subclass:
monai/visualize/class_activation_maps.py:305:5: note:          def __call__(self, x: Any, class_idx: Any = ..., layer_idx: Any = ..., **kwargs: Any) -> Any
monai/visualize/class_activation_maps.py:[364](https://github.com/Project-MONAI/MONAI/actions/runs/10038377153/job/27740171728?pr=7937#step:7:365):5: error: Signature of "compute_map" incompatible with supertype "CAMBase"  [override]
monai/visualize/class_activation_maps.py:364:5: note:      Superclass:
monai/visualize/class_activation_maps.py:364:5: note:          def compute_map(self, x: Any, class_idx: Any = ..., layer_idx: Any = ...) -> Any
monai/visualize/class_activation_maps.py:364:5: note:      Subclass:
monai/visualize/class_activation_maps.py:364:5: note:          def compute_map(self, x: Any, class_idx: Any = ..., retain_graph: Any = ..., layer_idx: Any = ..., **kwargs: Any) -> Any
monai/visualize/class_activation_maps.py:372:5: error: Signature of "__call__" incompatible with supertype "CAMBase"  [override]
monai/visualize/class_activation_maps.py:372:5: note:      Superclass:
monai/visualize/class_activation_maps.py:372:5: note:          def __call__(self) -> Any
monai/visualize/class_activation_maps.py:[372](https://github.com/Project-MONAI/MONAI/actions/runs/10038377153/job/27740171728?pr=7937#step:7:373):5: note:      Subclass:
monai/visualize/class_activation_maps.py:372:5: note:          def __call__(self, x: Any, class_idx: Any = ..., layer_idx: Any = ..., retain_graph: Any = ..., **kwargs: Any) -> Any
monai/visualize/class_activation_maps.py:404:5: error: Signature of "compute_map" incompatible with supertype "CAMBase"  [override]
monai/visualize/class_activation_maps.py:404:5: note:      Superclass:
monai/visualize/class_activation_maps.py:404:5: note:          def compute_map(self, x: Any, class_idx: Any = ..., layer_idx: Any = ...) -> Any
monai/visualize/class_activation_maps.py:404:5: note:      Subclass:
monai/visualize/class_activation_maps.py:404:5: note:          def compute_map(self, x: Any, class_idx: Any = ..., retain_graph: Any = ..., layer_idx: Any = ..., **kwargs: Any) -> Any
monai/networks/nets/quicknat.py:45:5: error: Signature of "forward" incompatible with supertype "SkipConnection"  [override]
monai/networks/nets/quicknat.py:45:5: note:      Superclass:
monai/networks/nets/quicknat.py:45:5: note:          def forward(self, x: Tensor) -> Tensor
monai/networks/nets/quicknat.py:45:5: note:      Subclass:
monai/networks/nets/quicknat.py:45:5: note:          def forward(self, input: Any, indices: Any) -> Any
monai/networks/nets/quicknat.py:60:5: error: Signature of "forward" incompatible with supertype "Sequential"  [override]
monai/networks/nets/quicknat.py:60:5: note:      Superclass:
monai/networks/nets/quicknat.py:60:5: note:          def forward(self, input: Any) -> Any
monai/networks/nets/quicknat.py:60:5: note:      Subclass:
monai/networks/nets/quicknat.py:60:5: note:          def forward(self, input: Any, indices: Any) -> Any
monai/networks/nets/quicknat.py:168:5: error: Signature of "forward" incompatible with supertype "DenseBlock"  [override]
monai/networks/nets/quicknat.py:168:5: note:      Superclass:
monai/networks/nets/quicknat.py:168:5: note:          def forward(self, x: Any) -> Any
monai/networks/nets/quicknat.py:168:5: note:      Subclass:
monai/networks/nets/quicknat.py:168:5: note:          def forward(self, input: Any, _: Any) -> Any
monai/networks/nets/quicknat.py:168:5: error: Signature of "forward" incompatible with supertype "Sequential"  [override]
monai/networks/nets/quicknat.py:168:5: note:      Superclass:
monai/networks/nets/quicknat.py:168:5: note:          def forward(self, input: Any) -> Any
monai/networks/nets/quicknat.py:168:5: note:      Subclass:
monai/networks/nets/quicknat.py:168:5: note:          def forward(self, input: Any, _: Any) -> Any
monai/networks/nets/quicknat.py:246:5: error: Signature of "forward" incompatible with supertype "DenseBlock"  [override]
monai/networks/nets/quicknat.py:246:5: note:      Superclass:
monai/networks/nets/quicknat.py:246:5: note:          def forward(self, x: Any) -> Any
monai/networks/nets/quicknat.py:246:5: note:      Subclass:
monai/networks/nets/quicknat.py:246:5: note:          def forward(self, input: Any, indices: Any) -> Any
monai/networks/nets/quicknat.py:246:5: error: Signature of "forward" incompatible with supertype "Sequential"  [override]
monai/networks/nets/quicknat.py:246:5: note:      Superclass:
monai/networks/nets/quicknat.py:246:5: note:          def forward(self, input: Any) -> Any
monai/networks/nets/quicknat.py:246:5: note:      Subclass:
monai/networks/nets/quicknat.py:246:5: note:          def forward(self, input: Any, indices: Any) -> Any
monai/networks/nets/quicknat.py:273:5: error: Signature of "forward" incompatible with supertype "DenseBlock"  [override]
monai/networks/nets/quicknat.py:273:5: note:      Superclass:
monai/networks/nets/quicknat.py:273:5: note:          def forward(self, x: Any) -> Any
monai/networks/nets/quicknat.py:273:5: note:      Subclass:
monai/networks/nets/quicknat.py:273:5: note:          def forward(self, input: Any, indices: Any) -> Any
monai/networks/nets/quicknat.py:273:5: error: Signature of "forward" incompatible with supertype "Sequential"  [override]
monai/networks/nets/quicknat.py:273:5: note:      Superclass:
monai/networks/nets/quicknat.py:273:5: note:          def forward(self, input: Any) -> Any
monai/networks/nets/quicknat.py:273:5: note:      Subclass:
monai/networks/nets/quicknat.py:273:5: note:          def forward(self, input: Any, indices: Any) -> Any
tests/test_subpixel_upsample.py:58:27: error: Argument 1 to "append" of "list" has incompatible type "list[Collection[Union[str, int]]]"; expected "list[Collection[object]]"  [arg-type]
tests/test_subpixel_upsample.py:58:27: note: "List" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
tests/test_subpixel_upsample.py:58:27: note: Consider using "Sequence" instead, which is covariant
tests/test_subpixel_upsample.py:59:27: error: Argument 1 to "append" of "list" has incompatible type "list[Collection[Union[str, int]]]"; expected "list[Collection[object]]"  [arg-type]
tests/test_subpixel_upsample.py:59:27: note: "List" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
tests/test_subpixel_upsample.py:59:27: note: Consider using "Sequence" instead, which is covariant
tests/test_subpixel_upsample.py:60:27: error: Argument 1 to "append" of "list" has incompatible type "list[Collection[Union[str, int]]]"; expected "list[Collection[object]]"  [arg-type]
tests/test_subpixel_upsample.py:60:27: note: "List" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
tests/test_subpixel_upsample.py:60:27: note: Consider using "Sequence" instead, which is covariant
tests/test_inverse.py:95:46: error: Argument "roi_center" to "SpatialCropd" has incompatible type "int"; expected "Optional[Sequence[int]]"  [arg-type]
tests/test_inverse.py:95:59: error: Argument "roi_size" to "SpatialCropd" has incompatible type "int"; expected "Optional[Sequence[int]]"  [arg-type]
tests/test_inverse.py:96:46: error: Argument "roi_center" to "SpatialCropd" has incompatible type "int"; expected "Optional[Sequence[int]]"  [arg-type]
tests/test_inverse.py:96:59: error: Argument "roi_size" to "SpatialCropd" has incompatible type "int"; expected "Optional[Sequence[int]]"  [arg-type]
tests/test_inverse.py:97:45: error: Argument "roi_start" to "SpatialCropd" has incompatible type "int"; expected "Optional[Sequence[int]]"  [arg-type]
tests/test_inverse.py:97:58: error: Argument "roi_end" to "SpatialCropd" has incompatible type "int"; expected "Optional[Sequence[int]]"  [arg-type]
tests/test_inverse.py:98:45: error: Argument "roi_start" to "SpatialCropd" has incompatible type "int"; expected "Optional[Sequence[int]]"  [arg-type]
tests/test_inverse.py:98:58: error: Argument "roi_end" to "SpatialCropd" has incompatible type "int"; expected "Optional[Sequence[int]]"  [arg-type]
tests/test_inverse.py:112:38: error: Argument "roi_center" to "SpatialCropd" has incompatible type "int"; expected "Optional[Sequence[int]]"  [arg-type]
tests/test_inverse.py:112:51: error: Argument "roi_size" to "SpatialCropd" has incompatible type "int"; expected "Optional[Sequence[int]]"  [arg-type]
tests/test_inverse.py:113:37: error: Argument "roi_start" to "SpatialCropd" has incompatible type "int"; expected "Optional[Sequence[int]]"  [arg-type]
tests/test_inverse.py:113:48: error: Argument "roi_end" to "SpatialCropd" has incompatible type "int"; expected "Optional[Sequence[int]]"  [arg-type]
monai/apps/auto3dseg/hpo_gen.py:203:5: error: Signature of "set_score" incompatible with supertype "HPOGen"  [override]
monai/apps/auto3dseg/hpo_gen.py:203:5: note:      Superclass:
monai/apps/auto3dseg/hpo_gen.py:203:5: note:          def set_score(self) -> Any
monai/apps/auto3dseg/hpo_gen.py:203:5: note:      Subclass:
monai/apps/auto3dseg/hpo_gen.py:203:5: note:          def set_score(self, acc: Any) -> Any
monai/apps/auto3dseg/hpo_gen.py:203:5: note:      Superclass:
monai/apps/auto3dseg/hpo_gen.py:203:5: note:          def set_score(self) -> Any
monai/apps/auto3dseg/hpo_gen.py:203:5: note:      Subclass:
monai/apps/auto3dseg/hpo_gen.py:203:5: note:          def set_score(self, acc: Any) -> Any
monai/apps/auto3dseg/hpo_gen.py:317:5: error: Signature of "set_score" incompatible with supertype "HPOGen"  [override]
monai/apps/auto3dseg/hpo_gen.py:317:5: note:      Superclass:
monai/apps/auto3dseg/hpo_gen.py:317:5: note:          def set_score(self) -> Any
monai/apps/auto3dseg/hpo_gen.py:317:5: note:      Subclass:
monai/apps/auto3dseg/hpo_gen.py:317:5: note:          def set_score(self, acc: Any) -> Any
monai/apps/auto3dseg/hpo_gen.py:317:5: note:      Superclass:
monai/apps/auto3dseg/hpo_gen.py:317:5: note:          def set_score(self) -> Any
monai/apps/auto3dseg/hpo_gen.py:317:5: note:      Subclass:
monai/apps/auto3dseg/hpo_gen.py:317:5: note:          def set_score(self, acc: Any) -> Any
Found 32 errors in 7 files (checked 1179 source files)
KumoLiu added a commit to KumoLiu/MONAI that referenced this issue Jul 22, 2024
Signed-off-by: YunLiu <[email protected]>
KumoLiu added a commit to KumoLiu/MONAI that referenced this issue Jul 22, 2024
Signed-off-by: YunLiu <[email protected]>
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 a pull request may close this issue.

1 participant