Skip to main content

cosmicjellyfish

CosmicJellyfish: Fisher and Monte Carlo cosmological forecasts with Python and JAX

Documentation PyPI Python versions codecov CI Code style: black

All Contributors CRediT 37.50 % FAIR OpenSSF Best Practices fair-software.eu

cosmicjellyfish is a Python package for cosmological Fisher forecasts. It helps prepare and compare forecasts for galaxy surveys such as Euclid, DESI, SKAO and CMB experiments, such as Planck and SPT.

Validation data

Published validation results, posterior chains and HPC workflows live in the public cjfp-data repository on DagsHub. See the download and workflow guide for targeted DVC downloads and instructions to run the comparisons.

Features

  • Observables. Photometric (GCph, WL) and spectroscopic (GCsp) galaxy clustering and weak lensing, CMB (CMB_T, CMB_E, CMB_B) and HI intensity mapping (IM).
  • Backends. CAMB, CLASS, a built-in symbolic backend that needs no Einstein-Boltzmann solver, optional JAXcosmo, or precomputed tables.
  • Derivatives. Four finite-difference schemes (3PT, STEM, POLY, 4PT_FWD), chosen with one option.
  • Automatic differentiation. With the optional jaxcosmo extra, photometric and spectroscopic observables are differentiated with JAX, and can be compared against finite differences.
  • Analysis and plots. Marginalise, reshuffle and combine Fisher matrices, and draw triangle plots to compare surveys and settings.
  • Likelihood sampling. Sample the full posterior of the photometric and spectroscopic likelihoods with Nautilus and compare it with the Fisher forecast.

Installation

cosmicjellyfish supports Python >=3.10,<3.13.

pip install cosmicjellyfish

The symbolic backend additionally needs symbolic_pofk, which is not on PyPI. Install it with

pip install git+https://github.com/DeaglanBartlett/symbolic_pofk.git

To work from a source checkout, use uv:

git clone https://github.com/santiagocasas/cosmicjellyfish.git
cd cosmicjellyfish
uv sync --extra dev

Prefer mamba/conda? From a checkout, mamba env create -f environment.yml builds a conda-forge environment called cosmicjellyfish with everything installed.

Check the installation with

python -c "import cosmicjellyfish; print('cosmicjellyfish import OK')"

and, from a source checkout, run the tests with uv run pytest. Conda setup, optional extras and more are in the installation guide.

Minimal example

A photometric forecast with the symbolic backend (requires symbolic_pofk, see above). It needs no solver setup and runs in a few seconds from any directory, writing its output to results/:

from cosmicjellyfish.fishermatrix import cosmicfish as cff

options = {
    "feedback": 1,
    "code": "symbolic",  # or "class" / "camb"
    "cosmo_model": "LCDM",
    "outroot": "first_forecast",
    "results_dir": "results",
    "survey_name": "Euclid",
    "survey_name_photo": "Euclid-Photometric-ISTF-Pessimistic",
}

fiducial = {"Omegam": 0.32, "h": 0.67}
freepars = {"Omegam": 0.01, "h": 0.01}  # relative finite-difference steps

forecast = cff.FisherMatrix(
    fiducialpars=fiducial,
    freepars=freepars,
    options=options,
    observables=["WL", "GCph"],
    cosmoModel=options["cosmo_model"],
    surveyName=options["survey_name"],
)

fisher = forecast.compute()
print(fisher.fisher_matrix.shape, fisher.get_param_names())

Documentation

To build the documentation locally:

uv sync --extra docs
make docs   # live-reloading server at http://127.0.0.1:8000

CI builds the docs with warnings treated as errors:

uv run --extra docs sphinx-build -W --keep-going -b html docs/source docs/build/html

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Sefa Pamuk
Sefa Pamuk

💻 🎨 🤔 ⚠️ 🔬 👀 📓 💡 📖 🖋 🐛
Santiago Casas
Santiago Casas

🐛 🖋 🔣 📖 💡 🤔 🚧 📆 🔬 👀 ⚠️ ✅ 📓
Matteo Martinelli
Matteo Martinelli

💻 🎨 🤔
Sabarish
Sabarish

🤔 💻 📖
koyamak
koyamak

🤔 🧑‍🏫 🐛 📓
Francesco Pace
Francesco Pace

💻 🎨
noefrusciante
noefrusciante

💻
domenicosapone
domenicosapone

💻 🤔 🧑‍🏫 📖
Matías Leizerovich
Matías Leizerovich

💻 🤔 ⚠️ 📓
emiliobellini
emiliobellini

💻 🤔 🔣
Stefano Camera
Stefano Camera

🔣 🎨 🤔 🔬

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

Metadata

Release files for cosmicjellyfish 2.1.0

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

Source distribution (sdist)

Source distribution for cosmicjellyfish 2.1.0
File Size Uploaded Provenance Actions
cosmicjellyfish-2.1.0.tar.gz 257.4 kB With provenance Details for cosmicjellyfish-2.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 572.4 kB

Release files / cosmicjellyfish-2.1.0.tar.gz

Download URL cosmicjellyfish-2.1.0.tar.gz
Size 257.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6936cdfff10069a8e338994004335f635e19b7a7674cd945e62574760ae6995d
BLAKE2b-256 checksum
How to use checksums
4948fb3baa7e333a4a68a48c2e0cf0253390121271e65072ed364c9127b2ec9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 27, 2026.

Transparency log

Release files / cosmicjellyfish-2.1.0-py3-none-any.whl

Download URL cosmicjellyfish-2.1.0-py3-none-any.whl
Size 315.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
555c5107af39e13d5381e4cd6c30f201667286a5024a818d6dfe3b05ed3ce551
BLAKE2b-256 checksum
How to use checksums
24b8bb31e7ff603e976cc69f5ef4004ea87cb0bf1af72a39fa07c732d0aefd8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 27, 2026.

Transparency log

Security for cosmicjellyfish 2.1.0

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 cosmicjellyfish-2.1.0.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 Nov 27, 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

2.1.0 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