Pythran 0.7.2 is out!

serge guelton serge.guelton at telecom-bretagne.eu
Tue Oct 13 21:14:39 CEST 2015


(sorry for the double posting, if any)

Dear pythraners and pythonistae (the latin plural for pythonista?)

It is my pleasure to announce the release of Pythran 0.7.2, now
available on

    - pypy: https://pypi.python.org/pypi/pythran
    - conda: https://anaconda.org/serge-sans-paille/pythran
    - github: https://github.com/serge-sans-paille/pythran

Pythran is an ahead-of-time Python compiler with a focus on high-level
scientific computing. It relies on a few non-intrusive annotations to
provide (potentially) vectorized, parallel version of high level Python
code, like the following, borrowed from stackoverflow [0];

    #pythran export GrayScott(int, float, float, float, float)
    # ^ see the non intrusive, backward compatible annotation ^

    import numpy as np
    def GrayScott(counts, Du, Dv, F, k):
        n = 300
        U = np.zeros((n+2,n+2), dtype=np.float32)
        V = np.zeros((n+2,n+2), dtype=np.float32)
        u, v = U[1:-1,1:-1], V[1:-1,1:-1]

        r = 20
        u[:] = 1.0
        U[n/2-r:n/2+r,n/2-r:n/2+r] = 0.50
        V[n/2-r:n/2+r,n/2-r:n/2+r] = 0.25
        u += 0.15*np.random.random((n,n))
        v += 0.15*np.random.random((n,n))

        for i in range(counts):
            Lu = (                 U[0:-2,1:-1] +
                  U[1:-1,0:-2] - 4*U[1:-1,1:-1] + U[1:-1,2:] +
                                   U[2:  ,1:-1] )
            Lv = (                 V[0:-2,1:-1] +
                  V[1:-1,0:-2] - 4*V[1:-1,1:-1] + V[1:-1,2:] +
                                   V[2:  ,1:-1] )
            uvv = u*v*v
            u += Du*Lu - uvv + F*(1 - u)
            v += Dv*Lv + uvv - (F + k)*v

        return V

This minor yet amazing version brings in more numpy function support
[1], easier install, a conda build, tentative windows support, faster
compilation time and generates generally faster native modules.

Kudos to Pierrick for the hardwork and to all the bug reporters. You all
help a lot to bring the motivation high.

Special thanks to the OpenDreamKit[2] project for the financial support.
Most of the new features have been implemented thanks to this funding!


Changelog extract:

2015-10-13 Serge Guelton <serge.guelton at telecom-bretagne.eu>

	* Significantly decrease compilation time

	* Faster execution of numpy generalized slicing

	* Tentative conda support

	* Tentative Windows support (using Win Python)

	* Preserve original docstrings

	* Add __pythran__ global variable to pythran generated modules

	* Faster implementation of various itertools functions

	* Rely on distutils for module code compilation

	* Support most of numpy.random

	* Remove git and make dependency to install nt2

	* Proper pip support instead of distuils

	* Remove dependency to boost.python

	* Remove dependency to tcmalloc

	* Pythonic library cleaning (less dependencies / header / splitting / mrpropering)

	* More lazy computations

	* More numpy function support (including dot on matrices, linalg.norm, mean)

	* Lot of code cleaning / refactoring (both in Python and C++)

	* Many bugfixes, thanks to all the bug reporters!


[0] http://stackoverflow.com/questions/26823312/numba-or-cython-acceleration-in-reaction-diffusion-algorithm

[1] https://pythonhosted.org/pythran/SUPPORT.html

[2] http://opendreamkit.org/


More information about the Python-announce-list mailing list