June 15, 2011
12:36 p.m.
Hi
any Cython expert around (Ondrej?).
Our build system already supports cython extension modules and I succeeded in using it for simple stuff, like the sfepy/fem/physics/extmods/cdft.pyx, see [1].
Now I would like to proceed further, but am only a beginner, so an advice would come handy:
I need to map somehow numpy arrays to the FMField struct defined in sfepy/fem/extmods/fmfield.h to be able to export C functions (e.g. term evaluation functions) to Python and pass numpy arrays in. What is the best way to do this? Also being able to call Python from C would be nice (e.g. some numpy array functions).
(Why all this?
- Cython wrappers are much lighter compared to swig ones -> less call overhead.
- Cython code looks like Python, so it's easier to write fast code.
- it's cool :))
r.