awips2/pythonPackages/numpy/COMPATIBILITY
root 57877615f5 Initial revision of AWIPS2 11.9.0-7p5
Former-commit-id: 2b462d8665 [formerly 133dc97f67] [formerly a02aeb236c] [formerly a02aeb236c [formerly 9f19e3f712]] [formerly 2b462d8665 [formerly 133dc97f67] [formerly a02aeb236c] [formerly a02aeb236c [formerly 9f19e3f712]] [formerly 06a8b51d6d [formerly a02aeb236c [formerly 9f19e3f712] [formerly 06a8b51d6d [formerly 64fa9254b946eae7e61bbc3f513b7c3696c4f54f]]]]]
Former-commit-id: 06a8b51d6d
Former-commit-id: 2c3569dd39 [formerly 9bb8decbcf] [formerly 8e80217e59] [formerly e2ecdcfe33 [formerly 377dcd10b9] [formerly 8e80217e59 [formerly 3360eb6c5f]]]
Former-commit-id: e2ecdcfe33 [formerly 377dcd10b9]
Former-commit-id: e2ecdcfe33
Former-commit-id: 7dbd17a5aa
2012-01-06 08:55:05 -06:00

59 lines
1.6 KiB
Text
Executable file

X.flat returns an indexable 1-D iterator (mostly similar to an array
but always 1-d) --- only has .copy and .__array__ attributes of an array!!!
.typecode() --> .dtype.char
.iscontiguous() --> .flags['CONTIGUOUS'] or .flags.contiguous
.byteswapped() -> .byteswap()
.itemsize() -> .itemsize
.toscalar() -> .item()
If you used typecode characters:
'c' -> 'S1' or 'c'
'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);
a->descr->zero --> PyArray_Zero(a)
a->descr->one --> PyArray_One(a)
Numeric/arrayobject.h --> numpy/oldnumeric.h
# These will actually work and are defines for PyArray_BYTE,
# but you really should change it in your code
PyArray_CHAR --> PyArray_CHAR
(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. Everything that was an int is now an intp.
Also, arrayobjects should be passed in at the end.
a->descr->cast[i](fromdata, fromstep, todata, tostep, n)
a->descr->cast[i](fromdata, todata, n, PyArrayObject *in, PyArrayObject *out)
anything but single-stepping is not supported by this function
use the PyArray_CastXXXX functions.