Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for recent python 3 versions #56

Open
wants to merge 52 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
5f5900f
adapted hope to run on python 3.5 and newer Python versions
uweschmitt Aug 7, 2017
844b2e0
first refac attempt for using gitlab-ci instead of jenkins
uweschmitt Aug 11, 2017
e6f2150
fixed pyenv calls in .gitlab-ci.yml
uweschmitt Aug 11, 2017
dd6def4
removed py>3.4 from tox.ini
uweschmitt Aug 11, 2017
8f52082
Merge branch 'master' into fixes_for_recent_python_3_versions
uweschmitt Aug 14, 2017
5d3c217
fixed copied references to PyCosmo from tox.ini
uweschmitt Aug 15, 2017
ad2957d
fixed randomized tests, eg using a seed
uweschmitt Aug 16, 2017
0f9392f
converted jupyter notebooks in benchmarks folder to recent nb format
uweschmitt Aug 17, 2017
a1d20da
added missing method for python 3 ast in _transformer.py
uweschmitt Aug 29, 2017
9f9bf55
modified c++ options to surpress warnings about unreachable code
uweschmitt Aug 29, 2017
3f4b3fd
improved .gitignore
uweschmitt Aug 29, 2017
b106a14
fixed test_control_structures.py for python 3
uweschmitt Aug 29, 2017
80a65af
backup of benchmarks folder for python 3 transition
uweschmitt Aug 29, 2017
98bd1a0
integrated benchmarks to docs
uweschmitt Sep 4, 2017
7f1da56
first attempt for improved ci integration
uweschmitt Sep 5, 2017
b269511
fix .gitlab-ci.yml
uweschmitt Sep 5, 2017
1a33033
fix .gitlab-ci.yml
uweschmitt Sep 5, 2017
2dc95da
fixed broken links in docs/index.rst
uweschmitt Sep 5, 2017
3b9330a
fixed mistake in tox.ini
uweschmitt Sep 5, 2017
68b8d5a
attempt to pass htmlcov from test job to docs job
uweschmitt Sep 6, 2017
3967477
only run one test in tox.ini to shorten gitlab ci job run time for de…
uweschmitt Sep 6, 2017
a361d23
fake style job in .gilab-ci.yml to shorten job run time for debugging
uweschmitt Sep 6, 2017
76dd4ed
fake style job in .gilab-ci.yml to shorten job run time for debugging
uweschmitt Sep 6, 2017
f27520d
fake style job in .gilab-ci.yml to shorten job run time for debugging
uweschmitt Sep 6, 2017
489e86c
fake style job in .gilab-ci.yml to shorten job run time for debugging
uweschmitt Sep 6, 2017
f4cbc3d
fixed publishing docs
uweschmitt Sep 6, 2017
6c1f2b2
still fixing .gitlab-ci.yml and tox for docs generation and publishing
uweschmitt Sep 6, 2017
04fa896
Update pipeline badge README.rst
uweschmitttest Sep 6, 2017
687f3bc
Update badges in README.rst
uweschmitttest Sep 6, 2017
0abfa7b
tox.ini and .gitlab-ci.yml now run all tests again as test setup seem…
uweschmitt Sep 6, 2017
0bc210b
Merge branch 'fixes_for_recent_python_3_versions'
uweschmitt Sep 7, 2017
281e8f9
reformatted README.rst
uweschmitt Sep 8, 2017
8e73678
added supported python versions to README.rst
uweschmitt Sep 8, 2017
594a525
bumped to version 0.7.0
uweschmitt Sep 8, 2017
8f3cbf1
Merge branch 'master' of cosmo-gitlab.phys.ethz.ch:cosmo/hope
uweschmitt Sep 8, 2017
5c5c518
activated style check again in .gitlab-ci.yml, was deactivated for de…
uweschmitt Sep 8, 2017
bf80ecd
added py36 to tox.ini
uweschmitt Sep 8, 2017
246686e
added packages needed for running benchmark notebooks to requirements…
uweschmitt Sep 8, 2017
9295ad1
requirements.txt only lists jupyter for python 3
uweschmitt Sep 8, 2017
bc24fae
updated theme for docs
uweschmitt Sep 8, 2017
775384a
added missing --extra-index-url to requirements.txt
uweschmitt Sep 8, 2017
63b806d
commit ad2957d was incomplete, now also set seed of numpys random gen…
uweschmitt Sep 8, 2017
ec7f5a3
rearanged .gitlab-ci.yml to make style check a job indipendent from p…
uweschmitt Sep 11, 2017
c1cf688
fixed .gitlab-ci.yml
uweschmitt Sep 11, 2017
0b37189
Revert "fixed .gitlab-ci.yml"
uweschmitt Sep 11, 2017
95efab8
Revert "rearanged .gitlab-ci.yml to make style check a job indipenden…
uweschmitt Sep 11, 2017
6eaf2c1
Revert last two changes as jobs can not be independent of pipelines
uweschmitt Sep 11, 2017
7ab9c54
attempt to get more information why rendering notebooks fails
uweschmitt Sep 11, 2017
e98974e
Merge branch 'master' of cosmo-gitlab.phys.ethz.ch:cosmo/hope
uweschmitt Sep 11, 2017
327210c
fixed render_benchmarks_to_html.sh
uweschmitt Sep 11, 2017
a60c456
renamed folder tests -> test
uweschmitt Sep 27, 2017
f759c4b
added installation of llvm 4.0 to .travis.yml
uweschmitt Sep 27, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,10 @@ htmlcov/
/.cache/
/.ipynb_checkpoints/
/.settings/

