-
Notifications
You must be signed in to change notification settings - Fork 67
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
Use parameters type hints automatically with sphinx #1137
Use parameters type hints automatically with sphinx #1137
Conversation
https://joblib.readthedocs.io/en/latest/generated/joblib.Parallel.html for more details. | ||
"""Constructor for the RipsPersistence class. | ||
|
||
:param homology_dimensions: The returned persistence diagrams dimension(s). |
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.
I see you switched from Google-style to plain RST. Is that because it wasn't possible while sticking to Google-style?
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.
I was just following what is explained in sphinx-autodoc-typehints documentation. Google style is also working, so I reverted to it on 52aa602
"sphinxcontrib.bibtex", | ||
"sphinx_paramlinks", | ||
] | ||
|
||
autodoc_class_signature = "separated" | ||
autodoc_typehints = "none" |
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.
Looking at https://github.com/tox-dev/sphinx-autodoc-typehints#options, it suggests we should add napoleon_use_rtype = True
. It has 0 effect currently, but it might become relevant when we add more annotations?
always_use_bars_union = True
looks a bit prettier than the default (False), but that's subjective.
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.
I added napoleon_use_rtype = True
and always_use_bars_union = True
on 20c7761
What I found nice (and thanks @mglisse for pointing the question), I have:
The type is substituted, with the one that is explicitly given in code, we will have: |
Only for RipsPersistence for the moment.