Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

aspire-bilby

Interface between aspire and bilby.

Installation

aspire-bilby is available via pypi:

pip install aspire-bilby

Usage in bilby

aspire can be used just like any other sampler in bilby and supports multiprocessing via the n_pool keyword argument.

bilby.run_sampler(
    sampler="aspire",
    n_samples=1000,
    n_final_samples=None,  # Optional, final number of samples to produce
    sample_kwargs=dict(
        sampler="smc"
    ),
    fit_kwargs=dict(
        n_epochs=100,
    ),
    n_pool=4,
)

Using a set of samples

from aspire.samples import Samples

initial_samples = Samples(...)  # Define initial samples

bilby.run_sampler(
    sampler="aspire",
    initial_samples=initial_samples,
    ...
)

Using a bilby result file

bilby.run_sampler(
    sampler="aspire",
    initial_result_file="<path to bilby result file>"
    ...,
)

Sampling from the prior

bilby.run_sampler(
    sampler="aspire",
    n_initial_samples=5000,  # Number of samples to draw from the prior, defaults to 10,000 if not specified
    ...,
)

Using bilby objects with aspire

aspire-bilby also provides functions for converting bilby likelihood and prior objects into

import bilby
from aspire import Aspire
from aspire_bilby.utils import samples_from_bilby_result, get_aspire_functions

likelihood = ...    # Define bilby likelihood
priors = ...        # Define bilby priors

result = bilby.core.utils.read_in_result(...)    # Read in bilby result

functions = get_aspire_functions(
    likelihood,
    priors,
    parameters=priors.non_fixed_keys,
)

initial_samples = samples_from_bilby_result(result)

aspire = Aspire(
    log_likelihood=functions.log_likelihood,
    log_prior=functions.log_prior,
    dims=len(initial_samples.parameters),
)

history = aspire.fit(initial_samples)

Usage in bilby_pipe

aspire can be used with bilby_pipe as you would any other sampler:

sampler = "aspire"
sampler_kwargs = {
    "initial_result_file": "path_to_file",
    "sample_kwargs": {...},
    "fit_kwargs": {...},
}

If using transfer files, you may also need to add the initial result file to the additional-transfer-paths.

Metadata

Release files for aspire-bilby 0.1.0a8

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

Source distribution (sdist)

Source distribution for aspire-bilby 0.1.0a8
File Size Uploaded
aspire_bilby-0.1.0a8.tar.gz 20.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aspire-bilby 0.1.0a8
File Interpreter ABI Platform
aspire_bilby-0.1.0a8-py3-none-any.whl Python 3 none any Details

Total release size: 33.4 kB

Release files / aspire_bilby-0.1.0a8.tar.gz

Download URL aspire_bilby-0.1.0a8.tar.gz
Size 20.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6f32d12f3830edbe5e4e87ca24c744529038eb5f6660c9e101cda5925f64c1b7
BLAKE2b-256 checksum
How to use checksums
9e109f533d14e09a7de2a9d9c1472b0ae9225d6865876a0cedc1ead5229a4a09
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 Jun 23, 2026.

Transparency log

Release files / aspire_bilby-0.1.0a8-py3-none-any.whl

Download URL aspire_bilby-0.1.0a8-py3-none-any.whl
Size 13.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d8d000a10e510185d6841721a34d9f9c7241dc3651cbac862efbeb69723f6a27
BLAKE2b-256 checksum
How to use checksums
f1da8981117830f9520d3304d2e45fdeb340445ff2771be9c250af877fe3b453
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 Jun 23, 2026.

Transparency log
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