home *** CD-ROM | disk | FTP | other *** search
/ Chip 2011 November / CHIP_2011_11.iso / Programy / Narzedzia / Inkscape / Inkscape-0.48.2-1-win32.exe / python / Lib / site-packages / numpy / COMPATIBILITY < prev    next >
Encoding:
Text File  |  2010-03-06  |  1.6 KB  |  60 lines

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