10000 DOC: Fix reference warning for size. by liang3zy22 · Pull Request #24348 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

DOC: Fix reference warning for size. #24348

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
wants to merge 1 commit into from

Conversation

liang3zy22
Copy link
Contributor

To fix size reference warning.
I think single backquotes let sphinx recognize size as a function or class name. So I used double backquotes to let it be code examples.
Also update single backquotes for df to double backquotes.

@mattip
Copy link
Member
mattip commented Aug 6, 2023

This brings us down from 149 warnings (after #24346) to 108 warnings, cool. I do wonder if using italics *size* would be nicer than code-formatting. It seems parameters (like low and high in the function description of randint are the rendered in italics. @rossbar thoughts?

@rossbar
Copy link
Contributor
rossbar commented Aug 6, 2023

This is a bug in numpydoc itself that IMO really ought to be fixed upstream. The "enclose-parameters-in-single-backticks" rule is part of the standard, so this particular numpydoc bug affects not only NumPy but many other projects that rely on the numpydoc sphinx extension.

I have started working on a fix for this issue in numpy/numpydoc#484. There's still a lot of work to do, but the upside of that fix is that it would apply to all libraries that have adopted numpydoc.

FWIW I've built the numpy docs with numpy/numpydoc#484 and can verify1 that it results in the same reduction down to 108 warnings (albeit at the expense of introducing two new malformatted table errors - another rough edge to iron out).

@rossbar thoughts?

My vote would be to save this particular set of of warnings for last while trying to get a fix in upstream. @liang3zy22 if you were interested in numpy/numpydoc#484 that'd be great! If after an honest attempt it turns out the upstream fix is untenable, then I'd be +1 for breaking from the standard as proposed here.

Footnotes

  1. You can test this yourself by installing the numpydoc patch in your numpy development environment, e.g. pip install --upgrade git+https://github.com/rossbar/numpydoc.git@add-param-role

@mattip
Copy link
Member
mattip commented Aug 7, 2023

I agree fixing numpydoc would be a better solution. I am a bit surprised that only size is problematic, I would expect we had more parameters-as-links warnings (you got the same result as this PR), but maybe the others have already been formatted with italics.

I had a hunch that was the problem when suggesting this be looked at, sorry @liang3zy22 for the work put in here.

@liang3zy22
Copy link
Contributor Author

It's Ok. I would try the numpy/numpydoc#484.

@mdhaber
Copy link
Contributor
mdhaber commented Feb 11, 2024

Closing while numpy/numpydoc#484 is open. If that is closed, this can be revived. Thanks @liang3zy22!

@mdhaber mdhaber closed this Feb 11, 2024
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.

4 participants
0