Skip to content

Commit

Permalink
API and ABI changes: Removed BigArrayType, Fixed hasobject to an inte…
Browse files Browse the repository at this point in the history
…ger (and inserted an unused character for alignment) and renamed it to flags. Re-organized the ArrFuncs structure. Moved NPY_DATETIME and friends to their 'correct' place in the type order.
  • Loading branch information
teoliphant committed Feb 15, 2010
1 parent 29efc30 commit 20ec480
Show file tree
Hide file tree
Showing 16 changed files with 350 additions and 327 deletions.
6 changes: 3 additions & 3 deletions doc/CAPI.txt
Expand Up @@ -61,9 +61,9 @@ This is a very flexible function.

``subtype`` : ``PyTypeObject *``
The subtype that should be created (either pass in
``&PyArray_Type``, ``&PyBigArray_Type``, or ``obj->ob_type``,
``&PyArray_Type``, or ``obj->ob_type``,
where ``obj`` is a an instance of a subtype (or subclass) of
``PyArray_Type`` or ``PyBigArray_Type``).
``PyArray_Type``).

``descr`` : ``PyArray_Descr *``
The type descriptor for the array. This is a Python object (this
Expand Down Expand Up @@ -114,7 +114,7 @@ This is a very flexible function.
order array. See below for an explanation of the flags.

``obj`` : ``PyObject *``
If subtypes is ``&PyArray_Type`` or ``&PyBigArray_Type``, this argument is
If subtypes is ``&PyArray_Type``, this argument is
ignored. Otherwise, the ``__array_finalize__`` method of the subtype
is called (if present) and passed this object. This is usually an
array of the type to be created (so the ``__array_finalize__`` method
Expand Down
3 changes: 2 additions & 1 deletion doc/cython/c_numpy.pxd
Expand Up @@ -76,7 +76,8 @@ cdef extern from "numpy/arrayobject.h":

ctypedef extern class numpy.dtype [object PyArray_Descr]:
cdef int type_num, elsize, alignment
cdef char type, kind, byteorder, hasobject
cdef char type, kind, byteorder
cdef int flags
cdef object fields, typeobj

ctypedef extern class numpy.ndarray [object PyArrayObject]:
Expand Down
16 changes: 12 additions & 4 deletions doc/numpybook/capi.lyx
Expand Up @@ -599,7 +599,15 @@ char
\emph on
char
\emph default
hasobject;
unused;
\end_layout

\begin_layout LyX-Code

\emph on
int
\emph default
flags;
\end_layout

\begin_layout LyX-Code
Expand Down Expand Up @@ -674,9 +682,9 @@ NPY_USE_SETITEM
\family default
flags should be set in the
\family typewriter
hasobject
flags
\family default
flag.
member.
\end_layout

\begin_layout Description
Expand All @@ -702,7 +710,7 @@ ndian), '=' (native), '|' (irrelevant, ignore).
\end_layout

\begin_layout Description
hasobject A data-type bit-flag that determines if the data-type exhibits
flags A data-type bit-flag that determines if the data-type exhibits
object-array like behavior.
Each bit in this member is a flag which are named as:
\end_layout
Expand Down
3 changes: 2 additions & 1 deletion doc/numpybook/comparison/pyrex/c_numpy.pxd
Expand Up @@ -73,7 +73,8 @@ cdef extern from "numpy/arrayobject.h":

ctypedef extern class numpy.dtype [object PyArray_Descr]:
cdef int type_num, elsize, alignment
cdef char type, kind, byteorder, hasobject
cdef char type, kind, byteorder
cdef int flags
cdef object fields, typeobj

ctypedef extern class numpy.ndarray [object PyArrayObject]:
Expand Down
3 changes: 2 additions & 1 deletion doc/pyrex/c_numpy.pxd
Expand Up @@ -75,7 +75,8 @@ cdef extern from "numpy/arrayobject.h":

ctypedef extern class numpy.dtype [object PyArray_Descr]:
cdef int type_num, elsize, alignment
cdef char type, kind, byteorder, hasobject
cdef char type, kind, byteorder
cdef int flags
cdef object fields, typeobj

ctypedef extern class numpy.ndarray [object PyArrayObject]:
Expand Down
7 changes: 4 additions & 3 deletions doc/source/reference/c-api.types-and-structures.rst
Expand Up @@ -191,7 +191,8 @@ PyArrayDescr_Type
char kind;
char type;
char byteorder;
char hasobject;
char unused;
int flags;
int type_num;
int elsize;
int alignment;
Expand All @@ -208,7 +209,7 @@ PyArrayDescr_Type
should point to a user-defined typeobject. This typeobject can
either inherit from array scalars or not. If it does not inherit
from array scalars, then the :cdata:`NPY_USE_GETITEM` and
:cdata:`NPY_USE_SETITEM` flags should be set in the ``hasobject`` flag.
:cdata:`NPY_USE_SETITEM` flags should be set in the ``flags`` member.

.. cmember:: char PyArray_Descr.kind

Expand All @@ -229,7 +230,7 @@ PyArrayDescr_Type
endian), '=' (native), '\|' (irrelevant, ignore). All builtin data-
types have byteorder '='.

.. cmember:: char PyArray_Descr.hasobject
.. cmember:: int PyArray_Descr.flags

A data-type bit-flag that determines if the data-type exhibits object-
array like behavior. Each bit in this member is a flag which are named
Expand Down
1 change: 1 addition & 0 deletions numpy/core/code_generators/cversions.txt
Expand Up @@ -5,3 +5,4 @@
# Starting from here, the hash is defined from numpy_api.full_api dict
# version 4 added neighborhood iterators and PyArray_Correlate2
0x00000004 = 3d8940bf7b0d2a4e25be4338c14c3c85
0x00000005 = 77e2e846db87f25d7cf99f9d812076f0

0 comments on commit 20ec480

Please sign in to comment.