-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
DOC: Fix reference warning in some rst and code files. #24487
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
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.
Just a few nits, overall definitely an improvement!
numpy/typing/__init__.py
Outdated
@@ -135,7 +135,7 @@ | |||
Record array dtypes | |||
~~~~~~~~~~~~~~~~~~~ | |||
|
|||
The dtype of `numpy.recarray`, and the `numpy.rec` functions in general, | |||
The dtype of `numpy.recarray`, and the `numpy.record` functions in general, |
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.
FWIW I think this one intended to refer to the numpy.rec
module, not the numpy.record
scalar. I'd vote for:
The dtype of `numpy.recarray`, and the `numpy.record` functions in general, | |
The dtype of `numpy.recarray`, and the ``numpy.rec`` functions in general, |
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.
Will update it in next push.
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.
I used :ref:routines.array-creation.rec
instead since all functions in this part are all functions of numpy.rec module. Just using numpy.rec
may let users confused since there are no numpy.rec
module section.
1a444f2
to
2fef17b
Compare
@@ -296,7 +296,7 @@ String with comma-separated fields | |||
>>> dt = np.dtype("a3, 3u8, (3,4)a10") | |||
|
|||
Type strings | |||
Any string in :obj:`numpy.sctypeDict`.keys(): | |||
Any string in ``numpy.sctypeDict.keys()``: |
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.
sctypeDict will be removed for NumPy2.0. Do we have a replacement?
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.
Can we add a warning to tell users sctypeDict will be removed for NumPy2.0 now? Then we can update this part for replacement if we have got a good replacement.
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.
@rgommers, @seberg, @ngoldbaum: what is the canonical list of strings that can be used for dtypes in NumPy2.0, once numpy.sctypeDict
disappears?
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.
For the list of canonical Python names for dtypes, see gh-24651. There should not be a new list of strings accessible in the API. The examples right below this line are already fine, so I recommend replace this line with "Any string name of a NumPy dtype, e.g.:"
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.
I updated the commit based on @rgommers suggestion.
5b3b943
to
1dcc4dd
Compare
…kip cirrus][skip azp]
1dcc4dd
to
e35f675
Compare
Thanks @liang3zy22 |
Fix following reference warning:
There are some reference warning about following:
The warning is from docstree of masked_array, which is generated by sphinx.ext.autodoc extensions, something like following:
But
numpy.ma.core.MaskedArray
is not a correct class reference, it is a path reference.Is there a way to add docstring for alias?