Skip to content

WIP, DOC: Remove references for parameters in docstrings #17714

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

Closed

Conversation

takanori-pskq
Copy link

Related to #13114. Parameter names are not references, and marked up using * in other documents.

@eric-wieser
Copy link
Member

eric-wieser commented Nov 5, 2020

I think I agree with this change, but it goes directly against the directions for numpydoc, which says "Enclose variables in single backticks": https://numpydoc.readthedocs.io/en/latest/format.html#sections (the "parameters" item)

@takanori-pskq
Copy link
Author

In fact, only a few of these backticks raises warnings. So this may be a bug of numpydoc. I'll try to fix numpydoc.

@takanori-pskq takanori-pskq changed the title DOC: Remove references for parameters in docstrings WIP, DOC: Remove references for parameters in docstrings Nov 5, 2020
@takanori-pskq
Copy link
Author

takanori-pskq commented Nov 5, 2020

The problem here is that `size` raises a warning (after the change #17691 ). I think the cause is that the function numpy.size exists so numpydoc interprets `size` as a reference.

@takanori-pskq
Copy link
Author

Now I'm trying to solve by fixing numpydoc: numpy/numpydoc#303

@charris
Copy link
Member

charris commented Dec 13, 2020

Sphinx should recognize the parameter references. Does the current form cause problems?

I think we need a consensus if the docstring recommendations need changing. @rgommers, @stefanv Thoughts?

@rgommers
Copy link
Member

I think we need a consensus if the docstring recommendations need changing

I would not make a change here. That would lead to a lot of churn for little benefit.

The trigger for this PR seems specific to size, and maybe a few other places where a warning is emitted. Just changing those (to * * or the double backticks) seems better.

Base automatically changed from master to main March 4, 2021 02:05
@melissawm
Copy link
Member

@takanori-pskq do you have plans to update this PR?

@rossbar
Copy link
Contributor

rossbar commented Oct 3, 2021

FWIW I think this is something that needs to be fixed in numpydoc - numpy is not the only project that has this problem with the default role: +1 for closing

@melissawm
Copy link
Member

It looks like this is not the direction we want to go in, so I'll close. Feel free to create a new PR if you have other ideas, @takanori-pskq

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants