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

Fix mypy failures #480

Open
Saransh-cpp opened this issue Jan 17, 2025 · 1 comment
Open

Fix mypy failures #480

Saransh-cpp opened this issue Jan 17, 2025 · 1 comment
Labels
infrastructure Project infrastructure: dev tools, packaging, etc.

Comments

@Saransh-cpp
Copy link
Member

Add your issue here

Mypy is failing with the error -

mypy.....................................................................Failed
- hook id: mypy
- exit code: 1

glass/core/array.py:169: error: Unused "type: ignore" comment  [unused-ignore]
glass/core/array.py:169: error: Incompatible return value type (got "float64 | ndarray[tuple[int, ...], dtype[float64]]", expected "ndarray[tuple[int, ...], dtype[float64]]")  [return-value]
glass/core/array.py:169: note: Error code "return-value" not covered by "type: ignore" comment
glass/shells.py:239: error: Argument 1 has incompatible type "ndarray[tuple[int, ...], dtype[floating[Any]]]"; expected "Sequence[float] | ndarray[tuple[int, ...], dtype[float64]]"  [arg-type]
glass/shells.py:241: error: Argument 1 to "RadialWindow" has incompatible type "ndarray[tuple[int, ...], dtype[floating[Any]]]"; expected "ndarray[tuple[int, ...], dtype[float64]]"  [arg-type]
glass/shells.py:413: error: Incompatible return value type (got "tuple[ndarray[tuple[int, ...], dtype[Any]], ndarray[tuple[int, ...], dtype[floating[Any]]]]", expected "tuple[ndarray[tuple[int, ...], dtype[float64]], ndarray[tuple[int, ...], dtype[float64]]]")  [return-value]
glass/shells.py:568: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[floating[_64Bit]]]", variable has type "ndarray[tuple[int, ...], dtype[float64]]")  [assignment]
glass/shells.py:632: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[floating[_64Bit]]]", variable has type "ndarray[tuple[int, ...], dtype[float64]]")  [assignment]
glass/shells.py:676: error: Invalid index type "tuple[object, ...]" for "ndarray[tuple[int, ...], dtype[float64]]"; expected type "SupportsIndex | slice[Any, Any, Any] | EllipsisType | _SupportsArray[dtype[numpy.bool[builtins.bool]] | dtype[integer[Any]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]] | dtype[integer[Any]]]] | builtins.bool | int | _NestedSequence[builtins.bool | int] | None | tuple[SupportsIndex | slice[Any, Any, Any] | EllipsisType | _SupportsArray[dtype[numpy.bool[builtins.bool]] | dtype[integer[Any]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]] | dtype[integer[Any]]]] | builtins.bool | int | _NestedSequence[builtins.bool | int] | None, ...]"  [index]
glass/shells.py:745: error: Incompatible return value type (got "ndarray[tuple[int, ...], dtype[floating[Any]]]", expected "ndarray[tuple[int, ...], dtype[float64]]")  [return-value]
glass/points.py:88: error: Incompatible return value type (got "ndarray[tuple[int, ...], dtype[floating[Any]]]", expected "ndarray[tuple[int, ...], dtype[float64]]")  [return-value]
glass/points.py:110: error: Incompatible return value type (got "ndarray[tuple[int, ...], dtype[floating[Any]]]", expected "ndarray[tuple[int, ...], dtype[float64]]")  [return-value]
glass/points.py:416: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[floating[Any]]]", variable has type "ndarray[tuple[int, ...], dtype[float64]]")  [assignment]
Found 12 errors in 3 files (checked 13 source files)
@Saransh-cpp Saransh-cpp added the infrastructure Project infrastructure: dev tools, packaging, etc. label Jan 17, 2025
@paddyroddy
Copy link
Member

These are really weird. They happened in between #466 & #467. But now even if I downgrade mypy it fails. We need to be careful as I think my initial attempt in #467 broke the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Project infrastructure: dev tools, packaging, etc.
Projects
None yet
Development

No branches or pull requests

2 participants