~ubuntu-branches/ubuntu/feisty/python-numpy/feisty

« back to all changes in this revision

Viewing changes to COMPATIBILITY

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2006-07-12 10:00:24 UTC
  • Revision ID: james.westby@ubuntu.com-20060712100024-5lw9q2yczlisqcrt
Tags: upstream-0.9.8
ImportĀ upstreamĀ versionĀ 0.9.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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'
 
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/arrayobject.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_BYTE  
 
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