From e35f67549047c787bd37b5f189f90aafd8682f74 Mon Sep 17 00:00:00 2001 From: Liang Yan Date: Tue, 22 Aug 2023 08:39:49 +0800 Subject: [PATCH] DOC: Fix reference warning in some rst and code files[skip actions][skip cirrus][skip azp] --- doc/source/reference/arrays.dtypes.rst | 2 +- doc/source/reference/routines.array-creation.rst | 5 ++--- doc/source/release/1.16.0-notes.rst | 2 +- doc/source/release/1.20.0-notes.rst | 4 ++-- doc/source/release/1.20.2-notes.rst | 2 +- doc/source/release/1.7.0-notes.rst | 2 +- doc/source/user/basics.indexing.rst | 2 +- numpy/typing/__init__.py | 4 ++-- 8 files changed, 11 insertions(+), 12 deletions(-) diff --git a/doc/source/reference/arrays.dtypes.rst b/doc/source/reference/arrays.dtypes.rst index e75e1f93f2ca..a38127e86397 100644 --- a/doc/source/reference/arrays.dtypes.rst +++ b/doc/source/reference/arrays.dtypes.rst @@ -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 name of a NumPy dtype, e.g.: .. admonition:: Example diff --git a/doc/source/reference/routines.array-creation.rst b/doc/source/reference/routines.array-creation.rst index aac2fdea423d..1ad1581bae6e 100644 --- a/doc/source/reference/routines.array-creation.rst +++ b/doc/source/reference/routines.array-creation.rst @@ -47,8 +47,7 @@ From existing data Creating record arrays ---------------------- -.. note:: :mod:`numpy.core.records` is used to create record - array. Please refer to :ref:`arrays.classes.rec` for +.. note:: Please refer to :ref:`arrays.classes.rec` for record arrays. .. autosummary:: @@ -66,7 +65,7 @@ Creating character arrays (:mod:`numpy.char`) --------------------------------------------- .. note:: :mod:`numpy.char` is the preferred alias for - :mod:`numpy.core.defchararray`. + ``numpy.core.defchararray`` module. .. autosummary:: :toctree: generated/ diff --git a/doc/source/release/1.16.0-notes.rst b/doc/source/release/1.16.0-notes.rst index d508e3ae8783..07e06ca6e043 100644 --- a/doc/source/release/1.16.0-notes.rst +++ b/doc/source/release/1.16.0-notes.rst @@ -57,7 +57,7 @@ New deprecations * The type dictionaries `numpy.core.typeNA` and `numpy.core.sctypeNA` are deprecated. They were buggy and not documented and will be removed in the - 1.18 release. Use `numpy.sctypeDict` instead. + 1.18 release. Use ``numpy.sctypeDict`` instead. * The `numpy.asscalar` function is deprecated. It is an alias to the more powerful `numpy.ndarray.item`, not tested, and fails for scalars. diff --git a/doc/source/release/1.20.0-notes.rst b/doc/source/release/1.20.0-notes.rst index 494e4f19ee5b..89b51b2126fd 100644 --- a/doc/source/release/1.20.0-notes.rst +++ b/doc/source/release/1.20.0-notes.rst @@ -824,7 +824,7 @@ Callback functions in f2py are now thread safe. `numpy.core.records.fromfile` now supports file-like objects ------------------------------------------------------------ -`numpy.rec.fromfile` can now use file-like objects, for instance +`numpy.core.records.fromfile` can now use file-like objects, for instance :py:class:`io.BytesIO` (`gh-16675 `__) @@ -839,7 +839,7 @@ Use f90 compiler specified by the command line args --------------------------------------------------- The compiler command selection for Fortran Portland Group Compiler is changed -in `numpy.distutils.fcompiler`. This only affects the linking command. This +in ``numpy.distutils.fcompiler``. This only affects the linking command. This forces the use of the executable provided by the command line option (if provided) instead of the pgfortran executable. If no executable is provided to the command line option it defaults to the pgf90 executable, which is an alias diff --git a/doc/source/release/1.20.2-notes.rst b/doc/source/release/1.20.2-notes.rst index 10d39f7f6389..2c7e3ae4c4ea 100644 --- a/doc/source/release/1.20.2-notes.rst +++ b/doc/source/release/1.20.2-notes.rst @@ -38,7 +38,7 @@ A total of 20 pull requests were merged for this release. * `#18488 `__: BUG: check if PyArray_malloc succeeded * `#18546 `__: BUG: incorrect error fallthrough in nditer * `#18559 `__: CI: Backport CI fixes from main. -* `#18599 `__: MAINT: Add annotations for `dtype.__getitem__`, `__mul__` and... +* `#18599 `__: MAINT: Add annotations for ``dtype.__getitem__``, `__mul__` and... * `#18611 `__: BUG: NameError in numpy.distutils.fcompiler.compaq * `#18612 `__: BUG: Fixed ``where`` keyword for ``np.mean`` & ``np.var`` methods * `#18617 `__: CI: Update apt package list before Python install diff --git a/doc/source/release/1.7.0-notes.rst b/doc/source/release/1.7.0-notes.rst index a04255f3c50c..56f00accab1b 100644 --- a/doc/source/release/1.7.0-notes.rst +++ b/doc/source/release/1.7.0-notes.rst @@ -259,7 +259,7 @@ General ------- Specifying a custom string formatter with a `_format` array attribute is -deprecated. The new `formatter` keyword in ``numpy.set_printoptions`` or +deprecated. The new ``formatter`` keyword in ``numpy.set_printoptions`` or ``numpy.array2string`` can be used instead. The deprecated imports in the polynomial package have been removed. diff --git a/doc/source/user/basics.indexing.rst b/doc/source/user/basics.indexing.rst index ac046eb5a3c6..9768fbb025e9 100644 --- a/doc/source/user/basics.indexing.rst +++ b/doc/source/user/basics.indexing.rst @@ -491,7 +491,7 @@ regardless of whether those values are :py:data:`True` or A common use case for this is filtering for desired element values. For example, one may wish to select all entries from an array which -are not :const:`NaN`:: +are not :const:`numpy.nan`:: >>> x = np.array([[1., 2.], [np.nan, 3.], [np.nan, np.nan]]) >>> x[~np.isnan(x)] diff --git a/numpy/typing/__init__.py b/numpy/typing/__init__.py index 358d0d86af67..fa8e86af83d6 100644 --- a/numpy/typing/__init__.py +++ b/numpy/typing/__init__.py @@ -135,8 +135,8 @@ Record array dtypes ~~~~~~~~~~~~~~~~~~~ -The dtype of `numpy.recarray`, and the `numpy.rec` functions in general, -can be specified in one of two ways: +The dtype of `numpy.recarray`, and the :ref:`routines.array-creation.rec` +functions in general, can be specified in one of two ways: * Directly via the ``dtype`` argument. * With up to five helper arguments that operate via `numpy.format_parser`: