[Cython] never used numpy.pxd, but now my code is failing

Dag Sverre Seljebotn d.s.seljebotn at astro.uio.no
Tue Apr 10 21:52:39 CEST 2012


On 04/10/2012 08:32 PM, Lisandro Dalcin wrote:
> Is there any way to disable special-casing of numpy arrays? IMHO, if
> I'm not using Cython's numpy.pxd file, Cython should let me decide how
> to manage the beast.
>
>
> Error compiling Cython file:
> ------------------------------------------------------------
> ...
>      if ((nm != PyArray_DIM(aj, 0)) or
>          (nm != PyArray_DIM(av, 0)) or
>          (si*bs * sj*bs != sv)): raise ValueError(
>          ("input arrays have incompatible shapes: "
>           "rows.shape=%s, cols.shape=%s, vals.shape=%s") %
>          (ai.shape, aj.shape, av.shape))
>            ^
> ------------------------------------------------------------
>
> PETSc/petscmat.pxi:683:11: Cannot convert 'npy_intp *' to Python object
>

Whoops, sorry about that. I patched on yet another hack here:

https://github.com/dagss/cython/commit/6f2271d2b3390d869a53d15b2b70769df029b218

Even if there's been a lot of trouble with these hacks I hope it can 
still go in; it is important in order to keep a significant part of the 
Cython userbase happy.

Dag


More information about the cython-devel mailing list