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

Add type hints #593

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Conversation

vandalt
Copy link

@vandalt vandalt commented Sep 16, 2024

Hi! This adds type hints and fixes #592.

For astropy quantities, I used Quantity without any physical type or units annotations. The reasons are:

The tests are all passing on my machine.

I was not sure what the formatting guidelines were for this package. Let me know if there are issues on that side!

@vandalt
Copy link
Author

vandalt commented Sep 16, 2024

I updated formatting so that flake8 check would pass.

I also patched the typing.Self to be backward compatible for Python<3.11.

Currently the tests for Python 3.7 are failing because I used types with subscripts (e.g. np.ndarray[float]). Python 3.7 is EOL, but let me know if I should still make the type hints backward compatible.

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 this pull request may close these issues.

Add type hints
1 participant