-
Notifications
You must be signed in to change notification settings - Fork 9
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
gh-358: add static types support #368
Conversation
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.
Amazing work 🤯
"ANN001", # TODO: missing-type-function-argument | ||
"ANN002", # TODO: missing-type-args | ||
"ANN003", # TODO: missing-type-kwargs | ||
"ANN201", # TODO: missing-return-type-undocumented-public-function |
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.
🎉
@ntessore I've addressed through your comments |
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.
Fantastic! Well done!
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.
Awesome! Thanks for putting so much efforts into this, @paddyroddy!
Thanks both for the review. Will merge this and update the downstream PRs. |
Closes #358. Replaces #308.
This PR adds static type support, hence satisfying
mypy
. With the adaptation of #67 I anticipate typing to change, but it's much easier to do oncemypy
is passing initially.The only
# type: ignore[]
comments remaining areattr-defined
which are all attributed tonp.trapz
, those can easily be fixed by #207.I have turned off:
disallow_untyped_decorators
this is being triggered bypytest
andnox
. The equivalent# type: ignore[]
error ismisc
which isn't the most informativewarn_return_any
which is due to external libraries likecosmology
- this could be revisited in the futureI have decided to re-write some of the tests which were simply not following the typing - like passing is a
list
rather than anp.ndarray
. The alternative approach would be having really messy typing.I'm not expecting this to be fully perfect. We will likely have to iterate on this, and completely change once we follow #67. But this is a good first step.
Do make sure to look carefully. Hard to avoid such a big PR with this. There were over 200
# type: ignore[]
comments to fix!