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
Improved type hints in documentation #662
Improved type hints in documentation #662
Conversation
Codecov Report
@@ Coverage Diff @@
## main #662 +/- ##
==========================================
+ Coverage 90.23% 90.26% +0.03%
==========================================
Files 192 192
Lines 7238 7262 +24
Branches 1153 1153
==========================================
+ Hits 6531 6555 +24
Misses 462 462
Partials 245 245
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Note that currently in some classes type hints for |
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.
Minor stuff, otherwise perfect 👍🏻
Co-authored-by: Marvin Pförtner <marvin.pfoertner@icloud.com>
e29074e
to
f1cac12
Compare
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.
Just a typo left :)
Co-authored-by: Marvin Pförtner <marvin.pfoertner@icloud.com>
In a Nutshell
Type aliases are not properly shown in the documentation and usually expanded completely. This can make the documentation very hard to read and the typing information not very useful.
This PR uses Sphinx native functionality to display type hints instead.
Detailed Description
probnum.typing
to the API Documentationsphinx-autodoc-typehints
autodoc
If a type alias still is expanded completely in the documentation the following should be added to the file:
Other
Note that now the new standard for documenting
Parameters
is to not use a colon (:).Otherwise
autodoc
may interpret the type of the parameter as empty.