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

Dev update install instructions #127

Merged
merged 24 commits into from
May 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e545125
updated install instructions and readme
May 15, 2023
ac47801
updated install instructions
May 15, 2023
f78e267
updated install instructions
May 15, 2023
f5d339e
Merge branch 'master' into dev-update-install-instructions
itrharrison May 23, 2023
d840fb2
updates to readme
itrharrison May 26, 2023
934c863
change image path for readme
itrharrison May 26, 2023
5518303
added logo
itrharrison May 26, 2023
1c6b331
create separeate text for readme and docs index
itrharrison May 26, 2023
64eb4a6
removed old instructions from install.rst
itrharrison May 26, 2023
1da13d7
added developers page to consolidate guidance
itrharrison May 26, 2023
c9814e8
added docs guidelines page
itrharrison May 27, 2023
abc3532
typos and move docs doc
itrharrison May 27, 2023
a22431b
remove depracated files
itrharrison May 27, 2023
0e65cfd
removed old guidelines, integrated into developers.rst
itrharrison May 27, 2023
78914e0
changed dev guidleines name in readme
itrharrison May 27, 2023
ff2f60b
add sphinxemoji
itrharrison May 27, 2023
cfe2c92
remove emoji :-(
itrharrison May 27, 2023
ea65e5a
remove env build from readthedocs
itrharrison May 27, 2023
8c665bc
readd env build from readthedocs as necessary
itrharrison May 27, 2023
6749114
added missing workflow docs page
itrharrison May 27, 2023
00aea27
Update README.rst
itrharrison May 30, 2023
1e12112
Update README.rst
itrharrison May 30, 2023
5112382
Update docs/developers.rst
itrharrison May 30, 2023
49e4263
docs fixes after review
itrharrison May 30, 2023
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
50 changes: 47 additions & 3 deletions INSTALL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ Optional: Install CosmoPower
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
In order to use the CosmoPower Theories within SOLikeT you will need to additionally install CosmoPower (and with it tensorflow, which is rather heavy and hence left out of the default installation).

This should be easily achievable with::
Unless using an M1 Mac this should be easily achievable with::

$ pip install cosmopower

If you wish to install it using your own system tools some useful information is provided below.
If you wish to install it using your own system tools (including new M1 Mac) some useful information is provided below.

Harder Way: Preparing your own conda environment
----------------------------------
Expand Down Expand Up @@ -59,7 +59,7 @@ Based on `cobaya documentation <https://cobaya.readthedocs.io/en/latest/cluster_
At NERSC
--------

Note: you may want to run cobaya in the SCRATCH directory (see thread `here <https://github.com/CobayaSampler/cobaya/issues/219>`_).
Based on CORI. To be checked against Perlmutter yet. Note: you may want to run cobaya in the SCRATCH directory (see thread `here <https://github.com/CobayaSampler/cobaya/issues/219>`_).

**CREATE A CONDA-ENV COPYING LAZY-MPI4PY AND USING GNU**
Based on `NERSC documentation <https://docs.nersc.gov/development/languages/python/parallel-python/#mpi4py>`_.
Expand Down Expand Up @@ -98,3 +98,47 @@ Based on `NERSC documentation <https://docs.nersc.gov/development/languages/pyth
Create your job script following `cobaya docs <https://cobaya.readthedocs.io/en/devel/run_job.html>`_.

Many thanks to Luca Pagano, Serena Giardiello, Pablo Lemos, +++

On M1 Mac
--------
There is an issue with installing tensorflow (needed for cosmopower) on M1 Mac that is likely to be solved in the future. For the moment, if you want to couple SOLikeT to cosmopower, please follow this guidance:

1. Download latest miniconda installer (e.g., `here: Download Conda environment <https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh>`_) and properly rename it (e.g., -> miniconda.sh)
2. Install miniconda and tensor flow-deps

::

bash ~/miniconda.sh -b -p $HOME/miniconda
source ~/miniconda/bin/activate
conda install -c apple tensorflow-deps

3. git clone soliket and create your virtual env

::

git clone https://github.com/simonsobs/soliket
cd soliket
conda env create -n my_env -f soliket-tests.yml
conda activate my_env

4. Install tensorflow-macos and metal with correct versioning

::

pip install tensorflow-macos
pip install tensorflow-metal

5. Download and install cosmopower manually

::

git clone https://github.com/alessiospuriomancini/cosmopower
cd cosmopower
pip install .

6. Go back to soliket folder and install it

::

cd path/to/your/soliket
pip install -e .
59 changes: 30 additions & 29 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
=======
SOLikeT
SOLikeT: SO Likelihoods and Theories
=======

.. image:: https://github.com/simonsobs/soliket/workflows/Testing/badge.svg
Expand All @@ -14,53 +14,51 @@ SOLikeT
:target: https://soliket.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status

**SO Likelihoods and Theories**

A centralized package for likelihood and theory implementations for SO.
SOLikeT is a centralized package for likelihood and theory implementations for the `Simons Observatory <https://simonsobservatory.org/>`_.
For more extensive details please see our main documentation pages at: `http://soliket.readthedocs.io/ <http://soliket.readthedocs.io/>`_.

.. image:: docs/images/Sky_UCSD2b.jpg
:target: https://simonsobservatory.org/
:alt: Simons Observatory Logo
:width: 200

Installation
============

For a set of detailed instructions for different machines (e.g. NERSC), please see `the installation page <INSTALL.rst>`_.

To install SOLikeT we expect that you have the following system-level tools:

* python>=3.7,<3.11
* pip
* compilers (c, cxx, fortran)
* cmake
* swig
* gsl
* fftw
* cython
* mpi4py

A convenient way to obtain these things (along with the python dependencies listed in requirements.txt) is through using the conda environment in soliket-tests.yml. This conda environment is the one we use for running tests.
For a set of detailed requirements and installation instructions for different machines (e.g. NERSC, M1 Mac), please see `the installation page <INSTALL.rst>`_.

You can then install SOLikeT in the usual way with pip::
A preferred and convenient way to install SOLikeT and its dependents is through using the conda environment defined in `soliket-tests.yml <soliket-tests.yml>`_. After installing an anaconda distribution (e.g. as described `here <https://docs.anaconda.com/free/anaconda/install/index.html>`_), you can create the environment and install a locally cloned version of SOLikeT using pip::

git clone https://github.com/simonsobs/soliket
cd soliket
conda env create -f soliket-tests.yml
conda activate soliket-tests
pip install -e .


Optional Extras
---------------
Running an Example
==================

In order to use the CosmoPower Theories within SOLikeT you will need to additionally install CosmoPower (and with it tensorflow, which is rather heavy and hence left out of the default installation).
SOLikeT is a collection of modules for use within the Cobaya cosmological inference and sampling workflow manager. Please see `the Cobaya documentation <https://cobaya.readthedocs.io/en/latest/>`_ for detailed instructions on how to use Cobaya to perform cosmological calculations and generate constraints on cosmological parameters.

This should be easily achievable with::
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::

pip install cosmopower
cobaya-run soliket-example.yml


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 <docs/developers.rst>`_ page.

Running Tests
=============

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

1. To see if tests you have written when developing SOLikeT are valid and will pass the Continuous Integration (CI) tests which we require for merging on github.
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::

Expand All @@ -77,9 +75,12 @@ will only run tests which have names containing the string 'my_new_model', and :

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

2. Check SOLikeT is working as intended in an environment of your own specification.
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 above system-level and python dependencies are working correctly, then run::
For this you need to make sure all of the required system-level and python dependencies described in `the installation instructions <INSTALL.rst>`_ are working correctly, then run::

pytest -v soliket

Expand Down
4 changes: 2 additions & 2 deletions docs/ccl.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CCL
===
The Core Cosmology Library (CCL) Calculator
===========================================

.. automodule:: soliket.ccl

Expand Down
Loading