cosmicjellyfish
cosmicjellyfish is a Python package for cosmological Fisher forecasts. It helps prepare and compare forecasts for surveys such as Euclid, DESI, SKAO and CMB experiments.
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
symbolicbackend 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
jaxcosmoextra, 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 = {
"accuracy": 1,
"feedback": 1,
"code": "symbolic", # or "class" / "camb"
"cosmo_model": "LCDM",
"derivatives": "3PT",
"ell_sampling": 25, # coarse grid for speed, not production accuracy
"nonlinear": True,
"outroot": "first_forecast",
"results_dir": "results",
"survey_name": "Euclid",
"survey_name_photo": "Euclid-Photometric-ISTF-Pessimistic",
"survey_name_spectro": False,
}
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
- Documentation: getting started, user guide, tutorials, API reference and development notes.
- Validation dashboard
- Citation metadata (
CITATION.cff)
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 💻 🎨 🤔 ⚠️ 🔬 👀 📓 💡 📖 🖋 🐛 |
Santiago Casas 🐛 🖋 🔣 📖 💡 🤔 🚧 📆 🔬 👀 ⚠️ ✅ 📓 |
Matteo Martinelli 💻 🎨 🤔 |
Sabarish 🤔 💻 📖 |
This project follows the all-contributors specification. Contributions of any kind are welcome.
Metadata
Release files for cosmicjellyfish 2.0.0
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 |
|---|---|---|---|---|
| cosmicjellyfish-2.0.0.tar.gz | 230.9 kB | With provenance | Details for cosmicjellyfish-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cosmicjellyfish-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for cosmicjellyfish-2.0.0-py3-none-any.whl |
Total release size: 508.4 kB
Release files / cosmicjellyfish-2.0.0.tar.gz
| Download URL | cosmicjellyfish-2.0.0.tar.gz |
|---|---|
| Size | 230.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
93923fd6ea69305769e285c9a35d53ff01da777fcc7d6d038f3abe28c30254d8
|
|
BLAKE2b-256 checksum How to use checksums |
60779b5dc90d6e4b99fedd27fe9b5ee6b9b545541fc1f2734c27138573434e54
|
| 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 12, 2026.
Transparency logRelease files / cosmicjellyfish-2.0.0-py3-none-any.whl
| Download URL | cosmicjellyfish-2.0.0-py3-none-any.whl |
|---|---|
| Size | 277.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fe2e27dcf8c69405df4237123f53f6274078fe930d6508663e4894305d5368a5
|
|
BLAKE2b-256 checksum How to use checksums |
3a27c4e4b79f5064e7768426f229cb54b754e6d6bd60ef7d6fbc966df0910c3c
|
| 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 12, 2026.
Transparency logSecurity for cosmicjellyfish 2.0.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.
Attestation for cosmicjellyfish-2.0.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 12, 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.