[Numpy-discussion] swig numpy2carray converters
Georg Holzmann
grh@mur...
Sat Dec 1 10:21:25 CST 2007
Hallo!
> * A new ARGOUTVIEW suite of typemaps is provided that allows your
> wrapped function
> to provide a pointer to internal data and that returns a numpy
> array encapsulating
> it.
Thanks for integrating it !
> * New typemaps are provided that correctly handle FORTRAN ordered 2D
> and 3D arrays.
I have some problem with your FORTRAN implementation.
The problem is how you set the flags in numpy.i "int
require_fortran(PyArrayObject* ary)" (~ line 402).
You do it like this:
ary->flags = ary->flags | NPY_F_CONTIGUOUS;
which does not work (at least on my computer) - I still get usual
C-ordered arrays returned.
However, it does work if you set the flags like this:
ary->flags = NPY_FARRAY;
> Tests for the ARGOUTVIEW and FORTRAN ordered arrays have also been
> added, and the documentation (doc/numpy_swig.*) has been updated to
> reflect all of these changes.
A small typo: in the docs you also write about 1D FORTRAN ARGOUTVIEW
wrappers:
( DATA_TYPE** ARGOUTVIEW_FARRAY1, DIM_TYPE* DIM1 )
( DIM_TYPE* DIM1, DATA_TYPE** ARGOUTVIEW_FARRAY1 )
which of course do not exist.
LG
Georg
More information about the Numpy-discussion
mailing list