Skip to content

Commit

Permalink
tox testing updated to python3, colossus comparison without cache to …
Browse files Browse the repository at this point in the history
…allow for virtual environment, installation description with added tests. This PR addresses a comment of the JOSS review openjournals/joss-reviews#3283
  • Loading branch information
sibirrer committed Jun 1, 2021
1 parent 6afa337 commit e45b67b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
23 changes: 22 additions & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Requirements
------------

Make sure the standard python libraries as specified in the `requirements <https://github.com/sibirrer/lenstronomy/blob/main/requirements.txt>`_.
The standard usage does not require all libraries to be installed, in particluar the different posterior samplers are only required when being used.
The standard usage does not require all libraries to be installed, in particular the different posterior samplers are only required when being used.

In the following, a few specific cases are mentioned that may require special attention in the installation and settings, in particular when it comes
to MPI and HPC applications.
Expand Down Expand Up @@ -54,3 +54,24 @@ We recommend using the EPL model as it is a pure python version of the same prof
$ git clone https://github.com/sibirrer/fastell4py.git <desired location>
$ cd <desired location>
$ python setup.py install --user
Check installation by running tests
-----------------------------------

You can check your installation with pytest::

$ cd <lenstronomy_repo>
$ py.test

Or you can run a partial test with::

$ cd <lenstronomy_repo>
$ py.test/test/test_LensModel/

You can also run the tests with tox in a virtual environment with::

$ cd <lenstronomy_repo>
$ tox

Note: tox might have trouble with the PyMultiNest installation and the cmake part of it.
2 changes: 1 addition & 1 deletion test/test_Cosmo/test_nfw_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def test_against_colossus(self):

from colossus.cosmology import cosmology as cosmology_colossus
from colossus.halo.profile_nfw import NFWProfile
colossus_kwargs = {'H0': 70, 'Om0': 0.285, 'Ob0': 0.05, 'ns': 0.96, 'sigma8': 0.82}
colossus_kwargs = {'H0': 70, 'Om0': 0.285, 'Ob0': 0.05, 'ns': 0.96, 'sigma8': 0.82, 'persistence': ''}
colossus = cosmology_colossus.setCosmology('custom', colossus_kwargs)

m200 = 10 ** 8
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py27
envlist = py36

[testenv]
setenv =
Expand Down

0 comments on commit e45b67b

Please sign in to comment.