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!
📖 Table of Contents
- ✨ Features
- 📂 Supported external codes
- 🚀 Installation
- 📊 Usage
- 🤝 Contributing
- 📚 Citation
- 📜 License
- 🙏 Acknowledgements
✨ 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
Protocolsfollowing 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 optimizationpylevin,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 perturbationsFlamingoBaryonResponseEmulator– Required for FLAMINGO baryonic suppression
These are not included in the default installation but can be installed as shown below.
🚀 Installation
Quick Start 🎯
- 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
- Check out the latest release (optional but recommended):
git checkout <latest-tag> # Find tags in "Releases"
- 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
- 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.
- Install backends not available on PyPI – HMcode2020Emu, MGEmu (needed by the
reactmodule) 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!
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)
| 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)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| 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 logRelease 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 logSecurity 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.
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 logA 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.