summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2020-10-24 15:27:19 +0300
committerGitHub <noreply@github.com>2020-10-24 15:27:19 +0300
commitbeac56601587e26563d83b0a47cd0b1f006bf5d6 (patch)
tree881066e67e4837a3040704ea21bff24e0c01c62e
parentc0043831c46ec07fdc34999d664af654ada0825f (diff)
parentbecc3bc83421677530abfe54c4757ed6adcc822b (diff)
downloadnumpy-beac56601587e26563d83b0a47cd0b1f006bf5d6.tar.gz
Merge pull request #17619 from takanori-pskq/i13114-fix-misc
DOC: Fix some references
-rw-r--r--doc/source/f2py/distutils.rst2
-rw-r--r--doc/source/reference/arrays.interface.rst2
-rw-r--r--doc/source/reference/arrays.ndarray.rst8
-rw-r--r--doc/source/reference/c-api/array.rst4
-rw-r--r--doc/source/reference/c-api/types-and-structures.rst11
-rw-r--r--doc/source/reference/internals.code-explanations.rst7
-rw-r--r--doc/source/reference/maskedarray.generic.rst18
-rw-r--r--doc/source/reference/random/c-api.rst3
-rw-r--r--doc/source/reference/routines.array-manipulation.rst1
-rw-r--r--doc/source/reference/ufuncs.rst4
-rw-r--r--doc/source/release/1.16.0-notes.rst4
-rw-r--r--doc/source/user/basics.rec.rst4
-rw-r--r--doc/source/user/quickstart.rst2
13 files changed, 38 insertions, 32 deletions
diff --git a/doc/source/f2py/distutils.rst b/doc/source/f2py/distutils.rst
index 71f6eab5a..4cf30045e 100644
--- a/doc/source/f2py/distutils.rst
+++ b/doc/source/f2py/distutils.rst
@@ -2,6 +2,8 @@
Using via `numpy.distutils`
=============================
+.. currentmodule:: numpy.distutils.core
+
:mod:`numpy.distutils` is part of NumPy extending standard Python ``distutils``
to deal with Fortran sources and F2PY signature files, e.g. compile Fortran
sources, call F2PY to construct extension modules, etc.
diff --git a/doc/source/reference/arrays.interface.rst b/doc/source/reference/arrays.interface.rst
index aee95ba5b..d0a1c06c4 100644
--- a/doc/source/reference/arrays.interface.rst
+++ b/doc/source/reference/arrays.interface.rst
@@ -63,7 +63,7 @@ This approach to the interface consists of the object having an
Tuple whose elements are the array size in each dimension. Each
entry is an integer (a Python :py:class:`int`). Note that these
integers could be larger than the platform ``int`` or ``long``
- could hold (a Python :py:class`int` is a C ``long``). It is up to the code
+ could hold (a Python :py:class:`int` is a C ``long``). It is up to the code
using this attribute to handle this appropriately; either by
raising an error when overflow is possible, or by using
``long long`` as the C type for the shapes.
diff --git a/doc/source/reference/arrays.ndarray.rst b/doc/source/reference/arrays.ndarray.rst
index 689240c7d..405ae8f6a 100644
--- a/doc/source/reference/arrays.ndarray.rst
+++ b/doc/source/reference/arrays.ndarray.rst
@@ -469,7 +469,7 @@ Comparison operators:
ndarray.__eq__
ndarray.__ne__
-Truth value of an array (:func:`bool()`):
+Truth value of an array (:class:`bool() <bool>`):
.. autosummary::
:toctree: generated/
@@ -604,9 +604,9 @@ Container customization: (see :ref:`Indexing <arrays.indexing>`)
ndarray.__setitem__
ndarray.__contains__
-Conversion; the operations :func:`int()`, :func:`float()` and
-:func:`complex()`.
-. They work only on arrays that have one element in them
+Conversion; the operations :class:`int() <int>`,
+:class:`float() <float>` and :class:`complex() <complex>`.
+They work only on arrays that have one element in them
and return the appropriate scalar.
.. autosummary::
diff --git a/doc/source/reference/c-api/array.rst b/doc/source/reference/c-api/array.rst
index 68547fd45..ae39f980f 100644
--- a/doc/source/reference/c-api/array.rst
+++ b/doc/source/reference/c-api/array.rst
@@ -1335,7 +1335,7 @@ Special functions for NPY_OBJECT
locations in the structure with object data-types. No checking is
performed but *arr* must be of data-type :c:type:`NPY_OBJECT` and be
single-segment and uninitialized (no previous objects in
- position). Use :c:func:`PyArray_DECREF` (*arr*) if you need to
+ position). Use :c:func:`PyArray_XDECREF` (*arr*) if you need to
decrement all the items in the object array prior to calling this
function.
@@ -1354,7 +1354,7 @@ Special functions for NPY_OBJECT
strides, ordering, etc.) Sets the :c:data:`NPY_ARRAY_WRITEBACKIFCOPY` flag
and ``arr->base``, and set ``base`` to READONLY. Call
:c:func:`PyArray_ResolveWritebackIfCopy` before calling
- `Py_DECREF`` in order copy any changes back to ``base`` and
+ `Py_DECREF` in order copy any changes back to ``base`` and
reset the READONLY flag.
Returns 0 for success, -1 for failure.
diff --git a/doc/source/reference/c-api/types-and-structures.rst b/doc/source/reference/c-api/types-and-structures.rst
index fb5753c02..8c1a679dc 100644
--- a/doc/source/reference/c-api/types-and-structures.rst
+++ b/doc/source/reference/c-api/types-and-structures.rst
@@ -69,6 +69,7 @@ PyArray_Type and PyArrayObject
typeobject.
.. c:type:: PyArrayObject
+ NPY_AO
The :c:type:`PyArrayObject` C-structure contains all of the required
information for an array. All instances of an ndarray (and its
@@ -77,7 +78,7 @@ PyArray_Type and PyArrayObject
provided macros. If you need a shorter name, then you can make use
of :c:type:`NPY_AO` (deprecated) which is defined to be equivalent to
:c:type:`PyArrayObject`. Direct access to the struct fields are
- deprecated. Use the `PyArray_*(arr)` form instead.
+ deprecated. Use the ``PyArray_*(arr)`` form instead.
.. code-block:: c
@@ -813,7 +814,9 @@ PyUFunc_Type and PyUFuncObject
.. c:member:: int identity
Either :c:data:`PyUFunc_One`, :c:data:`PyUFunc_Zero`,
- :c:data:`PyUFunc_None` or :c:data:`PyUFunc_AllOnes` to indicate
+ :c:data:`PyUFunc_MinusOne`, :c:data:`PyUFunc_None`,
+ :c:data:`PyUFunc_ReorderableNone`, or
+ :c:data:`PyUFunc_IdentityValue` to indicate
the identity for this operation. It is only used for a
reduce-like call on an empty array.
@@ -1216,8 +1219,8 @@ are ``Py{TYPE}ArrType_Type`` where ``{TYPE}`` can be
**Object**.
These type names are part of the C-API and can therefore be created in
-extension C-code. There is also a :c:data:`PyIntpArrType_Type` and a
-:c:data:`PyUIntpArrType_Type` that are simple substitutes for one of the
+extension C-code. There is also a ``PyIntpArrType_Type`` and a
+``PyUIntpArrType_Type`` that are simple substitutes for one of the
integer types that can hold a pointer on the platform. The structure
of these scalar objects is not exposed to C-code. The function
:c:func:`PyArray_ScalarAsCtype` (..) can be used to extract the C-type
diff --git a/doc/source/reference/internals.code-explanations.rst b/doc/source/reference/internals.code-explanations.rst
index 65553e07e..e8e428f2e 100644
--- a/doc/source/reference/internals.code-explanations.rst
+++ b/doc/source/reference/internals.code-explanations.rst
@@ -147,7 +147,8 @@ an iterator for each of the arrays being broadcast.
The :c:func:`PyArray_Broadcast` function takes the iterators that have already
been defined and uses them to determine the broadcast shape in each
dimension (to create the iterators at the same time that broadcasting
-occurs then use the :c:func:`PyMultiIter_New` function). Then, the iterators are
+occurs then use the :c:func:`PyArray_MultiIterNew` function).
+Then, the iterators are
adjusted so that each iterator thinks it is iterating over an array
with the broadcast size. This is done by adjusting the iterators
number of dimensions, and the shape in each dimension. This works
@@ -162,7 +163,7 @@ for the extended dimensions. It is done in exactly the same way in
NumPy. The big difference is that now the array of strides is kept
track of in a :c:type:`PyArrayIterObject`, the iterators involved in a
broadcast result are kept track of in a :c:type:`PyArrayMultiIterObject`,
-and the :c:func:`PyArray_BroadCast` call implements the broad-casting rules.
+and the :c:func:`PyArray_Broadcast` call implements the broad-casting rules.
Array Scalars
@@ -368,7 +369,7 @@ The output arguments (if any) are then processed and any missing
return arrays are constructed. If any provided output array doesn't
have the correct type (or is mis-aligned) and is smaller than the
buffer size, then a new output array is constructed with the special
-:c:data:`WRITEBACKIFCOPY` flag set. At the end of the function,
+:c:data:`NPY_ARRAY_WRITEBACKIFCOPY` flag set. At the end of the function,
:c:func:`PyArray_ResolveWritebackIfCopy` is called so that
its contents will be copied back into the output array.
Iterators for the output arguments are then processed.
diff --git a/doc/source/reference/maskedarray.generic.rst b/doc/source/reference/maskedarray.generic.rst
index 41c3ee564..d3849c50d 100644
--- a/doc/source/reference/maskedarray.generic.rst
+++ b/doc/source/reference/maskedarray.generic.rst
@@ -177,8 +177,8 @@ attribute. We must keep in mind that a ``True`` entry in the mask indicates an
*invalid* data.
Another possibility is to use the :func:`getmask` and :func:`getmaskarray`
-functions. :func:`getmask(x)` outputs the mask of ``x`` if ``x`` is a masked
-array, and the special value :data:`nomask` otherwise. :func:`getmaskarray(x)`
+functions. ``getmask(x)`` outputs the mask of ``x`` if ``x`` is a masked
+array, and the special value :data:`nomask` otherwise. ``getmaskarray(x)``
outputs the mask of ``x`` if ``x`` is a masked array. If ``x`` has no invalid
entry or is not a masked array, the function outputs a boolean array of
``False`` with as many elements as ``x``.
@@ -296,11 +296,11 @@ new valid values to them::
.. note::
Unmasking an entry by direct assignment will silently fail if the masked
- array has a *hard* mask, as shown by the :attr:`hardmask` attribute. This
- feature was introduced to prevent overwriting the mask. To force the
- unmasking of an entry where the array has a hard mask, the mask must first
- to be softened using the :meth:`soften_mask` method before the allocation.
- It can be re-hardened with :meth:`harden_mask`::
+ array has a *hard* mask, as shown by the :attr:`~MaskedArray.hardmask`
+ attribute. This feature was introduced to prevent overwriting the mask.
+ To force the unmasking of an entry where the array has a hard mask,
+ the mask must first to be softened using the :meth:`soften_mask` method
+ before the allocation. It can be re-hardened with :meth:`harden_mask`::
>>> x = ma.array([1, 2, 3], mask=[0, 0, 1], hard_mask=True)
>>> x
@@ -406,8 +406,8 @@ Operations on masked arrays
Arithmetic and comparison operations are supported by masked arrays.
As much as possible, invalid entries of a masked array are not processed,
-meaning that the corresponding :attr:`data` entries *should* be the same
-before and after the operation.
+meaning that the corresponding :attr:`~MaskedArray.data` entries
+*should* be the same before and after the operation.
.. warning::
We need to stress that this behavior may not be systematic, that masked
diff --git a/doc/source/reference/random/c-api.rst b/doc/source/reference/random/c-api.rst
index 63b0fdc2b..a79da7a49 100644
--- a/doc/source/reference/random/c-api.rst
+++ b/doc/source/reference/random/c-api.rst
@@ -181,6 +181,5 @@ Generate a single integer
Generate random uint64 numbers in closed interval [off, off + rng].
-.. c:function:: npy_uint64 random_bounded_uint64(bitgen_t *bitgen_state, npy_uint64 off, npy_uint64 rng, npy_uint64 mask, bint use_masked)
-
+.. c:function:: npy_uint64 random_bounded_uint64(bitgen_t *bitgen_state, npy_uint64 off, npy_uint64 rng, npy_uint64 mask, bool use_masked)
diff --git a/doc/source/reference/routines.array-manipulation.rst b/doc/source/reference/routines.array-manipulation.rst
index 8d13a1800..1c96495d9 100644
--- a/doc/source/reference/routines.array-manipulation.rst
+++ b/doc/source/reference/routines.array-manipulation.rst
@@ -74,6 +74,7 @@ Joining arrays
hstack
dstack
column_stack
+ row_stack
Splitting arrays
================
diff --git a/doc/source/reference/ufuncs.rst b/doc/source/reference/ufuncs.rst
index c729f8d37..06fbe28dd 100644
--- a/doc/source/reference/ufuncs.rst
+++ b/doc/source/reference/ufuncs.rst
@@ -1,5 +1,7 @@
.. sectionauthor:: adapted from "Guide to NumPy" by Travis E. Oliphant
+.. currentmodule:: numpy
+
.. _ufuncs:
************************************
@@ -8,8 +10,6 @@ Universal functions (:class:`ufunc`)
.. note: XXX: section might need to be made more reference-guideish...
-.. currentmodule:: numpy
-
.. index: ufunc, universal function, arithmetic, operation
A universal function (or :term:`ufunc` for short) is a function that
diff --git a/doc/source/release/1.16.0-notes.rst b/doc/source/release/1.16.0-notes.rst
index e78e270f4..17d24160a 100644
--- a/doc/source/release/1.16.0-notes.rst
+++ b/doc/source/release/1.16.0-notes.rst
@@ -170,8 +170,8 @@ See the "accessing multiple fields" section of the
C API changes
=============
-The :c:data:`NPY_API_VERSION` was incremented to 0x0000D, due to the addition
-of:
+The :c:data:`NPY_FEATURE_VERSION` was incremented to 0x0000D, due to
+the addition of:
* :c:member:`PyUFuncObject.core_dim_flags`
* :c:member:`PyUFuncObject.core_dim_sizes`
diff --git a/doc/source/user/basics.rec.rst b/doc/source/user/basics.rec.rst
index bb4ed89e9..3dba65361 100644
--- a/doc/source/user/basics.rec.rst
+++ b/doc/source/user/basics.rec.rst
@@ -132,7 +132,7 @@ summary they are:
Offsets may be chosen such that the fields overlap, though this will mean
that assigning to one field may clobber any overlapping field's data. As
- an exception, fields of :class:`numpy.object` type cannot overlap with
+ an exception, fields of :class:`numpy.object_` type cannot overlap with
other fields, because of the risk of clobbering the internal object
pointer and then dereferencing it.
@@ -545,7 +545,7 @@ Viewing Structured Arrays Containing Objects
--------------------------------------------
In order to prevent clobbering object pointers in fields of
-:class:`numpy.object` type, numpy currently does not allow views of structured
+:class:`object` type, numpy currently does not allow views of structured
arrays containing objects.
Structure Comparison
diff --git a/doc/source/user/quickstart.rst b/doc/source/user/quickstart.rst
index b675204e0..387a7f715 100644
--- a/doc/source/user/quickstart.rst
+++ b/doc/source/user/quickstart.rst
@@ -15,7 +15,7 @@ Prerequisites
You'll need to know a bit of Python. For a refresher, see the `Python
tutorial <https://docs.python.org/tutorial/>`__.
-To work the examples, you'll need `matplotlib` installed
+To work the examples, you'll need ``matplotlib`` installed
in addition to NumPy.
**Learner profile**