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

Replace Sphinx napoleon for numpydoc #149

Open
6 tasks
santisoler opened this issue Apr 23, 2024 · 1 comment
Open
6 tasks

Replace Sphinx napoleon for numpydoc #149

santisoler opened this issue Apr 23, 2024 · 1 comment

Comments

@santisoler
Copy link
Member

Description:

In fatiando/harmonica#490 I noticed that some attributes that have a trailing underscore (like coefs_ in equivalent sources) are not properly shown in the API reference of the docs.

The issue is coming from the Sphinx plugin we are currently using across the projects to render the docstrings of functions and classes as rst: napoleon. Moreover, it renames Attributes to Variables, which is not ideal.

One way to solve this issue is to move from napoleon to numpydoc. Since we are already making use of the numpydoc style in our docstrings, this replacement seems natural.

I was already experimenting with this, and noticed that the classes would get a duplicated Methods list section. @leouieda suggested that the duplicated one might be coming from the template we have set up for classes. If numpydoc is generating the methods list, we should get rid of it in the template.

Apply to:

Further instructions:

  • Start by opening Pull Requests on each repository listed above.
  • Optionally, we can open Issues on each repository if further discussion specific to that repository is needed.
  • Mention this Issue on every Issue or Pull Request opened on each opened: Related to fatiando/community#XX
  • Check-off the repository on the list above once the Pull Request is merged.
  • Close this issue when all items are checked-off.

We want your help!

We know that maintenance tasks are very demanding, so we don't expect a single person to tackle this issue by themselves. Any help is very welcomed, so please comment below that you want to take care of the changes on any repository and we will assign it to you.

santisoler added a commit to fatiando/verde that referenced this issue Apr 24, 2024
Replace the builtin Sphinx plugin `napoleon` for `numpydoc`. This solves
the issue of attributes with trailing underscore not rendering properly
in docs. Add `numpydoc` as requirement for building the docs and add it
to the Sphinx configuration file. Remove `napoleon` from Sphinx
configuration. Remove the "Methods Summary" section in the Sphinx class
template since `numpydoc` builds its own list of all methods.

Related to fatiando/community#149
@santisoler
Copy link
Member Author

santisoler commented May 10, 2024

Probably we don't need numpydoc in Pooch. Numpy is not one of its dependencies and I think we are not facing any issue right now using napoloen in its docs. I think it's safe to remove Pooch from the list.

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

No branches or pull requests

1 participant