Skip to main content

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 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. 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, either from your clone:
pip install .

or directly from PyPI (no clone needed):

pip install cloelib
  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

💻 🤔

Metadata

Release files for cloelib 0.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cloelib 0.11
File Size Uploaded Provenance Actions
cloelib-0.11.tar.gz 353.3 kB With provenance Details for cloelib-0.11.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cloelib 0.11
File Interpreter ABI Platform Actions
cloelib-0.11-py3-none-any.whl Python 3 none any Details for cloelib-0.11-py3-none-any.whl

Total release size: 574.2 kB

Release files / cloelib-0.11.tar.gz

Download URL cloelib-0.11.tar.gz
Size 353.3 kB
Tags Source
SHA-256 checksum
How to use checksums
96b65d6428d17f422ea5f041dc6e22c4c9ff6f067cf025fbf779cb06ef152121
BLAKE2b-256 checksum
How to use checksums
5ed0454d4924574854a223a7af6edc630a7ac3066004495e408c86c77c1bc925
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release files / cloelib-0.11-py3-none-any.whl

Download URL cloelib-0.11-py3-none-any.whl
Size 220.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23233b301d27d1d77df9061a321869440a6f70dad232ae9d42203a57df82e990
BLAKE2b-256 checksum
How to use checksums
0c643ef181629ed8eee22f3b60d5cd6ddbc7fdb79585aa59797a251fbe2fd7ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Security for cloelib 0.11

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cloelib-0.11.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.11 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page