Shapely on PyPy
Last night I began experimenting with PyPy following Bob Ippolito's notes. PyPy's JIT may open the door to fast pure Python computation geometry algorithms, but in the meanwhile I'd like to see if my various libraries will work with PyPy. Thanks to work by Oliver Tonhofer, Shapely does.
(pypy-2d192eaab45f-osx64)s3:pypy-env seang$ pypy Python 2.7.1 (2d192eaab45f, Jul 07 2011, 22:10:02) [PyPy 1.5.0-alpha0 with GCC 4.0.1] on darwin Type "help", "copyright", "credits" or "license" for more information. And now for something completely different: ``not your fault, more like it's a moving target'' >>>> from shapely.geometry import Point >>>> p = Point(0.0, 0.0) >>>> p.buffer(10.0).area 313.65484905459385
Shapely 1.2.11 coming soon.
Update (2011-07-09): In case anyone else, like me, is in the position of having to bootstrap PyPy from source without a binary (running OS X 10.5.x here), I'll provide some extra notes. Where Ippolito writes:
# Translate PyPy (expect this a while, at least an hour for me) (cd pypy/translator/goal; pypy translate.py -Ojit)
I used my system Python 2.5 ("python" instead of "pypy") and GCC 4.0.1 from XCode 3.1.3 to translate successfully. Time elapsed was about 2.5 hours on my MacBook Pro (2.8GHz Intel Core 2 Duo with 4 GB RAM). Compiling CPython from source on this same computer takes only several minutes.