[SciPy-Dev] Repository for GSoC project

Jaime Fernández del Río jaime.frio at gmail.com
Mon May 25 16:58:24 EDT 2015


On Mon, May 25, 2015 at 1:15 PM, Gael Varoquaux <
gael.varoquaux at normalesup.org> wrote:

> I would strongly advocate not waiting for a full rewrite to try to
> integrate the code. I would strongly push to identify the easiest places
> to rewrite and to try to get code merged for these ASAP.
>

That may be hard for ndimage, let me explain the rationale...

ndimage is arranged in three or four layers:

   1. there's a Python layer,
   2. which calls on Python functions written in C,
   3. which calls on C functions,
   4. which use a few low level C "objects", which also have some hierarchy
   among them.

We could simply start translating at level 2, and make our way down to
level 4. Once completed, the stated goal of rewriting ndimage in Cython
would have been achieved, but I am afraid that it wouldn't help at all with
the improving maintainability goal: levels 3 and 4 above are a mess of
poorly documented code, with little regard for separation of concerns, and
that is not going to be solved by translating the same code structure to
another language.

The plan we are trying to follow is:

   1. Start at level 4, rewriting the lowest of the lowest C "objects."
   This will include not just translating to Cython, but better encapsulation
   of internal functionality, and providing a cleaner API for upstream use.
   2. As soon as enough work has been done at level 4 that it can be
   bubbled all the way up to level 1, go ahead with the bubbling up, for 1 or
   2 level 1 functions at most.
   3. Validate that things are working correctly, benchmark against the
   current implementation, adapt as needed.
   4. Go back to step 1, and keep working on level 4 rewriting, until there
   is a new chance to bubble the changes up.
   5. Eventually, once level 4 has been completely rewritten, a more
   up-down approach can probably be followed.

So in a way we are indeed going to try to integrate things ASAP, only soon
is going to be later than one may otherwise expect.

Now that I have explained it in writing, I guess we could try to follow
this approach directly in the current ndimage repository, keeping the old
code path alive until it was no longer needed...

Jaime

-- 
(\__/)
( O.o)
( > <) Este es Conejo. Copia a Conejo en tu firma y ayúdale en sus planes
de dominación mundial.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20150525/635f08d5/attachment.html>


More information about the SciPy-Dev mailing list