pylops
pylops copied to clipboard
Add typing annotations
Typing annotations are quickly becoming ubiquitous in Python. They improve readability, documentation, and when paired with a modern IDE, can improve autocomplete suggestions and supply advanced warnings.
I propose that we incorporate type hinting as much as possible in a future release, at the very least for function/class signatures in user-facing code core library code.
Definition of done
- Type hinting in all user-facing function and class signatures. Anything which is exported should be type hinted.
- Type hinting should use either standard library hinting (native in Python 3.8 and later, provided by the
typing-extensions
package in earlier versions) or NumPy typing when appropriate (provided undernumpy.typing
in NumPy versions 1.20 and higher). For example, a function which takes anumpy.ndarray
should be annotated withnumpy.typing.NDArray
.
@mrava87 I put this as a To do for v2.0.0, I hope that's ok!
Sounds good! It is a lot of work but worth for a big release :) we can aim for it in coming months also to remove the various deprecated parameters here and there
@mrava87 could we upgrade to NumPy 1.20?
I guess you mean as minimal allowed numpy version?
For v2, sounds like a good idea :)