I wrote:
> Kurt Smith wrote:
>> What needs to be done to write up the CEP and to start implementing the
new syntax, or a subset of it for the GSoC puprposes?  What blockers
are there that need to be addressed?  Would we need to resolve the
problem raised in the above section before starting?
>
> I actually think a good starting point right now is to "take a step
back": We now understand the issues involved, so let's aim for something
much lower.
>
> Basically, let it suffice to mid-term evaluation to do the Fortran
integration while requiring any passed arrays to be Fortran-contiguous.
>
> We can use
>
> cdef external_func(object[int] foo)
>
> as a syntax for this and pass the Py_buffer as-is without ever copying.
(So drop copying until int[:] can be introduced to get rid of the object
implications in the syntax.)
>
> If a copy is needed: Raise an exception.
>
> This isn't as bad as it sounds, as with NumPy arrays you can just call
copy('F') manually for now. So it will be usable, though I hope we can
get further after that is in place.
>
> Then, after mid-term we can see, and there's plenty of time to plan, let
things mature, etc.
>
> While we're planning: Do you want me to have a look at the G3 f2py
source, or will you just attempt some first steps and ping me when you
see what is needed there or have a question?

I don't know how fast you'd like to jump into Cython sources, but here's
something which would be a nice start, and which is needed whether we have
the new syntax or not.

It is what will be required to do

extfunc(obj)

rather than having to do

cdef np.ndarray[int] buf = obj
extfunc(buf)

As such, it isn't absolutely top priority, and you might want to work from
the f2py end first instead. (It would be nice to have a Fortran wrapper in
place before actually doing the extfunc(buf) step; but that is next to
trivial anyway, just passed the Py_buffer we already have...)

"Subproject description":

Currently buffer acquistion/release is implemented through something of a
hack (which Robert actually advised against during my GSoC, but I was
stressed about getting things done and less experienced with Cython).
Buffers are only supported on function local variables, and assignments to
those variables are special-cased for acquisition/release.

Instead one should do acquisition/release through the existing type
coercion system in Cython.

I've put the necesarry bits in #299 and #300 in trac.

Also, I've tagged *candidates* for tickets you will do in your GSoC so far
with "kurtgsoc", and added a link on the front page of trac to a query of
those.

Dag Sverre

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to