**/.*.sw?
venv*
sandbox

**/.DS_Store
.python-version
53 changes: 53 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
stages:
- style
- test_code
- test_and_create_docs
- publish_docs

tests:
tags:
- python
script:
- pyenv versions
- pyenv local 2.7 3.4.6 3.5.3 3.6.2
- tox -r -vv -i https://cosmo-pypi.phys.ethz.ch/simple
stage: test_code
artifacts:
paths:
- htmlcov/

style:
tags:
- python
script:
- pyenv local 2.7 3.4.6 3.5.3 3.6.2
- tox -e style -i https://cosmo-pypi.phys.ethz.ch/simple
allow_failure: true
stage: style


docs:
tags:
- python
script:
- pyenv local 2.7 3.4.6 3.5.3 3.6.2
- tox -e docs -i https://cosmo-pypi.phys.ethz.ch/simple
stage: test_and_create_docs
dependencies:
- tests
artifacts:
paths:
- docs/_build

publish_docs:
tags:
- python
script:
- publish_docs docs/_build hope
- create_index_html
when: manual
stage: publish_docs
dependencies:
- docs
only:
- master
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ python:
before_install:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get -qq update
- sudo apt-get -qq install g++-4.8 gcc-4.8
- sudo apt-get -qq install g++-4.8 gcc-4.8 llvm-4.0-dev
- sudo ln -sf /usr/bin/gcc-4.8 /usr/bin/gcc
- sudo ln -sf /usr/bin/g++-4.8 /usr/bin/g++
# We do this conditionally because it saves us some downloading if the
Expand Down
3 changes: 2 additions & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ We would like to thank several people for helping to test this package before re
* Chihway Chang
* Sebastian Gaebel
* Joerg Herbel
* Uwe Schmitt


Citations
Expand All @@ -35,4 +36,4 @@ Feedback
If you have any suggestions or questions about **HOPE** feel free to email me
at [email protected].

If you encounter any errors or problems with **HOPE**, please let me know!
If you encounter any errors or problems with **HOPE**, please let me know!
9 changes: 8 additions & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

History
-------

0.7.0 (2017-09-08)
++++++++++++++++++

* Support for Python 3.5 and 3.6


0.6.1 (2016-07-04)
++++++++++++++++++

Expand Down Expand Up @@ -90,4 +97,4 @@ AugBitAnd ``a & b``
0.1.0 (2014-02-27)
++++++++++++++++++

* Initial creation.
* Initial creation.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ lint:
flake8 hope test

