Skip to main content

unxts.interop.numpyro

NumPyro integration for unxt.

The unitful handler lets NumPyro models take unxt quantities. It converts them to plain numbers in a unit system you choose before NumPyro sees them. The model gets its sampled values back as quantities, and attach_units puts the units on the posterior samples.

Install

pip install unxts.interop.numpyro

Usage

import jax
import numpyro
import numpyro.distributions as dist
import unxt as u
from numpyro.infer import MCMC, NUTS
from unxts.interop.numpyro import attach_units, unitful


def model(x=None):
    m = numpyro.sample("m", dist.Normal(u.Q(0.0, "kpc"), u.Q(3.0, "kpc")))
    s = numpyro.sample("s", dist.HalfNormal(u.Q(1.0, "kpc")))
    with numpyro.plate("n", 200):
        numpyro.sample("x", dist.Normal(m, s), obs=x)


x = u.Q(1.0 + 0.2 * jax.random.normal(jax.random.PRNGKey(1), (200,)), "kpc")
M = unitful(model, u.unitsystems.galactic)
mcmc = MCMC(NUTS(M), num_warmup=200, num_samples=200, progress_bar=False)
mcmc.run(jax.random.PRNGKey(0), x)
samples = attach_units(mcmc.get_samples(), M)  # samples["m"] is a Quantity in kpc

Metadata

Release files for unxts.interop.numpyro 2.2.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 unxts.interop.numpyro 2.2.0
File Size Uploaded Provenance Actions
unxts_interop_numpyro-2.2.0.tar.gz 52.0 kB With provenance Details for unxts_interop_numpyro-2.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for unxts.interop.numpyro 2.2.0
File Interpreter ABI Platform Actions
unxts_interop_numpyro-2.2.0-py3-none-any.whl Python 3 none any Details for unxts_interop_numpyro-2.2.0-py3-none-any.whl

Total release size: 70.8 kB

Release files / unxts_interop_numpyro-2.2.0.tar.gz

Download URL unxts_interop_numpyro-2.2.0.tar.gz
Size 52.0 kB
Tags Source
SHA-256 checksum
How to use checksums
527269ed7716071704e6f8aee44ca7e4ee2fda51120061e1c0e90113ccf6329b
BLAKE2b-256 checksum
How to use checksums
f21dc69e556437e0883601d2ebf2267d8b974c19fb22a8a1c7a4eae9f78ff13e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 18, 2026.

Transparency log

Release files / unxts_interop_numpyro-2.2.0-py3-none-any.whl

Download URL unxts_interop_numpyro-2.2.0-py3-none-any.whl
Size 18.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
75889d8f9caf0f84d1d2ccc45e5fd6ddb542e682c3d028bd9ba21ee235af39af
BLAKE2b-256 checksum
How to use checksums
7a726eb2e9ab6125ed763191039c26a15f168cffb51b2b6d42080686bdaea09d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 18, 2026.

Transparency log

Security for unxts.interop.numpyro 2.2.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 unxts_interop_numpyro-2.2.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 18, 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

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