|
| 1 | + |
| 2 | + |
| 3 | +X.flat returns an indexable 1-D iterator (mostly similar to an array but always 1-d) |
| 4 | + |
| 5 | +long(<>) --> pylong(<>) if from Numeric * was changed to from scipy.base import * |
| 6 | + |
| 7 | +.typecode() --> .dtypechar |
| 8 | + |
| 9 | +.iscontiguous() --> .flags['CONTIGUOUS'] |
| 10 | + |
| 11 | +.byteswapped() -> .byteswap() |
| 12 | + |
| 13 | +.itemsize() -> .itemsize |
| 14 | + |
| 15 | +If you used typecode characters: |
| 16 | + |
| 17 | +'c' -> 'S1' |
| 18 | +'b' -> 'B' |
| 19 | +'1' -> 'b' |
| 20 | +'s' -> 'h' |
| 21 | +'w' -> 'H' |
| 22 | +'u' -> 'I' |
| 23 | + |
| 24 | + |
| 25 | +C -level |
| 26 | + |
| 27 | +some API calls that used to take PyObject * now take PyArrayObject * (this should only cause warnings during compile and not actual problems). |
| 28 | + PyArray_Take |
| 29 | + |
| 30 | +These commands now return a buffer that must be freed once it is used |
| 31 | +using PyMemData_FREE(ptr) or PyMemData_XFREE(ptr); |
| 32 | + |
| 33 | +a->descr->zero --> PyArray_Zero(a) |
| 34 | +a->descr->one --> PyArray_One(a) |
| 35 | + |
| 36 | +Numeric/arrayobject.h --> scipy/arrayobject.h |
| 37 | + |
| 38 | + |
| 39 | +# These will actually work and are defines for PyArray_BYTE, |
| 40 | +# but you really should change it in your code |
| 41 | +PyArray_CHAR --> PyArray_BYTE (or PyArray_STRING which is more flexible) |
| 42 | +PyArray_SBYTE --> PyArray_BYTE |
| 43 | + |
| 44 | +Any uses of character codes will need adjusting.... |
| 45 | +use PyArray_XXXLTR where XXX is the name of the type. |
| 46 | + |
| 47 | + |
| 48 | +If you used function pointers directly (why did you do that?), |
| 49 | +the arguments have changed. |
| 50 | + |
| 51 | +a->descr->cast[i](fromdata, fromstep, todata, tostep, n) |
| 52 | +a->descr->cast[i](fromdata, todata, n, PyArrayObject *in, PyArrayObject *out) |
| 53 | + |
| 54 | + |
0 commit comments