-
Notifications
You must be signed in to change notification settings - Fork 12
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
Adding type hinting #648
Adding type hinting #648
Conversation
@shimwell nice stuff overall! Just a shame that the "optionnal" tag disappears it was rather useful. |
The optional tag can be added using this type hinting - trying to figure this out now |
can be added. Not optimal formatting but gets the job done. |
I wonder if readthedocs does this in a nicer way |
…into update_type_hinting
Co-authored-by: Jonathan Shimwell <jonathan.shimwell@ukaea.uk>
started adding type hinting to remaining components and shapes
Proposed changes
Adding a little bit of type hinting to a class and a few functions. Just read this guide https://realpython.com/python-type-checking/ and wanted to give it a go.
I noticed the hover-text in VS code picks up these hints however the more interesting thing for me is the consequences this could have for doc strings.
We could in theory define all the argument and return types using type hinting and have this show up in the docs using a sphinx add on https://github.com/agronholm/sphinx-autodoc-typehints
Just making this tiny PR to start the discussion :-)
When building the docs the type now appears in smaller letters and no longer has the optional tag.
before
After
Types of changes
What types of changes does your code introduce to the Paramak?
Put an
x
in the boxes that applyChecklist