Pythran - 0.8.6

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Pythran - 0.8.6

Serge Guelton
Hi there,

Pythran just released its 0.8.6 version. A quick reminder: Pythran is a
compiler for scientific Python, it can be used to turn Python kernels
as:


    #pythran export _brief_loop(float64[:,:], uint8[:,:], intp[:,:], int[:,:], int[:,:])
    def _brief_loop(image, descriptors, keypoints, pos0, pos1):

        for k in range(len(keypoints)):
            kr, kc = keypoints[k]
            for p in range(len(pos0)):
                pr0, pc0 = pos0[p]
                pr1, pc1 = pos1[p]
                descriptors[k,p] = image[kr + pr0, kc + pc0] < image[kr + pr1, kc + pc1]

In a native library that runs much faster.

It's available on pypi: https://pypi.org/project/pythran/
on conda-forge (linux and osx): https://anaconda.org/conda-forge/pythran
and on github: https://github.com/serge-sans-paille/pythran

As a fun fact, Pythran is now used as a mean to turn Python code into
pure native library used in C++ code base, without Python involved. Some
people even use SWIG to turn this code into native libraries called
from... Java through JNI :-)

Enjoy,

Serge
--
https://mail.python.org/mailman/listinfo/python-announce-list

        Support the Python Software Foundation:
        http://www.python.org/psf/donations/