Re: [Numpy-discussion] can't run cython on mtrand.pyx

2013-03-14 Thread Robert Kern
On Wed, Mar 13, 2013 at 7:20 PM, Neal Becker ndbeck...@gmail.com wrote:
 Robert Kern wrote:

 On Wed, Mar 13, 2013 at 6:40 PM, Neal Becker ndbeck...@gmail.com wrote:
 Grabbed numpy-1.7.0 source.
 Cython is 0.18

  cython mtrand.pyx produces lots of errors.

 It helps to copy-and-paste the errors that you are seeing.

 In any case, Cython 0.18 works okay on master's mtrand.pyx sources.


 Well, this is the first error:

 cython mtrand.pyx

 Error compiling Cython file:
 
 ...
 PyArray_DIMS(oa) , NPY_DOUBLE)
 length = PyArray_SIZE(array)
 array_data = double *PyArray_DATA(array)
 itera = flatiterPyArray_IterNew(objectoa)
 for i from 0 = i  length:
 array_data[i] = func(state, (double *(itera.dataptr))[0])
 ^
 

 mtrand.pyx:177:41: Python objects cannot be cast to pointers of primitive 
 types

It looks like Cython 0.18 removed the members of flatiter in its copy
of numpy.pxd in favor of the macros that are recommended for numpy
1.7. The irony is not lost on me.

This should be (double *PyArray_ITER_DATA(itera)[0]).

I'm not sure why it appears to work in master, since this code in
mtrand.pyx did not change.

https://github.com/numpy/numpy/issues/3144

--
Robert Kern
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] can't run cython on mtrand.pyx

2013-03-13 Thread Neal Becker
Grabbed numpy-1.7.0 source.
Cython is 0.18

 cython mtrand.pyx produces lots of errors.

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] can't run cython on mtrand.pyx

2013-03-13 Thread Robert Kern
On Wed, Mar 13, 2013 at 6:40 PM, Neal Becker ndbeck...@gmail.com wrote:
 Grabbed numpy-1.7.0 source.
 Cython is 0.18

  cython mtrand.pyx produces lots of errors.

It helps to copy-and-paste the errors that you are seeing.

In any case, Cython 0.18 works okay on master's mtrand.pyx sources.

-- 
Robert Kern
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] can't run cython on mtrand.pyx

2013-03-13 Thread Neal Becker
Robert Kern wrote:

 On Wed, Mar 13, 2013 at 6:40 PM, Neal Becker ndbeck...@gmail.com wrote:
 Grabbed numpy-1.7.0 source.
 Cython is 0.18

  cython mtrand.pyx produces lots of errors.
 
 It helps to copy-and-paste the errors that you are seeing.
 
 In any case, Cython 0.18 works okay on master's mtrand.pyx sources.
 

Well, this is the first error:

cython mtrand.pyx

Error compiling Cython file:

...
PyArray_DIMS(oa) , NPY_DOUBLE)
length = PyArray_SIZE(array)
array_data = double *PyArray_DATA(array)
itera = flatiterPyArray_IterNew(objectoa)
for i from 0 = i  length:
array_data[i] = func(state, (double *(itera.dataptr))[0])
^


mtrand.pyx:177:41: Python objects cannot be cast to pointers of primitive types


___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion