diff options
Diffstat (limited to 'doc/source/reference')
-rw-r--r-- | doc/source/reference/arrays.dtypes.rst | 1 | ||||
-rw-r--r-- | doc/source/reference/arrays.indexing.rst | 5 | ||||
-rw-r--r-- | doc/source/reference/arrays.interface.rst | 2 | ||||
-rw-r--r-- | doc/source/reference/c-api.coremath.rst | 10 | ||||
-rw-r--r-- | doc/source/reference/c-api.iterator.rst | 32 | ||||
-rw-r--r-- | doc/source/reference/c-api.ufunc.rst | 20 | ||||
-rw-r--r-- | doc/source/reference/routines.io.rst | 1 | ||||
-rw-r--r-- | doc/source/reference/routines.ma.rst | 2 | ||||
-rw-r--r-- | doc/source/reference/routines.numarray.rst | 5 | ||||
-rw-r--r-- | doc/source/reference/routines.oldnumeric.rst | 7 | ||||
-rw-r--r-- | doc/source/reference/routines.statistics.rst | 1 | ||||
-rw-r--r-- | doc/source/reference/routines.testing.rst | 14 | ||||
-rw-r--r-- | doc/source/reference/testing.rst | 7 |
13 files changed, 49 insertions, 58 deletions
diff --git a/doc/source/reference/arrays.dtypes.rst b/doc/source/reference/arrays.dtypes.rst index dcf04b453..d771f2940 100644 --- a/doc/source/reference/arrays.dtypes.rst +++ b/doc/source/reference/arrays.dtypes.rst @@ -457,6 +457,7 @@ Type strings Both arguments must be convertible to data-type objects with the same total size. + .. admonition:: Example 32-bit integer, whose first two bytes are interpreted as an integer diff --git a/doc/source/reference/arrays.indexing.rst b/doc/source/reference/arrays.indexing.rst index ba1bfd312..62d36e28c 100644 --- a/doc/source/reference/arrays.indexing.rst +++ b/doc/source/reference/arrays.indexing.rst @@ -173,6 +173,7 @@ concepts to remember include: of arbitrary dimension. .. data:: newaxis + :noindex: The :const:`newaxis` object can be used in all slicing operations to create an axis of length one. :const:`newaxis` is an alias for @@ -287,7 +288,7 @@ understood with an example. Combining advanced and basic indexing """"""""""""""""""""""""""""""""""""" -When there is at least one slice (``:``), ellipsis (``...``) or ``np.newaxis`` +When there is at least one slice (``:``), ellipsis (``...``) or :const:`newaxis` in the index (or the array has more dimensions than there are advanced indexes), then the behaviour can be more complicated. It is like concatenating the indexing result for each advanced index element @@ -310,7 +311,7 @@ the subspace defined by the basic indexing (excluding integers) and the subspace from the advanced indexing part. Two cases of index combination need to be distinguished: -* The advanced indexes are separated by a slice, ellipsis or newaxis. +* The advanced indexes are separated by a slice, :const:`Ellipsis` or :const:`newaxis`. For example ``x[arr1, :, arr2]``. * The advanced indexes are all next to each other. For example ``x[..., arr1, arr2, :]`` but *not* ``x[arr1, :, 1]`` diff --git a/doc/source/reference/arrays.interface.rst b/doc/source/reference/arrays.interface.rst index 4a5fe62bf..f361ccb06 100644 --- a/doc/source/reference/arrays.interface.rst +++ b/doc/source/reference/arrays.interface.rst @@ -22,7 +22,7 @@ The Array Interface described here. __ http://cython.org/ -__ http://wiki.cython.org/tutorials/numpy +__ https://github.com/cython/cython/wiki/tutorials-numpy :version: 3 diff --git a/doc/source/reference/c-api.coremath.rst b/doc/source/reference/c-api.coremath.rst index ad92235da..691f73287 100644 --- a/doc/source/reference/c-api.coremath.rst +++ b/doc/source/reference/c-api.coremath.rst @@ -222,7 +222,7 @@ Those can be useful for precise floating point comparison. Returns the previous status mask. .. versionadded:: 1.15.0 -n + Complex functions ~~~~~~~~~~~~~~~~~ @@ -297,10 +297,10 @@ External Links: * `OpenGL Half Float Pixel Support`__ * `The OpenEXR image format`__. -__ http://ieeexplore.ieee.org/servlet/opac?punumber=4610933 -__ http://en.wikipedia.org/wiki/Half_precision_floating-point_format -__ http://www.opengl.org/registry/specs/ARB/half_float_pixel.txt -__ http://www.openexr.com/about.html +__ https://ieeexplore.ieee.org/document/4610935/ +__ https://en.wikipedia.org/wiki/Half-precision_floating-point_format +__ https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_half_float_pixel.txt +__ https://www.openexr.com/about.html .. c:var:: NPY_HALF_ZERO diff --git a/doc/source/reference/c-api.iterator.rst b/doc/source/reference/c-api.iterator.rst index 392dcb730..940452d3c 100644 --- a/doc/source/reference/c-api.iterator.rst +++ b/doc/source/reference/c-api.iterator.rst @@ -110,7 +110,6 @@ number of non-zero elements in an array. /* Increment the iterator to the next inner loop */ } while(iternext(iter)); - NpyIter_Close(iter) /* best practice, not strictly required in this case */ NpyIter_Deallocate(iter); return nonzero_count; @@ -195,7 +194,6 @@ is used to control the memory layout of the allocated result, typically ret = NpyIter_GetOperandArray(iter)[1]; Py_INCREF(ret); - NpyIter_Close(iter); if (NpyIter_Deallocate(iter) != NPY_SUCCEED) { Py_DECREF(ret); return NULL; @@ -495,7 +493,7 @@ Construction and Destruction per operand. Using ``NPY_ITER_READWRITE`` or ``NPY_ITER_WRITEONLY`` for a user-provided operand may trigger `WRITEBACKIFCOPY`` semantics. The data will be written back to the original array - when ``NpyIter_Close`` is called. + when ``NpyIter_Deallocate`` is called. .. c:var:: NPY_ITER_COPY @@ -507,13 +505,13 @@ Construction and Destruction Triggers :c:data:`NPY_ITER_COPY`, and when an array operand is flagged for writing and is copied, causes the data - in a copy to be copied back to ``op[i]`` when ``NpyIter_Close`` is - called. + in a copy to be copied back to ``op[i]`` when + ``NpyIter_Deallocate`` is called. If the operand is flagged as write-only and a copy is needed, an uninitialized temporary array will be created and then copied - to back to ``op[i]`` on calling ``NpyIter_Close``, instead of doing - the unnecessary copy operation. + to back to ``op[i]`` on calling ``NpyIter_Deallocate``, instead of + doing the unnecessary copy operation. .. c:var:: NPY_ITER_NBO .. c:var:: NPY_ITER_ALIGNED @@ -709,9 +707,7 @@ Construction and Destruction the functions will pass back errors through it instead of setting a Python exception. - :c:func:`NpyIter_Deallocate` must be called for each copy. One call to - :c:func:`NpyIter_Close` is sufficient to trigger writeback resolution for - all copies since they share buffers. + :c:func:`NpyIter_Deallocate` must be called for each copy. .. c:function:: int NpyIter_RemoveAxis(NpyIter* iter, int axis)`` @@ -763,23 +759,9 @@ Construction and Destruction Returns ``NPY_SUCCEED`` or ``NPY_FAIL``. -.. c:function:: int NpyIter_Close(NpyIter* iter) - - Resolves any needed writeback resolution. Should be called before - :c:func::`NpyIter_Deallocate`. After this call it is not safe to use the operands. - When using :c:func:`NpyIter_Copy`, only one call to :c:func:`NpyIter_Close` - is sufficient to resolve any writebacks, since the copies share buffers. - - Returns ``0`` or ``-1`` if unsuccessful. - .. c:function:: int NpyIter_Deallocate(NpyIter* iter) - Deallocates the iterator object. - - :c:func:`NpyIter_Close` should be called before this. If not, and if - writeback is needed, it will be performed at this point in order to maintain - backward-compatibility with older code, and a deprecation warning will be - emitted. Old code should be updated to call `NpyIter_Close` beforehand. + Deallocates the iterator object and resolves any needed writebacks. Returns ``NPY_SUCCEED`` or ``NPY_FAIL``. diff --git a/doc/source/reference/c-api.ufunc.rst b/doc/source/reference/c-api.ufunc.rst index 02a35cf56..8c2554a9e 100644 --- a/doc/source/reference/c-api.ufunc.rst +++ b/doc/source/reference/c-api.ufunc.rst @@ -94,19 +94,16 @@ Functions :param types: Length ``(nin + nout) * ntypes`` array of ``char`` encoding the - :ref:`PyArray_Descr.type_num` (built-in only) that the corresponding + `numpy.dtype.num` (built-in only) that the corresponding function in the ``func`` array accepts. For instance, for a comparison ufunc with three ``ntypes``, two ``nin`` and one ``nout``, where the - first function accepts :ref:`npy_int32` and the the second - :ref:`npy_int64`, with both returning :ref:`npy_bool`, ``types`` would + first function accepts `numpy.int32` and the the second + `numpy.int64`, with both returning `numpy.bool_`, ``types`` would be ``(char[]) {5, 5, 0, 7, 7, 0}`` since ``NPY_INT32`` is 5, - ``NPY_INT64`` is 7, and ``NPY_BOOL`` is 0 (on the python side, these - are exposed via :ref:`dtype.num`, i.e., for the example here, - ``dtype(np.int32).num``, ``dtype(np.int64).num``, and - ``dtype(np.bool_).num``, resp.). + ``NPY_INT64`` is 7, and ``NPY_BOOL`` is 0. - :ref:`casting-rules` will be used at runtime to find the first - ``func`` callable by the input/output provided. + :ref:`ufuncs.casting` will be used at runtime to find the first + ``func`` callable by the input/output provided. :param ntypes: How many different data-type-specific functions the ufunc has implemented. @@ -121,8 +118,9 @@ Functions The name for the ufunc. Specifying a name of 'add' or 'multiply' enables a special behavior for integer-typed reductions when no dtype is given. If the input type is an - integer (or boolean) data type smaller than the size of the int_ - data type, it will be internally upcast to the int_ (or uint) + integer (or boolean) data type smaller than the size of the + `numpy.int_` data type, it will be internally upcast to the + `numpy.int_` (or `numpy.uint`) data type. :param doc: diff --git a/doc/source/reference/routines.io.rst b/doc/source/reference/routines.io.rst index 55489951f..8bb29b793 100644 --- a/doc/source/reference/routines.io.rst +++ b/doc/source/reference/routines.io.rst @@ -63,6 +63,7 @@ Text formatting options set_printoptions get_printoptions set_string_function + printoptions Base-n representations ---------------------- diff --git a/doc/source/reference/routines.ma.rst b/doc/source/reference/routines.ma.rst index 2408899b3..15f2ba0a4 100644 --- a/doc/source/reference/routines.ma.rst +++ b/doc/source/reference/routines.ma.rst @@ -126,6 +126,7 @@ Changing the number of dimensions ma.MaskedArray.squeeze + ma.stack ma.column_stack ma.concatenate ma.dstack @@ -141,6 +142,7 @@ Joining arrays .. autosummary:: :toctree: generated/ + ma.stack ma.column_stack ma.concatenate ma.append diff --git a/doc/source/reference/routines.numarray.rst b/doc/source/reference/routines.numarray.rst deleted file mode 100644 index 9e84f49b9..000000000 --- a/doc/source/reference/routines.numarray.rst +++ /dev/null @@ -1,5 +0,0 @@ -********************** -Numarray compatibility -********************** - -The numarray module was removed in NumPy 1.9.0. diff --git a/doc/source/reference/routines.oldnumeric.rst b/doc/source/reference/routines.oldnumeric.rst deleted file mode 100644 index 2120fc69e..000000000 --- a/doc/source/reference/routines.oldnumeric.rst +++ /dev/null @@ -1,7 +0,0 @@ -************************* -Old Numeric compatibility -************************* - -.. currentmodule:: numpy - -The oldnumeric module was removed in NumPy 1.9.0. diff --git a/doc/source/reference/routines.statistics.rst b/doc/source/reference/routines.statistics.rst index e287fe9c8..c675b6090 100644 --- a/doc/source/reference/routines.statistics.rst +++ b/doc/source/reference/routines.statistics.rst @@ -56,4 +56,5 @@ Histograms histogram2d histogramdd bincount + histogram_bin_edges digitize diff --git a/doc/source/reference/routines.testing.rst b/doc/source/reference/routines.testing.rst index ad95bb399..5a52a40d6 100644 --- a/doc/source/reference/routines.testing.rst +++ b/doc/source/reference/routines.testing.rst @@ -1,3 +1,5 @@ +.. _numpy-testing: + Test Support (:mod:`numpy.testing`) =================================== @@ -6,8 +8,9 @@ Test Support (:mod:`numpy.testing`) Common test support for all numpy test scripts. This single module should provide all the common functionality for numpy -tests in a single location, so that test scripts can just import it and -work right away. +tests in a single location, so that :ref:`test scripts +<development-environment>` can just import it and work right away. For +background, see the :ref:`testing-guidelines` Asserts @@ -50,3 +53,10 @@ Test Running run_module_suite rundocs suppress_warnings + +Guidelines +---------- + +.. toctree:: + + testing diff --git a/doc/source/reference/testing.rst b/doc/source/reference/testing.rst new file mode 100644 index 000000000..72780dd44 --- /dev/null +++ b/doc/source/reference/testing.rst @@ -0,0 +1,7 @@ +.. _testing-guidelines: + +Testing Guidelines +================== + +.. include:: ../../TESTS.rst.txt + :start-line: 6 |