8000 GitHub - cloe-org/cloelib: Library of theoretical model predictions for photometric and spectroscopic large-scale structure observables Β· GitHub
[go: up one dir, main page]

Skip to content
cloe-orgPublic

About

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

Topics

Resources

Contributing

Stars

45 stars

Watchers

18 watching

Forks

Latest commit

Β 

History

355 Commits

Folders and files

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!

arXiv CI Docs pre-commit Tests: pytest codecov Linting: Ruff Code Style: Prettier Type Checking: ty PyPI version CRediT All Contributors


πŸ“– 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
mochi_class HMCode2020emu NA
mgclass cosmopower-jax NA
NA euclidemu2 NA
NA BACCOemu NA
NA e-MANTIS NA
NA FlamingoBaryonResponseEmulator NA

We do not provide installation support for PBJ.

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)
  • baccoemu – Required for BACCOemu nonlinear and baryonic perturbations
  • FlamingoBaryonResponseEmulator – Required for FLAMINGO baryonic suppression

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.

  2. Install cloelib - Get the core library up and running:

  • Directly from PyPI (no clone needed):
pip install cloelib

or

  • Clone cloelib:
git clone https://github.com/cloe-org/cloelib.git
cd cloelib
  • Check out the latest release (optional but recommended):
git checkout <latest-tag>  # Find tags in "Releases"
  • And install cloelib:
pip install .
  1. Add optional superpowers – Enhance with external dependencies and tools:
pip install .[camb,classy,comet-emu,euclidemu2,pylevin,mpmath,tensorflow,tf-keras,cosmopower-jax,baccoemu,hiclassy,emantis,pbjcosmo,fastpt,react,mgclassy,FlamingoBaryonResponseEmulator]

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

pip install ."[camb,classy,comet-emu,euclidemu2,pylevin,mpmath,tensorflow,tf-keras,cosmopower-jax,baccoemu,hiclassy,emantis,pbjcosmo,fastpt,react,mgclassy,FlamingoBaryonResponseEmulator]"

The react extra installs the TensorFlow support needed by the ReACT modified-gravity boost module; MGEmu itself is installed in step 5.

  1. Install backends not available on PyPI – HMcode2020Emu, MGEmu (needed by the react module) and mochi_class are only distributed from GitHub, so they cannot be declared as extras of a package published on PyPI. Install the ones you need directly:
pip install "HMcode2020Emu @ git+https://github.com/MariaTsedrik/HMcode2020Emu.git"
pip install "MGemu @ git+https://github.com/nebblu/MGEmus.git"
pip install "mochi_classy @ git+https://github.com/mcataneo/mochi_class_public.git@mochi_classy"

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!


πŸ“š Citation

If you use cloelib in your research, please cite the software using the metadata in CITATION.cff. On GitHub, select Cite this repository to copy the citation in APA or BibTeX format.

Other contributions are acknowledged in the contributors section.

πŸ“œ 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

πŸ€”
Martin KΓ€rcher
Martin KΓ€rcher

πŸ’» πŸ€”
Chiara De Leo
Chiara De Leo

πŸ‘€ πŸ§‘β€πŸ« πŸ›
Yu-Ting
Yu-Ting

πŸ’»
Pau Tallada CrespΓ­
Pau Tallada CrespΓ­

πŸ€” πŸ’» πŸ›
Shun-Sheng Li
Shun-Sheng Li

πŸ’» πŸ›
amandinelebrun
amandinelebrun

πŸ‘€
Sankarshana Srinivasan
Sankarshana Srinivasan

πŸ’»
zuzannakr
zuzannakr

πŸ’» 🚧 πŸ› πŸ“–
Guillermo Franco AbellΓ‘n
Guillermo Franco AbellΓ‘n

πŸ’» πŸ€”
Giorgio Francesco Lesci
Giorgio Francesco Lesci

πŸ’» πŸ€”
AlessandraFumagalli
AlessandraFumagalli

πŸ’» πŸ€”
MCostanzi
MCostanzi

πŸ’» πŸ€”

About

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

Topics

Resources

Contributing

Stars

45 stars

Watchers

18 watching

Forks

Releases

Packages

Used by

Contributors

Languages

0