diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2012-02-01 16:24:45 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2012-02-04 16:11:39 -0700 |
commit | 28214cf236251897038dcedfb50a62a2a2007358 (patch) | |
tree | 5a6df5beb0037a05ad4476a21341a9284e2980f6 /doc/source | |
parent | 95e2e1574bf14ce463489752427274c0d138a6ec (diff) | |
download | numpy-28214cf236251897038dcedfb50a62a2a2007358.tar.gz |
DOC: Replace references to macros in old_defines with new.
Also remove swig support for numpy < 1 from numpy.i since it expects
the old macros.
Diffstat (limited to 'doc/source')
-rw-r--r-- | doc/source/reference/c-api.array.rst | 12 | ||||
-rw-r--r-- | doc/source/reference/c-api.types-and-structures.rst | 20 | ||||
-rw-r--r-- | doc/source/user/c-info.beyond-basics.rst | 6 | ||||
-rw-r--r-- | doc/source/user/c-info.how-to-extend.rst | 4 |
4 files changed, 21 insertions, 21 deletions
diff --git a/doc/source/reference/c-api.array.rst b/doc/source/reference/c-api.array.rst index 46a215a12..89981a977 100644 --- a/doc/source/reference/c-api.array.rst +++ b/doc/source/reference/c-api.array.rst @@ -336,7 +336,7 @@ From scratch and data type given by *dtype*. If *fortran* is non-zero, then a Fortran-order array is created, otherwise a C-order array is created. Fill the memory with zeros (or the 0 object if *dtype* - corresponds to :ctype:`PyArray_OBJECT` ). + corresponds to :ctype:`NPY_OBJECT` ). .. cfunction:: PyObject* PyArray_ZEROS(int nd, npy_intp* dims, int type_num, int fortran) @@ -349,7 +349,7 @@ From scratch and data type given by *dtype*. If *fortran* is non-zero, then a Fortran-order array is created, otherwise a C-order array is created. The array is uninitialized unless the data type - corresponds to :ctype:`PyArray_OBJECT` in which case the array is + corresponds to :ctype:`NPY_OBJECT` in which case the array is filled with :cdata:`Py_None`. .. cfunction:: PyObject* PyArray_EMPTY(int nd, npy_intp* dims, int typenum, int fortran) @@ -1272,7 +1272,7 @@ New data types *totype*. Any old casting function is over-written. A ``0`` is returned on success or a ``-1`` on failure. -.. cfunction:: int PyArray_RegisterCanCast(PyArray_Descr* descr, int totype, PyArray_SCALARKIND scalar) +.. cfunction:: int PyArray_RegisterCanCast(PyArray_Descr* descr, int totype, NPY_SCALARKIND scalar) Register the data-type number, *totype*, as castable from data-type object, *descr*, of the given *scalar* kind. Use @@ -1281,7 +1281,7 @@ New data types *totype*. -Special functions for PyArray_OBJECT +Special functions for NPY_OBJECT ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. cfunction:: int PyArray_INCREF(PyArrayObject* op) @@ -1318,7 +1318,7 @@ Special functions for PyArray_OBJECT Fill a newly created array with a single value obj at all locations in the structure with object data-types. No checking is - performed but *arr* must be of data-type :ctype:`PyArray_OBJECT` and be + performed but *arr* must be of data-type :ctype:`NPY_OBJECT` and be single-segment and uninitialized (no previous objects in position). Use :cfunc:`PyArray_DECREF` (*arr*) if you need to decrement all the items in the object array prior to calling this @@ -1952,7 +1952,7 @@ Calculation Equivalent to :meth:`ndarray.mean` (*self*, *axis*, *rtype*). Returns the mean of the elements along the given *axis*, using the enumerated type *rtype* as the data type to sum in. Default sum behavior is - obtained using :cdata:`PyArray_NOTYPE` for *rtype*. + obtained using :cdata:`NPY_NOTYPE` for *rtype*. .. cfunction:: PyObject* PyArray_Trace(PyArrayObject* self, int offset, int axis1, int axis2, int rtype, PyArrayObject* out) diff --git a/doc/source/reference/c-api.types-and-structures.rst b/doc/source/reference/c-api.types-and-structures.rst index 8c813faf5..07c7e07be 100644 --- a/doc/source/reference/c-api.types-and-structures.rst +++ b/doc/source/reference/c-api.types-and-structures.rst @@ -388,7 +388,7 @@ PyArrayDescr_Type .. code-block:: c typedef struct { - PyArray_VectorUnaryFunc *cast[PyArray_NTYPES]; + PyArray_VectorUnaryFunc *cast[NPY_NTYPES]; PyArray_GetItemFunc *getitem; PyArray_SetItemFunc *setitem; PyArray_CopySwapNFunc *copyswapn; @@ -401,8 +401,8 @@ PyArrayDescr_Type PyArray_NonzeroFunc *nonzero; PyArray_FillFunc *fill; PyArray_FillWithScalarFunc *fillwithscalar; - PyArray_SortFunc *sort[PyArray_NSORTS]; - PyArray_ArgSortFunc *argsort[PyArray_NSORTS]; + PyArray_SortFunc *sort[NPY_NSORTS]; + PyArray_ArgSortFunc *argsort[NPY_NSORTS]; PyObject *castdict; PyArray_ScalarKindFunc *scalarkind; int **cancastscalarkindto; @@ -544,8 +544,8 @@ PyArrayDescr_Type An array of function pointers to a particular sorting algorithms. A particular sorting algorithm is obtained using a - key (so far :cdata:`PyArray_QUICKSORT`, :data`PyArray_HEAPSORT`, and - :cdata:`PyArray_MERGESORT` are defined). These sorts are done + key (so far :cdata:`NPY_QUICKSORT`, :data`NPY_HEAPSORT`, and + :cdata:`NPY_MERGESORT` are defined). These sorts are done in-place assuming contiguous and aligned data. .. cmember:: int argsort(void* start, npy_intp* result, npy_intp length, @@ -563,27 +563,27 @@ PyArrayDescr_Type functions for user- defined data-types. Each function is wrapped in a :ctype:`PyCObject *` and keyed by the data-type number. - .. cmember:: PyArray_SCALARKIND scalarkind(PyArrayObject* arr) + .. cmember:: NPY_SCALARKIND scalarkind(PyArrayObject* arr) A function to determine how scalars of this type should be interpreted. The argument is ``NULL`` or a 0-dimensional array containing the data (if that is needed to determine the kind of scalar). The return value must be of type - :ctype:`PyArray_SCALARKIND`. + :ctype:`NPY_SCALARKIND`. .. cmember:: int **cancastscalarkindto - Either ``NULL`` or an array of :ctype:`PyArray_NSCALARKINDS` + Either ``NULL`` or an array of :ctype:`NPY_NSCALARKINDS` pointers. These pointers should each be either ``NULL`` or a pointer to an array of integers (terminated by - :cdata:`PyArray_NOTYPE`) indicating data-types that a scalar of + :cdata:`NPY_NOTYPE`) indicating data-types that a scalar of this data-type of the specified kind can be cast to safely (this usually means without losing precision). .. cmember:: int *cancastto Either ``NULL`` or an array of integers (terminated by - :cdata:`PyArray_NOTYPE` ) indicated data-types that this data-type + :cdata:`NPY_NOTYPE` ) indicated data-types that this data-type can be cast to safely (this usually means without losing precision). diff --git a/doc/source/user/c-info.beyond-basics.rst b/doc/source/user/c-info.beyond-basics.rst index 9ed2ab386..3437985b6 100644 --- a/doc/source/user/c-info.beyond-basics.rst +++ b/doc/source/user/c-info.beyond-basics.rst @@ -189,7 +189,7 @@ feature follows. PyArray_MultiIter_NEXT(mobj); } -The function :cfunc:`PyArray_RemoveLargest` ( ``multi`` ) can be used to +The function :cfunc:`PyArray_RemoveSmallest` ( ``multi`` ) can be used to take a multi-iterator object and adjust all the iterators so that iteration does not take place over the largest dimension (it makes that dimension of size 1). The code being looped over that makes use @@ -330,7 +330,7 @@ function :cfunc:`PyArray_RegisterCanCast` (from_descr, totype_number, scalarkind) should be used to specify that the data-type object from_descr can be cast to the data-type with type number totype_number. If you are not trying to alter scalar coercion rules, -then use :cdata:`PyArray_NOSCALAR` for the scalarkind argument. +then use :cdata:`NPY_NOSCALAR` for the scalarkind argument. If you want to allow your new data-type to also be able to share in the scalar coercion rules, then you need to specify the scalarkind @@ -340,7 +340,7 @@ available to that function). Then, you can register data-types that can be cast to separately for each scalar kind that may be returned from your user-defined data-type. If you don't register scalar coercion handling, then all of your user-defined data-types will be -seen as :cdata:`PyArray_NOSCALAR`. +seen as :cdata:`NPY_NOSCALAR`. Registering a ufunc loop diff --git a/doc/source/user/c-info.how-to-extend.rst b/doc/source/user/c-info.how-to-extend.rst index 2d10c36a3..5901ce3e3 100644 --- a/doc/source/user/c-info.how-to-extend.rst +++ b/doc/source/user/c-info.how-to-extend.rst @@ -522,10 +522,10 @@ simpler forms exist that are easier to use. This function allocates new memory and places it in an ndarray with *nd* dimensions whose shape is determined by the array of at least *nd* items pointed to by *dims*. The memory for the - array is uninitialized (unless typenum is :cdata:`PyArray_OBJECT` in + array is uninitialized (unless typenum is :cdata:`NPY_OBJECT` in which case each element in the array is set to NULL). The *typenum* argument allows specification of any of the builtin - data-types such as :cdata:`PyArray_FLOAT` or :cdata:`PyArray_LONG`. The + data-types such as :cdata:`NPY_FLOAT` or :cdata:`NPY_LONG`. The memory for the array can be set to zero if desired using :cfunc:`PyArray_FILLWBYTE` (return_object, 0). |