Skip to main content

distmarg

Distance-marginalized gravitational-wave likelihood, ln(L_D / Z_N), in the (rho_mf, v*) basis. It is accurate to about 1e-4 in ln L over the whole parameter space, needs no lookup table, and evaluates in the namespace of its inputs: numpy, JAX (with jit, vmap and grad), torch or CuPy.

pip install distmarg            # pure Python
pip install "distmarg[rust]"    # plus the compiled backend for numpy inputs
import numpy as np
from distmarg import DistanceMarginalization

d = np.geomspace(100, 5000, 4096)
dm = DistanceMarginalization(d, 2 * np.log(d), phase_marginalization=True)
# or DistanceMarginalization.from_bilby_prior(bilby_prior, phase_marginalization=True)
dm.ln_likelihood_ratio(rho_mf=12.0, rho_opt=10.0, d_ref=1000.0)

For JAX, torch or CuPy inputs, set SCIPY_ARRAY_API=1 before SciPy is first imported. With JAX, also enable jax_enable_x64.

The method, accuracy and benchmarks are documented in the repository.

Metadata

Release files for distmarg 0.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 distmarg 0.1.0
File Size Uploaded Provenance Actions
distmarg-0.1.0.tar.gz 29.5 kB With provenance Details for distmarg-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 52.5 kB

Release files / distmarg-0.1.0.tar.gz

Download URL distmarg-0.1.0.tar.gz
Size 29.5 kB
Tags Source
SHA-256 checksum
How to use checksums
15e584cba2ae569ad02660a69293b96a5b1da723cf63e89319867f220435ef64
BLAKE2b-256 checksum
How to use checksums
822b2873cdac7c0c6afba3ce0c2d2decb4737d116d1f9989e35b2b4677d70016
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 Oct 21, 2026.

Transparency log

Release files / distmarg-0.1.0-py3-none-any.whl

Download URL distmarg-0.1.0-py3-none-any.whl
Size 23.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
baabd10f9464be6b76348a9fb1ba7ee87550855047583402a40b5042a10bf303
BLAKE2b-256 checksum
How to use checksums
28f8f73cf661fdb42b1fdb6186eeee9a7ede0af0e9259d96b260219a858adeb8
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 Oct 21, 2026.

Transparency log

Security for distmarg 0.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 distmarg-0.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 Oct 21, 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

0.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