Skip to content

cloe-org/cloelib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

284 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

cloelib – The Library for the Cosmology Likelihood for Observables in Euclid

cloelib is a flexible and efficient library designed to compute cosmological observables for the CLOE (Cosmology Likelihood for Observables in Euclid) project. It is built for seamless integration with Boltzmann solvers and JAX-based frameworks, enabling automatic differentiation and modularity for the next generation of cosmological analyses.

We welcome feedback from the Euclid community and beyond to refine and improve this library!

CI Docs pre-commit Tests: pytest Linting: Ruff Code Style: Prettier Type Checking: mypy PyPI version


πŸ“– Table of Contents


✨ Features

πŸ”Ή Intuitive & User-Friendly – Generate Euclid-like observables (e.g., power spectra, window functions, and tracer statistics) in just 3 minutes!

πŸ”Ή Automatic Differentiation – Includes a toy-example with JAX for gradient-based computations.

πŸ”Ή Modular & Extensible –

  • Easily interface with external Boltzmann solvers or emulators via Python Protocols following the cosmology.API.
  • Core structure enables defining Background & Perturbation models, choosing observables via Tracer or SpectroPower protocols, and computing final summary statistics like angular power spectra or Legendre multipoles.

πŸ“‚ Supported external codes

cloelib interfaces with the following external codes, each used by a specific internal module for its calculations:

Background Perturbations SpectroPower
camb camb comet-emu
class class pbjcosmo
NA HMCode2020emu NA
NA cosmopower-jax NA
NA euclidemu2 NA
NA BACCOemu NA
NA e-MANTIS NA

Optional Dependencies

Several optional dependencies enhance cloelib capabilities:

  • pyinstrument – Time profiling for performance optimization
  • pylevin, mpmath – Required for specific observational probes (i.e: COSEBIs)
  • tensorflow – Needed for certain emulator backends (i.e: HMCode2020emu)

These are not included in the default installation but can be installed as shown below.


πŸš€ Installation

Quick Start 🎯

  1. Set up your environment – Create a fresh conda/mamba environment using the cloe-org-environments repository. Then, clone cloelib:
git clone https://github.com/cloe-org/cloelib.git
cd cloelib
  1. Check out the latest release (optional but recommended):
git checkout <latest-tag>  # Find tags in "Releases"
  1. Install cloelib – Get the core library up and running:
pip install .
  1. Add optional superpowers – Enhance with external dependencies and tools:
pip install .[camb,classy,hmcode2020emu,comet-emu,euclidemu2,pylevin,mpmath,tensorflow,pyinstrument,baccoemu,emantis,pbjcosmo,react]

πŸ’‘ Pro Tip: Some shells struggle with brackets. Try quotes if needed:

pip install ."[camb,classy,hmcode2020emu,comet-emu,euclidemu2,pylevin,mpmath,tensorflow,pyinstrument,baccoemu,emantis,pbjcosmo,react]"

The react extra installs MGEmu together with the TensorFlow support it needs for the ReACT modified-gravity boost module. If you only need that stack, pip install ".[react,camb]" is usually enough to get started.

You're all set! πŸŽ‰ Ready to compute cosmological observables.


πŸ“Š Usage

Explore the tutorials in the cloe-org/playground repository for examples on how to compute cosmological observables and other key quantities!


🀝 Contributing

Please review the organization's general contribution guidelines and the specific guidelines for this repository in the CONTRIBUTING.md file. Once you're familiar with the guidelines, follow these steps:

1️⃣ Create a new branch:

git checkout -b feature/your-feature-name

2️⃣ Implement your changes following project style guidelines.

3️⃣ Commit your modifications:

git commit -m "Add feature: [brief description]"

4️⃣ Push your branch:

git push origin feature/your-feature-name

5️⃣ Open a pull request and contribute to the project!


πŸ“œ License

This project is licensed under the MIT LICENSE – see the LICENSE file for details.


πŸ™ Acknowledgements

πŸ”­ Inspired by the pioneering work of the Euclid Consortium CLOE software and the jaxcosmo project.

πŸ‘©β€πŸ’»πŸ§‘β€πŸ’» Authored by M. Bonici, G. CaΓ±as-Herrera, P. Carrilho, S. Casas, C. Moretti, and A. Pezzotta (listed in alphabetical order).

🎯 With technical advice from S. Farrens and N. Tessore.

🀝 Contributors

This project follows the all-contributors specification. Contributions of any kind are welcome!

Alex Hall
Alex Hall

πŸ› πŸ€” πŸ§‘β€πŸ«
itutusaus
itutusaus

πŸ‘€ πŸ“† πŸ§‘β€πŸ« πŸ“£
Laila Linke
Laila Linke

πŸ’»
David Navarro GironΓ©s
David Navarro GironΓ©s

πŸ“–
stefanodavini
stefanodavini

πŸ’» πŸ“– ⚠️ πŸ€” πŸ”§
Guadalupe CaΓ±as-Herrera
Guadalupe CaΓ±as-Herrera

