-
Notifications
You must be signed in to change notification settings - Fork 224
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 napoleon instead of numpydoc with sphinx #383
Conversation
The napoleon sphinx extension renders the numpy docstrings better than numpydoc and works with newer versions of sphinx. This way, we upgrade to a newer sphinx which works better with the readthedocs theme. Older sphinx is also a problem for Python 3.8 packages on conda-forge.
This napolean thing looks amazing! It's definitely a step forward, but we'll need to make our docstrings consistent for this. I much prefer having the long alias name before the short alias (i.e. longalias (L)), but I'm not sure if this can be configured? Currently the short alias comes before the recommended long ones, see examples below: https://pygmt-d8guesy9o.now.sh/api/generated/pygmt.Figure.contour.html https://pygmt-d8guesy9o.now.sh/api/generated/pygmt.makecpt.html |
@weiji14 that is not really a problem with napoleon but a problem with our docstring formatting (and argument parsing in general). We shouldn't be putting the alias or option in parenthesis as that isn't following the numpy standard. So we can keep this as is and work on a fix that will put us back in the standard. I'm working on a refactor of the argument handling mechanisms. The main problem is that we're using |
@leouieda Hi. Sorry for the possible off-topic, but how could you achieve clickable types with napoleon in the Parameters section of the docstrings ? E.g. in this function, you did not use any explicit markup for the |
The napoleon sphinx extension renders the numpy docstrings better than
numpydoc and works with newer versions of sphinx. This way, we upgrade
to a newer sphinx which works better with the readthedocs theme. Older
sphinx is also a problem for Python 3.8 packages on conda-forge.
Reminders
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
.