-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
DOC: fix sphinx errors due to np.emath references #21032
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
Conversation
Changes in python and C documentation are only reflected in the sphinx build after rebuilding numpy: You can see the ci result here if you open the "build devdocs w/ref warnings" fold. Comparing this build to a random PR's run the number of warnings dropped from 190 to 184. 👍 There is still a mention of
in the RST documentation, could you take a look at that too? I think it should become
with no link. What do you think? |
Hi matt, thanks for the feedback. I had a look at It seems that sphinx can't find the |
I am not sure which occurence this is referring to, but if you are using |
Okay, thanks. I added the small additional change to |
Doesn't |
Agreed - I'm -1 on changing all the links from |
There are a number of broken links to the numpy.emath module because there are no generated documentation for numpy.emath, which is an alias of numpy.lib.scimath. This fixes the broken links by generating documentation for numpy.emath, that duplicates the documentation for numpy.lib.scimath.
7faf89e
to
1258280
Compare
I agree it's a bit weird. I think I figured out a better way to fix it that should keep the |
5de6897
to
1258280
Compare
Do you have any ideas how to fix the ci/circleci errors? It says there's an error in the Sphinx parallel build but I can't think of why that would be. |
I think this was a problem with one of the dependencies which has been fixed, try rebasing on (or merging with) |
I think I've fixed the issue. I ended up changing the |
*********************************************************************** | ||
|
||
.. currentmodule:: numpy | ||
|
||
.. note:: :mod:`numpy.emath` is a preferred alias for :mod:`numpy.lib.scimath`, | ||
.. note:: :mod:`numpy.emath` is a preferred alias for ``numpy.lib.scimath``, |
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.
revert this change?
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.
The link to :mod:`numpy.lib.scimath`
is broken now because I changed the line at the bottom of this file from ..automodule numpy.lib.scimath
to ..automodule numpy.emath
. Because of that, Sphinx generates references to members of numpy.emath
which fixes the links but links to numpy.lib.scimath
are now missing.
I was thinking of potentially adding the numpy.lib.scimath
documentation but it seems there are no documents for the numpy.lib.*
modules in doc/source/reference
? Because of that, I'm unsure if it should be documented/how to document it? What do you think?
I think there are a few other warnings (aside from emath
related ones) also related to missing numpy.lib.*
functions and modules.
Nice. If this is ready please remove the draft status |
@mattip It's now ready for review. |
Thanks @jon-deng |
No problem and thanks for merging. |
Hi-five on merging your first pull request to NumPy, @jon-deng! We hope you stick around! Your choices aren’t limited to programming – you can review pull requests, help us stay on top of new and old issues, develop educational material, work on our website, add or improve graphic design, create marketing materials, translate website content, write grant proposals, and help with other fundraising initiatives. For more info, check out: https://numpy.org/contribute |
Docstrings for some ufuncs reference np.emath which raises a warning
when sphinx generates documentation. Replacing the reference with
np.lib.scimath should fix the error, I think.
Currently I'm trying to figure out why changes to
numpy/core/code_generators/ufunc_docstrings.py
aren't reflected in numpy docstrings so have opened a draft pull request.This should help fix some of the warnings raised in #13114.