test:
py.test -v -s
py.test -v -s test

test-all:
tox
Expand All @@ -48,4 +48,4 @@ docs:
sdist: clean
#pip freeze > requirements.rst
python setup.py sdist
ls -l dist
ls -l dist
46 changes: 31 additions & 15 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,26 @@ HOPE - combine the ease of Python and the speed of C++
.. image:: https://badge.fury.io/py/hope.svg
:target: http://badge.fury.io/py/hope

.. image:: https://travis-ci.org/cosmo-ethz/hope.svg?branch=master
:target: https://travis-ci.org/cosmo-ethz/hope

.. image:: https://coveralls.io/repos/cosmo-ethz/hope/badge.svg?branch=master
:target: https://coveralls.io/r/cosmo-ethz/hope?branch=master

.. image:: https://img.shields.io/badge/docs-latest-blue.svg?style=flat
:target: http://hope.readthedocs.org/en/latest

.. image:: http://img.shields.io/badge/arXiv-1410.4345-brightgreen.svg?style=flat
:target: http://arxiv.org/abs/1410.4345

.. image:: https://cosmo-gitlab.phys.ethz.ch/cosmo/hope/badges/master/build.svg

.. image:: https://cosmo-gitlab.phys.ethz.ch/cosmo/hope/badges/master/coverage.svg

**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
**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:
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:

.. code-block:: python

Expand All @@ -31,15 +34,28 @@ By using **HOPE**, the user can benefit from being able to write common numerica
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 <http://www.cosmology.ethz.ch/research/software-lab.html>`_ of the `ETH Institute of Astronomy <http://www.astro.ethz.ch/>`_, and is now publicly available at `GitHub <https://github.com/cosmo-ethz/hope>`_.

Further information on the package can be found in our `paper <http://www.sciencedirect.com/science/article/pii/S2213133714000687>`_, on `readthedocs.org <http://hope.readthedocs.org/en/latest/>`_ and on our `website <http://hope.phys.ethz.ch>`_.
The **HOPE** package has been developed at ETH Zurich in the `Software Lab of
the Cosmology Research Group
<http://www.cosmology.ethz.ch/research/software-lab.html>`_ of the `ETH
Institute of Astronomy <http://www.astro.ethz.ch/>`_, and is now publicly
available at `GitHub <https://github.com/cosmo-ethz/hope>`_.

Further information on the package can be found in our `paper
<http://www.sciencedirect.com/science/article/pii/S2213133714000687>`_, on
`readthedocs.org <http://hope.readthedocs.org/en/latest/>`_ and on our
`website <http://hope.phys.ethz.ch>`_.

Python versions supported
-------------------------

Hope supports Python versions from `2.7` up to `3.6`.

Installation
------------

The package has been uploaded to `PyPI <https://pypi.python.org/pypi/hope>`_ and can be installed at the command line via pip::
The package has been uploaded to `PyPI <https://pypi.python.org/pypi/hope>`_
and can be installed at the command line via pip::

$ pip install hope

Expand Down
3 changes: 3 additions & 0 deletions benchmarks/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
/star.py
/util.py
/.ipynb_checkpoints/
hope/
*.html

929 changes: 416 additions & 513 deletions benchmarks/HPC Python.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions benchmarks/compile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
clang++ -bundle -undefined dynamic_lookup fib.o build/temp.macosx-10.11-x86_64-2.7/recfast4py/cosmology.Recfast.o build/temp.macosx-10.11-x86_64-2.7/recfast4py/evalode.Recfast.o build/temp.macosx-10.11-x86_64-2.7/recfast4py/recombination.Recfast.o build/temp.macosx-10.11-x86_64-2.7/recfast4py/ODE_solver.Recfast.o build/temp.macosx-10.11-x86_64-2.7/recfast4py/DM_annihilation.Recfast.o build/temp.macosx-10.11-x86_64-2.7/recfast4py/Rec_corrs_CT.Recfast.o -o build/lib.macosx-10.11-x86_64-2.7/recfast4py/_recfast.so
Loading