Skip to main content

binference

PyPI version Supported Python versions CI status on main Documentation

Population inference from noisy measurements. binference combines per-object likelihoods, posteriors, samples, binned counts, or classifier outputs. Fit the population distribution, quantify its uncertainty, and use it to update each object's posterior.

Quick start · Choose an input · Tutorials · API reference

Install

pip install "binference[plot]"

See the installation guide for supported Python versions and extras.

Fit a population

This example estimates a redshift distribution from measured values and their Gaussian errors. Replace the simulated arrays with your own.

import binference

bins = binference.Bins.linear(0.0, 3.0, 15)
mock = binference.simulate.mock_1d(2000, bins, rng=42)
z_obs, z_err = mock.measurements["mean"], mock.measurements["sigma"]

lk = binference.Likelihoods.from_gaussian(z_obs, bins, z_err)
result = binference.infer(lk, rng=1)
print(result.summary())

Population posteriors for a mock catalogue

Population posteriors for 2,000 simulated objects under a Dirichlet prior (top) and a Gaussian-process prior (bottom). Each panel shows the posterior median, 68% and 95% intervals, the true density (dashed), and the stacked estimate (dotted).

Status, citation, and contributions

Version 0.3.0 is the first beta. The API may change before 1.0. If you use binference in your work, see how to cite it. Contributions follow the contributor guide. binference is released under the MIT License.

Metadata

Release files for binference 0.3.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 binference 0.3.0
File Size Uploaded Provenance Actions
binference-0.3.0.tar.gz 365.0 kB With provenance Details for binference-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 597.3 kB

Release files / binference-0.3.0.tar.gz

Download URL binference-0.3.0.tar.gz
Size 365.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e9fe72dccf05fef22e59197dd346474c33db626115fb17aca0b8a0e5ccc6d499
BLAKE2b-256 checksum
How to use checksums
df07ce17308f35f244efe0b3c0858b5a3d9feaf923b932950d650ba2a079303c
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 / binference-0.3.0-py3-none-any.whl

Download URL binference-0.3.0-py3-none-any.whl
Size 232.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
76d1ca77595edc238f263ef76db43a5494ba41e8826b5bbdd75a7de89f37e7da
BLAKE2b-256 checksum
How to use checksums
7def17c4b2b1d9cef8b51cc35363c05632ff681add750a2dfcdd00a5aebffeeb
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 binference 0.3.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 binference-0.3.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.

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