[Yt-dev] Removing generated Cython code

Matthew Turk matthewturk at gmail.com
Mon Jan 17 10:31:30 PST 2011


Hi everyone,

Last week we briefly talked about removing the generated post-Cython
.c and .cpp files from the repository.  They have become something of
a burden to maintain, and the diffs simply get too large.  I've taken
a stab at removing these, which I've placed in a bundle here:

http://yt.enzotools.org/files/cython-changes.hg

The changeset in question is bce1c775bb84 .  This starts by removing
.c and .cpp files generated by Cython and adding the appropriate
information about how to generate the .c and .cpp files to the
setup.py files for RAMSES and the amr_utils directories.
Additionally, dependencies are included in these setup.py files.
However, to get Cython to play nicely with NumPy, I've had to add in a
routine that I found written by Matthew Brett. I updated it to include
some C++ support.

Additionally, as a safeguard for those systems were Cython is not
already included, I have added a brief routine that checks whether or
not Cython is installed. If it is not, it attempts to install it. This
will still fail on systems where superuser privs are required, but
that should not be the case in the majority of yt installations that
are not on OSX. On OSX this will require sudo-ing the installation.

I'd really appreciate if at least one or two people could unbundle
this and test out that "python2.6 setup.py build_ext -i" works, and it
would be *extra* helpful if you could try this on a machine where
Cython isn't installed, and check that the auto-installation of Cython
actually works.  I've tested it a couple places and it works, but I
hope that others can test it as well.

Anyway, thanks for reading this far, and if you get a chance to test
that would be amazing.  And if you do, please refrain from pushing
these changes until we get settled on how well they work.  Hopefully
by making amr_utils.c a bit lighterweight we can be more free to make
changes to the Cython routines and people can get them faster.

Best,

Matt



More information about the yt-dev mailing list