diff options
author | Travis Oliphant <oliphant@enthought.com> | 2005-10-06 02:47:25 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2005-10-06 02:47:25 +0000 |
commit | bce31b09bd8a73d11734b7185d79309d59cbaa92 (patch) | |
tree | eb2fa79f86d1a7fd760c587f7e21c25f0e66ad2e | |
parent | 3dc10e072d3073655e78e6217b789a323da70a84 (diff) | |
download | numpy-bce31b09bd8a73d11734b7185d79309d59cbaa92.tar.gz |
Added compatibility information
-rw-r--r-- | COMPATIBILITY | 54 | ||||
-rw-r--r-- | scipy/base/include/scipy/arrayobject.h | 6 |
2 files changed, 59 insertions, 1 deletions
diff --git a/COMPATIBILITY b/COMPATIBILITY new file mode 100644 index 000000000..4a7dd7f21 --- /dev/null +++ b/COMPATIBILITY @@ -0,0 +1,54 @@ + + +X.flat returns an indexable 1-D iterator (mostly similar to an array but always 1-d) + +long(<>) --> pylong(<>) if from Numeric * was changed to from scipy.base import * + +.typecode() --> .dtypechar + +.iscontiguous() --> .flags['CONTIGUOUS'] + +.byteswapped() -> .byteswap() + +.itemsize() -> .itemsize + +If you used typecode characters: + +'c' -> 'S1' +'b' -> 'B' +'1' -> 'b' +'s' -> 'h' +'w' -> 'H' +'u' -> 'I' + + +C -level + +some API calls that used to take PyObject * now take PyArrayObject * (this should only cause warnings during compile and not actual problems). + PyArray_Take + +These commands now return a buffer that must be freed once it is used +using PyMemData_FREE(ptr) or PyMemData_XFREE(ptr); + +a->descr->zero --> PyArray_Zero(a) +a->descr->one --> PyArray_One(a) + +Numeric/arrayobject.h --> scipy/arrayobject.h + + +# These will actually work and are defines for PyArray_BYTE, +# but you really should change it in your code +PyArray_CHAR --> PyArray_BYTE (or PyArray_STRING which is more flexible) +PyArray_SBYTE --> PyArray_BYTE + +Any uses of character codes will need adjusting.... +use PyArray_XXXLTR where XXX is the name of the type. + + +If you used function pointers directly (why did you do that?), +the arguments have changed. + +a->descr->cast[i](fromdata, fromstep, todata, tostep, n) +a->descr->cast[i](fromdata, todata, n, PyArrayObject *in, PyArrayObject *out) + + diff --git a/scipy/base/include/scipy/arrayobject.h b/scipy/base/include/scipy/arrayobject.h index f3d12856f..124657553 100644 --- a/scipy/base/include/scipy/arrayobject.h +++ b/scipy/base/include/scipy/arrayobject.h @@ -1099,8 +1099,11 @@ typedef struct { #define PyTypeNum_ISUSERDEF(type) ((type >= PyArray_USERDEF) && \ (type < PyArray_USERDEF+\ PyArray_NUMUSERTYPES)) - +#define PyTypeNum_ISEXTENDED(type) (((type >= PyArray_STRING) && \ + (type <= PyArray_VOID)) || \ + (type >= PyArray_USERDEF)) + #define PyTypeNum_ISOBJECT(type) ((type) == PyArray_OBJECT) #define PyArray_ISBOOL(obj) PyTypeNum_ISBOOL(PyArray_TYPE(obj)) @@ -1114,6 +1117,7 @@ typedef struct { #define PyArray_ISPYTHONTYPE(obj) PyTypeNum_ISPYTHONTYPE(PyArray_TYPE(obj)) #define PyArray_ISFLEXIBLE(obj) PyTypeNum_ISFLEXIBLE(PyArray_TYPE(obj)) #define PyArray_ISUSERDEF(obj) PyTypeNum_ISUSERDEF(PyArray_TYPE(obj)) +#define PyArray_ISEXTENDED(obj) PyTypeNum_ISEXTENDED(PyArray_TYPE(obj)) #define PyArray_ISOBJECT(obj) PyTypeNum_ISOBJECT(PyArray_TYPE(obj)) /* Object arrays ignore notswapped flag */ |