Skip to content

simonsobs/SOLikeT

Repository files navigation

SOLikeT: SO Likelihoods and Theories

Testing Status Test Coverage Documentation Status

SOLikeT is a centralized package for likelihood and theory implementations for the Simons Observatory. For more extensive details please see our main documentation pages at: http://soliket.readthedocs.io/.

Simons Observatory Logo

Installation

For a set of detailed requirements and installation instructions for different machines (e.g. NERSC, M1 Mac), please see the installation page.

A preferred and convenient way to install SOLikeT and its dependents is through using the conda environment defined in soliket-tests.yml. After installing an anaconda distribution (e.g. as described here), you can create the environment and install a the latest released version of SOLikeT using pip:

conda env create -f soliket-tests.yml
conda activate soliket-tests
pip install soliket

You can alternatively clone a local version of the in-development code and install it in editable mode:

git clone https://github.com/simonsobs/soliket
cd soliket
pip install -e .

Running an Example

SOLikeT is a collection of modules for use within the Cobaya cosmological inference and sampling workflow manager. Please see the Cobaya documentation for detailed instructions on how to use Cobaya to perform cosmological calculations and generate constraints on cosmological parameters.

SOLikeT examples and explanatory notebooks are under construction, but will be run using standard [yaml](https://en.wikipedia.org/wiki/YAML) format (which can in turn be read in as Python dictionaries). The examples will be run using something similar to:

cobaya-run examples/example_1.yaml

Developing SOLikeT Theories and Likelihoods

If you wish to develop your own Theory and Likelihood codes for use in SOLikeT please see the detailed instructions on the Developer Guidelines page.

Running Tests

Tests run a set of SOLikeT calculations with known expected results. There are (at least) two reasons you might want to run tests:

Checking code in development

To see if codes you have written when developing SOLikeT are valid and will pass the Continuous Integration (CI) tests which we require for merging on github.

If you are using conda, the easiest way to run tests (and the way we run them) is to use tox-conda:

pip install tox-conda
tox -e test

This will create a fresh virtual environment replicating the one which is used for CI then run the tests (i.e. without touching your current environment). Note that any args after a '--' string will be passed to pytest, so:

tox -e test -- -k my_new_module

will only run tests which have names containing the string 'my_new_model', and

tox -e test -- -pdb

will start a pdb debug instance when (sorry, if) a test fails.

Checking environment configuration

Check SOLikeT is working as intended in a python environment of your own specification (i.e. you have installed SOLikeT not using the solike-tests conda environment).

For this you need to make sure all of the required system-level and python dependencies described in the installation instructions are working correctly, then run:

pytest -v soliket

Good luck!

Please raise an issue if you have trouble installing or any of the tests fail.