Skip to main content

ximinf

Simulation-Based Inference of Cosmological Parameters in JAX using Type Ia Supernovae.

ximinf is a Python package for performing simulation-based inference (SBI) on cosmological parameters using type Ia supernova (SN Ia) data, built on top of JAX for fast, differentiable, and GPU/TPU-accelerated computation.

PyPI Documentation License: GPL v3

Installation

pip install ximinf

Requires Python >= 3.10.

Quickstart

import ximinf

See the documentation for full usage examples covering simulation, training, and inference.

Features

ximinf is organized into five core modules:

  • ximinf.generate_sim — Generates simulated SN Ia datasets. Includes Latin Hypercube Sampling (LHS) of cosmological/nuisance parameters under configurable priors (uniform, gaussian, half-gaussian, log-uniform, exponential, etc.), and per-dataset simulation via skysurvey.
  • ximinf.selection_effects — Tools for injecting realistic observational selection effects (e.g. Malmquist bias) into simulated supernova samples via stochastic magnitude-limited detection.
  • ximinf.nn_train — Training utilities for the neural network classifiers used in the inference step, including loss/accuracy functions, training/validation loops with early stopping, and JAX device setup helpers.
  • ximinf.nn_test — Diagnostics for validating inference quality, notably TARP (Tests of Accuracy with Random Points) coverage statistics computed across parameter groups.
  • ximinf.nn_inference — Neural posterior/likelihood-ratio inference. Builds and runs BlackJAX NUTS samplers over grouped parameter blocks, combining trained neural network outputs with analytic log-priors.

Typical workflow

  1. Simulate — Draw parameter sets with generate_sim.scan_params and generate mock SN Ia samples with generate_sim.simulate_one.
  2. (Optional) Apply selection effects — Use selection_effects.apply_malmquist_bias to emulate realistic detection thresholds.
  3. Train — Train per-group neural classifiers on simulated data with nn_train.train_loop.
  4. Infer — Sample the posterior over cosmological parameters with nn_inference.sample_posterior / nn_inference.inference_loop, using a NUTS kernel built on the trained networks.
  5. Validate — Check calibration of the resulting posteriors with nn_test.compute_ecp_tarp_groups.

License

This project is licensed under the GNU General Public License v3.0 (GPLv3). See LICENSE for details.

Author

Adam Trigui — a.trigui@ip2i.in2p3.fr IP2I Lyon

Metadata

Release files for ximinf 0.0.213

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

Source distribution (sdist)

Source distribution for ximinf 0.0.213
File Size Uploaded Provenance Actions
ximinf-0.0.213.tar.gz 61.5 kB Without provenance Details for ximinf-0.0.213.tar.gz

Built distribution (wheel)

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

Total release size: 120.5 kB

Release files / ximinf-0.0.213.tar.gz

Download URL ximinf-0.0.213.tar.gz
Size 61.5 kB
Tags Source
SHA-256 checksum
How to use checksums
bf44f6714e0d9e782127a6616bbc19b0ebd17ea3fc06af348a837280d93d7d65
BLAKE2b-256 checksum
How to use checksums
4245409e876704ba00ef4156192ac4ab296e18a2c3a712ad53f50c0f3ef14319
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / ximinf-0.0.213-py3-none-any.whl

Download URL ximinf-0.0.213-py3-none-any.whl
Size 59.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1640d52dc9d771d3cda5a57250b0d23d929f9a57d3c4d11a6b0b28ecc08dc749
BLAKE2b-256 checksum
How to use checksums
8c4485d467f09e9b1274a4e7406fe3066e4b650bd09a8921afaef85155d78da5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Security for ximinf 0.0.213

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.0.213 This release

2 release files No 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