[SciPy-dev] NumPy f2py GSOC project

Dag Sverre Seljebotn dagss@student.matnat.uio...
Fri Mar 27 02:54:31 CDT 2009

Charles R Harris wrote:
> 2009/3/26 ross smith <rjsm@umich.edu <mailto:rjsm@umich.edu>>
>      >What part will be ported to Cython? As I
>      >understand it, a) f2py itself is entirely written in Python
>     already, b)
>      >it generates a C module much like Cython does, which must currently be
>      >kept Py2 because of the NumPy dependency.
>     the fortranobject is written in C, and would be ported to Cython. 
>     also,  much of the python code could be ported to cython for some
>     speedup and to make the code 'python neutral'.  Cython would do the
>     heavy lifting of generating valid python (2 or 3) code when it is
>     compiled, so the code wouldn't have to be ported by hand when the
>     rest of Numpy is ported.
> So you intend for the output file to be in cython? I suppose the 
> reasoning here is that that would solve c-level compatibility problems. 
> I'm not sure that's the best way to go, it introduces a dependency on 
> cython python3.0 and numpy support and I don't know where that stands. 
> Maybe Dag can comment. I don't think rewriting the parser itself in 
> cython is a good idea.

Porting the parser to Cython doesn't seem like a good idea. It is only 
needed as a standalone tool; and py2 will be available parallell with 
py3 for years to come (at which point one can jump to py3 instead of cy 
for the parser).

Cython likely supports NumPy under Py3 the moment it is out due to PEP 3118.

However I'm worried that changing to Cython output would break backwards 
compatability with pyf files which allow inline C. It is a big design 
change which goes beyond Py3 compatability. It would then overlap a bit 
with Kurt's proposal.

Dag Sverre

More information about the Scipy-dev mailing list