cornetto
Fast, smooth corner plots for MCMC chains.
[!NOTE] Early release - cornetto is built for research use and works well for everyday analysis, but the API may still evolve and some features are still maturing. Feedback and contributions are very welcome.
Cornetto takes a dict[str, array] of posterior samples and produces
publication-ready corner plots. Under the hood it uses
KDExpress - a JAX-based
FFT-KDE library - so contours are smooth and rendering stays fast even at
50k+ samples.
Install
pip install cornetto
Requires Python ≥ 3.10, NumPy, Matplotlib, SciPy, and KDExpress.
Usage
import numpy as np
from cornetto import corner
# data is a plain dict: parameter name → 1-D sample array
data = {
"mass_1": chain["mass_1"], # shape (N_samples,)
"mass_2": chain["mass_2"],
"chi_eff": chain["chi_eff"],
}
fig, axes = corner(
data,
labels={"mass_1": r"$m_1\,[M_\odot]$",
"mass_2": r"$m_2\,[M_\odot]$",
"chi_eff": r"$\chi_{\mathrm{eff}}$"},
truths={"mass_1": 35.6},
chain_labels=["GW200129"],
)
fig.savefig("posterior.pdf", bbox_inches="tight")
Multiple chains (e.g. two events, or prior vs posterior) are just 2-D arrays:
data = {
"mass_1": np.stack([chain_A["mass_1"], chain_B["mass_1"]]), # (2, N)
"mass_2": np.stack([chain_A["mass_2"], chain_B["mass_2"]]),
}
corner(data, chain_labels=["GW150914", "GW190521"])
For fast iteration during analysis, quick_corner skips KDE entirely:
from cornetto import quick_corner
fig, axes = quick_corner(data) # histograms only, sub-second
Documentation
Full guide, API reference, and benchmarks at cornetto.readthedocs.io.
License
MIT - see LICENSE.
Metadata
Release files for cornetto 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cornetto-0.2.2.tar.gz | 40.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cornetto-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 76.8 kB
Release files / cornetto-0.2.2.tar.gz
| Download URL | cornetto-0.2.2.tar.gz |
|---|---|
| Size | 40.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
318b62b126b45523335b820f0fcdff69ef75438a6c11545ef6a663862f257e21
|
|
BLAKE2b-256 checksum How to use checksums |
28e7a7de8f9a83e5bd35eefea509e73bfba9b852a3158259dc9e3c34633f5fee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Apr 22, 2026.
Transparency logRelease files / cornetto-0.2.2-py3-none-any.whl
| Download URL | cornetto-0.2.2-py3-none-any.whl |
|---|---|
| Size | 36.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
19778e0bf90ed2a10d68a4f8044cfe3421c8f7f60671d6ba837331d6f508caae
|
|
BLAKE2b-256 checksum How to use checksums |
39c940c5684f7a82faeae20b3abcfa4ebcf46042819c6725f94808bb04246404
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Apr 22, 2026.
Transparency log