A Python Just-In-Time compiler for astrophysical computations
Project description
HOPE is a specialized method-at-a-time JIT compiler written in Python for translating Python source code into C++ and compiles this at runtime. In contrast to other existing JIT compliers, which are designed for general purpose, we have focused our development of the subset of the Python language that is most relevant for astrophysical calculations. By concentrating on this subset, HOPE is able to achieve the highest possible performance
By using HOPE, the user can benefit from being able to write common numerical code in Python and having the performance of compiled implementation. To enable the HOPE JIT compilation, the user needs to add a decorator to the function definition. The package does not require additional information, which ensures that HOPE is as non-intrusive as possible:
from hope import jit
@jit
def sum(x, y):
return x + y
The HOPE package has been developed at ETH Zurich in the Software Lab of the Cosmology Research Group of the ETH Institute of Astronomy, and is now publicly available at GitHub.
Further information on the package can be found in our paper, on pythonhosted.org and on our website.
Installation
The package has been uploaded to PyPI and can be installed at the command line via pip:
$ pip install hope
Or, if you have virtualenvwrapper installed:
$ mkvirtualenv hope $ pip install hope
History
0.4.0 (2015-02-04)
Increased compilation speed for large functions
Support for variable allocation within if-else
Added support for numpy.sign
Updated Cython implementation in benchmarks
Fixed array allocation problem under OSX Yosemite (thx iankronquist)
0.3.1 (2014-10-24)
Better support for Python 3.3 and 3.4
Proper integration in Travis CI
Improved support for Linux systems (accepting x86_64-linux-gnu-gcc)
Avoiding warning on Linux by removing Wstrict-prototypes arg
Supporting gcc proxied clang (OS X)
Added set of examples
0.3.0 (2014-10-16)
Language: scalar return values
Shared libraries are written to hope.config.prefix
Function call can have return values
Fixed function calls to function with no arguments
Make sure code is recompiled if the python code has changed
Added config.optimize to simplify expression using sympy and replace pow
Speed improvements for hope
Added support for object properties
Added support for object methods
Addes support for True and False
Addes support for While
Addes support for numpy.sum
Addes support for numpy.pi
Added support for numpy.floor, numpy.ceil, numpy.trunc, numpy.fabs, numpy.log
improved error messages
Added config.rangecheck flag
Support xrange in for loop
Added cast operators for np.bool_, np.int_, np.intc, np.int8, np.int16, np.int32, np.int64, np.uint8, np.uint16, np.uint32, np.uint64, np.float_, np.float32, np.float64,
Added bool operators
Added the following operators:
FloorDiv |
a // b |
Mod |
a % b |
LShift |
a << b |
RShift |
a >> b |
BitOr |
a | b |
BitXor |
a ^ b |
BitAnd |
a & b |
AugFloorDiv |
a //= b |
AugPow |
a **= b |
AugMod |
a %= b |
AugLShift |
a <<= b |
AugRShift |
a <<= b |
AugBitOr |
a | b |
AugBitXor |
a ^ b |
AugBitAnd |
a & b |
0.2.0 (2014-03-05)
First release on private PyPI.
0.1.0 (2014-02-27)
Initial creation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.