[SciPy-dev] Inclusion of cython code in scipy

Robert Kern robert.kern at gmail.com
Tue Apr 22 19:28:29 EDT 2008


On Tue, Apr 22, 2008 at 6:19 PM, Anne Archibald
<peridot.faceted at gmail.com> wrote:
> Hi,
>
>  What do people think about including cython code in scipy?
>
>  Pros:
>  * Easy way to write faster code
>  * Convenient way to interface to compiled code
>
>  Cons:
>  * Yet another interfacing setup
>  * Yet another language readers of the code need to understand
>  * Additional dependency for developers
>  * cython is in flux and drastic improvements in its handling of numpy
>  arrays are hoped for
>  * Requires support in build tools (distutils/makefiles/scons magic)

Well, we already have SWIG code in scipy and even Pyrex code in numpy.
The way we have handled it thus far is to make developers check in the
generated code. The setup scripts refer to the generated C files
rather than the real sources. In most places, though, the lines to
derive directly from the real sources are just commented out so
developers can switch between them if they are touching that code.
Checking in generated sources into source control is evil, frankly,
but it resolves some of these headaches and replaces them with only
lesser ones.

I am all for your using Cython. Keep track of the version that you are
using in a comment near the top of the file to warn other developers
to use the same version or otherwise coordinate on upgrading.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
 -- Umberto Eco



More information about the SciPy-Dev mailing list