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

Change npt.ArrayLike to npt.NDArray[<type>] where appropriate #330

Closed
paddyroddy opened this issue Oct 7, 2024 · 1 comment
Closed

Change npt.ArrayLike to npt.NDArray[<type>] where appropriate #330

paddyroddy opened this issue Oct 7, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@paddyroddy
Copy link
Member

Is Your Feature Request Related to a Problem? Please Describe

Currently, we have a lot of npt.ArrayLike, but we could benefit more from type checking through mypy #280 and using the npt.NDArray[type].

Describe the Solution You'd Like

No response

Describe Alternatives You've Considered

No response

Additional Context

No response

@paddyroddy
Copy link
Member Author

This is being done #308

paddyroddy added a commit that referenced this issue Oct 15, 2024
Adding `mypy` to a pre-existing codebase is never easy. I initially
attempted this in #308, but have since split this up into separate
issues:
- [x] #347
- [x] #356
- [ ] #358

In this PR, `mypy` is added but in order for CI to pass, the `# type:
ignore[]` syntax is used throughout. I didn't want to tackle these here
too (see #308) as it gets quite messy.

One thing I have done (following #356) is change every empty
`npt.NDArray` to `npt.NDArray[typing.Any]` (see #330), as this actually
results in fewer errors than leaving them all blank. Ideally, we'd like
to fill in as many of the `typing.Any` as possible - they're a bit
useless by themselves. However, that is not the priority for now. Plus,
I expect typing to change when #67 is tackled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant