Skip to content

Use macro access to flatiter objects in mtrand.pyx #3144

rkern opened this Issue Mar 14, 2013 · 2 comments

2 participants

NumPy member
rkern commented Mar 14, 2013

Cython 0.18's numpy.pxd removes direct member access to flatiter and other objects in favor of the macros. mtrand.pyx still uses direct member access. E.g.

NumPy member
charris commented Mar 17, 2013

The errors can be reproduced by replacing include "numpy.pxd" by from numpy cimport * at the top of the mtrand.pyx file and renaming the local numpy.pxd so cython can't find it. Looks like there will still be an error because the cython pxd file is missing NPY_ARRAY_ALIGNED.

NumPy member
charris commented Mar 17, 2013

Likewise, it looks like we can't fix these types of errors:

        multi = <broadcast> PyArray_MultiIterNew(3, <void *>oa, <void *>ob, <void *>oc)
        array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_DOUBLE)

mtrand.pyx:276:59: Cannot convert Python object to 'npy_intp *'

There don't appear to be any getters for multi.nd and multi.dimensions. So it won't be possible to make mtrand.pyx compile with the current Cython numpy.pxd file. We should probably add some macros and coordinate with the Cython folks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.