Skip to content
/ desilike Public
forked from cosmodesi/desilike

Modern cosmological inference framework used by the Dark Energy Spectroscopic Instrument (DESI) experiment.

License

Notifications You must be signed in to change notification settings

rdnv/desilike

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

823 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

desilike

Unit Testing Status Documentation Status Code Coverage License: MIT

desilike is an attempt to provide a common framework for writing DESI likelihoods, that can be imported in common cosmological inference codes (Cobaya, CosmoSIS, MontePython).

desilike has the following structure:

  • root directory: definition of parameters, base calculator classes, differentiation and Fisher routines, installation routines
  • theories: e.g. BAO, full-shape theory models
  • observables: e.g. power spectrum, correlation function
  • likelihoods: e.g. Gaussian likelihood of observables, a few external likelihoods (Pantheon, Planck)
  • bindings: automatic linkage with cobaya, cosmosis, montepython
  • emulators: emulate e.g. full-shape theory models, to speed up inference
  • samples: define chains, profiles data structures and plotting routines
  • samplers: many samplers for posterior sampling
  • profilers: profilers for posterior profiling

samples, samplers and profilers are provided for self-contained sampling / profiling of provided likelihoods. Example notebooks presenting most use cases are provided in directory nb/.

TODO

blackjax profilers. Clean ups.

Documentation

Documentation in construction on Read the Docs, desilike docs. See in particular getting started.

Requirements

Only strict requirements are:

  • numpy
  • scipy
  • pyyaml
  • mpi4py
  • cosmoprimo (currently with pyclass to compute DESI fiducial cosmology)

Should be made optional in the future:

  • mpi4py
  • pyclass (by extending TabulatedDESI to power spectra)

Installation

pip

Simply run:

python -m pip install git+https://github.com/cosmodesi/desilike

If you wish to use plotting routines (getdist, anesthetic), and tabulate for pretty tables:

python -m pip install git+https://github.com/cosmodesi/desilike#egg=desilike[plotting]

If you addtionally wish to be able to use analytic marginalization with jax:

python -m pip install git+https://github.com/cosmodesi/desilike#egg=desilike[plotting,jax]

git

First:

git clone https://github.com/cosmodesi/desilike.git

To install the code:

pip install --user

Or in development mode (any change to Python code will take place immediately) (Note the .):

pip install --user -e .

You may want to avoid installing dependencies in your local $HOME (in particular if you load the cosmodesi environment):

pip install --no-deps --user -e .

More information on pip: https://pip.pypa.io/en/stable/cli/pip_install/

Other dependencies (theory codes, etc.)

Just define your calculator (most commonly your likelihood), then in a python script:

from desilike import Installer
Installer(user=True)(likelihood)

License

desilike is free software distributed under a BSD3 license. For details see the LICENSE.

Acknowledgments

About

Modern cosmological inference framework used by the Dark Energy Spectroscopic Instrument (DESI) experiment.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 81.4%
  • Python 18.6%