summaryrefslogtreecommitdiff
path: root/doc/source/reference
diff options
context:
space:
mode:
authorKriti Singh <kritisingh1.ks@gmail.com>2019-07-22 21:47:39 +0530
committerSebastian Berg <sebastian@sipsolutions.net>2019-07-22 09:17:39 -0700
commitab87388a76c0afca4eb1159ab0ed232d502a8378 (patch)
treee686041b1cc4d10815a2ade2bf7f4f090815e6a8 /doc/source/reference
parent49fbbbff78034bc1c95c11c884b0233fb10b5955 (diff)
downloadnumpy-ab87388a76c0afca4eb1159ab0ed232d502a8378.tar.gz
DOC: Array API : Directory restructure and code cleanup (#14010)
* Minor improvements in Array API docs * Directory restruture
Diffstat (limited to 'doc/source/reference')
-rw-r--r--doc/source/reference/c-api/array.rst (renamed from doc/source/reference/c-api.array.rst)59
-rw-r--r--doc/source/reference/c-api/config.rst (renamed from doc/source/reference/c-api.config.rst)0
-rw-r--r--doc/source/reference/c-api/coremath.rst (renamed from doc/source/reference/c-api.coremath.rst)0
-rw-r--r--doc/source/reference/c-api/deprecations.rst (renamed from doc/source/reference/c-api.deprecations.rst)0
-rw-r--r--doc/source/reference/c-api/dtype.rst (renamed from doc/source/reference/c-api.dtype.rst)0
-rw-r--r--doc/source/reference/c-api/generalized-ufuncs.rst (renamed from doc/source/reference/c-api.generalized-ufuncs.rst)0
-rw-r--r--doc/source/reference/c-api/index.rst (renamed from doc/source/reference/c-api.rst)18
-rw-r--r--doc/source/reference/c-api/iterator.rst (renamed from doc/source/reference/c-api.iterator.rst)0
-rw-r--r--doc/source/reference/c-api/types-and-structures.rst (renamed from doc/source/reference/c-api.types-and-structures.rst)0
-rw-r--r--doc/source/reference/c-api/ufunc.rst (renamed from doc/source/reference/c-api.ufunc.rst)0
-rw-r--r--doc/source/reference/index.rst2
11 files changed, 40 insertions, 39 deletions
diff --git a/doc/source/reference/c-api.array.rst b/doc/source/reference/c-api/array.rst
index 3d6246baa..1d9d31b83 100644
--- a/doc/source/reference/c-api.array.rst
+++ b/doc/source/reference/c-api/array.rst
@@ -1578,7 +1578,7 @@ Flag checking
^^^^^^^^^^^^^
For all of these macros *arr* must be an instance of a (subclass of)
-:c:data:`PyArray_Type`, but no checking is done.
+:c:data:`PyArray_Type`.
.. c:function:: PyArray_CHKFLAGS(arr, flags)
@@ -2052,6 +2052,17 @@ Calculation
effect that is obtained by passing in *axis* = :const:`None` in Python
(treating the array as a 1-d array).
+
+.. note::
+
+ The out argument specifies where to place the result. If out is
+ NULL, then the output array is created, otherwise the output is
+ placed in out which must be the correct size and type. A new
+ reference to the output array is always returned even when out
+ is not NULL. The caller of the routine has the responsibility
+ to ``Py_DECREF`` out if not NULL or a memory-leak will occur.
+
+
.. c:function:: PyObject* PyArray_ArgMax( \
PyArrayObject* self, int axis, PyArrayObject* out)
@@ -2064,18 +2075,6 @@ Calculation
Equivalent to :meth:`ndarray.argmin<numpy.ndarray.argmin>` (*self*, *axis*). Return the index of
the smallest element of *self* along *axis*.
-
-
-
-.. note::
-
- The out argument specifies where to place the result. If out is
- NULL, then the output array is created, otherwise the output is
- placed in out which must be the correct size and type. A new
- reference to the output array is always returned even when out
- is not NULL. The caller of the routine has the responsibility
- to ``DECREF`` out if not NULL or a memory-leak will occur.
-
.. c:function:: PyObject* PyArray_Max( \
PyArrayObject* self, int axis, PyArrayObject* out)
@@ -2655,22 +2654,24 @@ cost of a slight overhead.
The mode should be one of:
- * NPY_NEIGHBORHOOD_ITER_ZERO_PADDING: zero padding. Outside bounds values
- will be 0.
- * NPY_NEIGHBORHOOD_ITER_ONE_PADDING: one padding, Outside bounds values
- will be 1.
- * NPY_NEIGHBORHOOD_ITER_CONSTANT_PADDING: constant padding. Outside bounds
- values will be the same as the first item in fill_value.
- * NPY_NEIGHBORHOOD_ITER_MIRROR_PADDING: mirror padding. Outside bounds
- values will be as if the array items were mirrored. For example, for the
- array [1, 2, 3, 4], x[-2] will be 2, x[-2] will be 1, x[4] will be 4,
- x[5] will be 1, etc...
- * NPY_NEIGHBORHOOD_ITER_CIRCULAR_PADDING: circular padding. Outside bounds
- values will be as if the array was repeated. For example, for the
- array [1, 2, 3, 4], x[-2] will be 3, x[-2] will be 4, x[4] will be 1,
- x[5] will be 2, etc...
-
- If the mode is constant filling (NPY_NEIGHBORHOOD_ITER_CONSTANT_PADDING),
+ .. c:macro:: NPY_NEIGHBORHOOD_ITER_ZERO_PADDING
+ Zero padding. Outside bounds values will be 0.
+ .. c:macro:: NPY_NEIGHBORHOOD_ITER_ONE_PADDING
+ One padding, Outside bounds values will be 1.
+ .. c:macro:: NPY_NEIGHBORHOOD_ITER_CONSTANT_PADDING
+ Constant padding. Outside bounds values will be the
+ same as the first item in fill_value.
+ .. c:macro:: NPY_NEIGHBORHOOD_ITER_MIRROR_PADDING
+ Mirror padding. Outside bounds values will be as if the
+ array items were mirrored. For example, for the array [1, 2, 3, 4],
+ x[-2] will be 2, x[-2] will be 1, x[4] will be 4, x[5] will be 1,
+ etc...
+ .. c:macro:: NPY_NEIGHBORHOOD_ITER_CIRCULAR_PADDING
+ Circular padding. Outside bounds values will be as if the array
+ was repeated. For example, for the array [1, 2, 3, 4], x[-2] will
+ be 3, x[-2] will be 4, x[4] will be 1, x[5] will be 2, etc...
+
+ If the mode is constant filling (`NPY_NEIGHBORHOOD_ITER_CONSTANT_PADDING`),
fill_value should point to an array object which holds the filling value
(the first item will be the filling value if the array contains more than
one item). For other cases, fill_value may be NULL.
diff --git a/doc/source/reference/c-api.config.rst b/doc/source/reference/c-api/config.rst
index 05e6fe44d..05e6fe44d 100644
--- a/doc/source/reference/c-api.config.rst
+++ b/doc/source/reference/c-api/config.rst
diff --git a/doc/source/reference/c-api.coremath.rst b/doc/source/reference/c-api/coremath.rst
index 7e00322f9..7e00322f9 100644
--- a/doc/source/reference/c-api.coremath.rst
+++ b/doc/source/reference/c-api/coremath.rst
diff --git a/doc/source/reference/c-api.deprecations.rst b/doc/source/reference/c-api/deprecations.rst
index a382017a2..a382017a2 100644
--- a/doc/source/reference/c-api.deprecations.rst
+++ b/doc/source/reference/c-api/deprecations.rst
diff --git a/doc/source/reference/c-api.dtype.rst b/doc/source/reference/c-api/dtype.rst
index 72e908861..72e908861 100644
--- a/doc/source/reference/c-api.dtype.rst
+++ b/doc/source/reference/c-api/dtype.rst
diff --git a/doc/source/reference/c-api.generalized-ufuncs.rst b/doc/source/reference/c-api/generalized-ufuncs.rst
index b59f077ad..b59f077ad 100644
--- a/doc/source/reference/c-api.generalized-ufuncs.rst
+++ b/doc/source/reference/c-api/generalized-ufuncs.rst
diff --git a/doc/source/reference/c-api.rst b/doc/source/reference/c-api/index.rst
index b8cbe97b2..56fe8e473 100644
--- a/doc/source/reference/c-api.rst
+++ b/doc/source/reference/c-api/index.rst
@@ -40,12 +40,12 @@ code.
.. toctree::
:maxdepth: 2
- c-api.types-and-structures
- c-api.config
- c-api.dtype
- c-api.array
- c-api.iterator
- c-api.ufunc
- c-api.generalized-ufuncs
- c-api.coremath
- c-api.deprecations
+ types-and-structures
+ config
+ dtype
+ array
+ iterator
+ ufunc
+ generalized-ufuncs
+ coremath
+ deprecations
diff --git a/doc/source/reference/c-api.iterator.rst b/doc/source/reference/c-api/iterator.rst
index b77d029cc..b77d029cc 100644
--- a/doc/source/reference/c-api.iterator.rst
+++ b/doc/source/reference/c-api/iterator.rst
diff --git a/doc/source/reference/c-api.types-and-structures.rst b/doc/source/reference/c-api/types-and-structures.rst
index 336dff211..336dff211 100644
--- a/doc/source/reference/c-api.types-and-structures.rst
+++ b/doc/source/reference/c-api/types-and-structures.rst
diff --git a/doc/source/reference/c-api.ufunc.rst b/doc/source/reference/c-api/ufunc.rst
index 92a679510..92a679510 100644
--- a/doc/source/reference/c-api.ufunc.rst
+++ b/doc/source/reference/c-api/ufunc.rst
diff --git a/doc/source/reference/index.rst b/doc/source/reference/index.rst
index 6accb8535..6742d605a 100644
--- a/doc/source/reference/index.rst
+++ b/doc/source/reference/index.rst
@@ -24,7 +24,7 @@ For learning how to use NumPy, see also :ref:`user`.
routines
distutils
distutils_guide
- c-api
+ c-api/index
internals
swig