πŸ’» 🚧 πŸ€” πŸ› πŸ–‹ πŸ”£ πŸ“– πŸš‡ πŸ“† πŸ’¬ ⚠️ πŸ“’
Marco Bonici
Marco Bonici

πŸ’» 🚧 πŸ€” πŸ› πŸ–‹ πŸ“– πŸš‡ πŸ“† πŸ’¬ ⚠️ πŸ“’
Chiara Moretti
Chiara Moretti

πŸ’» 🚧 πŸ€” πŸ› πŸ–‹ πŸ“– πŸ“’
AndreaPezzotta
AndreaPezzotta

πŸ’» 🚧 πŸ€” πŸ› πŸ–‹ πŸ”£ πŸ“– πŸ“’
Santiago Casas
Santiago Casas

πŸ’» 🚧 πŸ€” πŸ‘€ πŸ›
Pedro Carrilho
Pedro Carrilho

πŸ’» 🚧 πŸ€” πŸ› πŸ–‹ πŸ”£ πŸ“– πŸ“’
Nicolas Tessore
Nicolas Tessore

πŸ”§ πŸ§‘β€πŸ« πŸ’» πŸ‘€
Samuel Farrens
Samuel Farrens

πŸ”§ πŸ§‘β€πŸ« πŸ’» πŸ‘€
Jose Coloma Nadal
Jose Coloma Nadal

πŸ› πŸ’» πŸ€”
Casper Vedder
Casper Vedder

πŸ’» πŸ€” πŸ› πŸ‘€
Ben Bose
Ben Bose

πŸ’»
Dida Markovic
Dida Markovic

πŸ€” πŸ’¬
Michel Aguena
Michel Aguena

πŸ’» ⚠️ πŸ€”
Filippo Oppizzi
Filippo Oppizzi

πŸ’» πŸ€” πŸ”§
Jaime RZ
Jaime RZ

πŸ€”
Arthur Loureiro
Arthur Loureiro

πŸ’» πŸ€” πŸ“– πŸ‘€ πŸ›
Pierre Burger
Pierre Burger

πŸ’» πŸ€”
Davide Sciotti
Davide Sciotti

πŸ›
GabrieleParimbelli
GabrieleParimbelli

πŸ›
Zahra Baghkhani
Zahra Baghkhani

πŸ’» πŸ€” πŸ›
Fabrice Roy
Fabrice Roy

πŸ“– πŸ’» πŸ€”
pltaylor16
pltaylor16

πŸ’» πŸ“–
Robert Reischke
Robert Reischke

πŸ€” πŸ§‘β€πŸ«
Angus H. Wright
Angus H. Wright

πŸ€” πŸ§‘β€πŸ«
Matteo Baratto
Matteo Baratto

πŸ’» πŸ€”
Maria Tsedrik
Maria Tsedrik

πŸ’» πŸ€”
Arghavan Souki
Arghavan Souki

πŸ› πŸ“–
Ryusei Kano
Ryusei Kano

πŸ’» πŸ€”
Linus Thummel
Linus Thummel

πŸ’» πŸ“– πŸ€” πŸ‘€
Lisa Goh
Lisa Goh

πŸ’» πŸ“– πŸ€”
zsirap
zsirap

πŸ’» πŸ€” πŸ›
Konstantinos Tanidis
Konstantinos Tanidis

πŸ’»
Chaitanya
Chaitanya

πŸ’» πŸ› πŸ‘€
raphkou
raphkou

πŸ› πŸ’» πŸ€” πŸ“–
Ivan Sladoljev
Ivan Sladoljev

πŸ’» πŸ€”
NastassiaG
NastassiaG

πŸ’» πŸ› πŸ€”
Martin Crocce
Martin Crocce

πŸ“† πŸ§‘β€πŸ« πŸ“£
CarmelitaCarbone
CarmelitaCarbone

πŸ“† πŸ§‘β€πŸ« πŸ“£
Giovanni
Giovanni

πŸ’» πŸ€” πŸ“–
Jeger Broxterman
Jeger Broxterman

πŸ’» πŸ€”
Matthieu Schaller
Matthieu Schaller

πŸ€”
joezuntz
joezuntz

πŸ§‘β€πŸ« πŸ€”
KlaraBertmann
KlaraBertmann

πŸ’» πŸ€”
Anna Porredon
Anna Porredon

πŸ€” πŸ§‘β€πŸ«
emiliobellini
emiliobellini

🚧 πŸ€”
Miguel Zumalacarregui
Miguel Zumalacarregui

🚧 πŸ€”
IΓ±igo SΓ‘ez Casares
IΓ±igo SΓ‘ez Casares

πŸ’» πŸ€”
Neel Shah
Neel Shah

πŸ’» πŸ€” πŸ›
Felicitas Keil
Felicitas Keil

πŸ’» πŸ€”
Jip de Buck
Jip de Buck

πŸ““
Hironao Miyatake
Hironao Miyatake

πŸ€”

About

Library of theoretical model predictions for photometric and spectroscopic large-scale structure observables

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors