No project description provided
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aspire_bilby-0.1.0a6.tar.gz.
File metadata
- Download URL: aspire_bilby-0.1.0a6.tar.gz
- Upload date:
- Size: 17.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd0325766777a9a80ea73933e846395f2e49208d29074bb8ed020b0500196b4c
|
|
| MD5 |
a4c7019e070cd2ca5519e36c33e5c28f
|
|
| BLAKE2b-256 |
f0119d74bce0e1ad86996e22c85a94bc4ae551787e033144e47e1583ca22334f
|
Provenance
The following attestation bundles were made for aspire_bilby-0.1.0a6.tar.gz:
Publisher:
publish.yml on mj-will/aspire-bilby
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aspire_bilby-0.1.0a6.tar.gz -
Subject digest:
dd0325766777a9a80ea73933e846395f2e49208d29074bb8ed020b0500196b4c - Sigstore transparency entry: 973410099
- Sigstore integration time:
-
Permalink:
mj-will/aspire-bilby@a15fc5b176a294afbe365b504b7c1fcf8911c8a3 -
Branch / Tag:
refs/tags/v0.1.0a6 - Owner: https://github.com/mj-will
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a15fc5b176a294afbe365b504b7c1fcf8911c8a3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file aspire_bilby-0.1.0a6-py3-none-any.whl.
File metadata
- Download URL: aspire_bilby-0.1.0a6-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c04599213f8d3f91e022e5cdadbcecc275510fd62feeed2620583648146127d7
|
|
| MD5 |
a6326f25a17b3233d5bb09fff22ac513
|
|
| BLAKE2b-256 |
d4cb6aded7b62c61244f2af876cad96bcd5e74563c1227f63843ab5d240ec007
|
Provenance
The following attestation bundles were made for aspire_bilby-0.1.0a6-py3-none-any.whl:
Publisher:
publish.yml on mj-will/aspire-bilby
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aspire_bilby-0.1.0a6-py3-none-any.whl -
Subject digest:
c04599213f8d3f91e022e5cdadbcecc275510fd62feeed2620583648146127d7 - Sigstore transparency entry: 973410104
- Sigstore integration time:
-
Permalink:
mj-will/aspire-bilby@a15fc5b176a294afbe365b504b7c1fcf8911c8a3 -
Branch / Tag:
refs/tags/v0.1.0a6 - Owner: https://github.com/mj-will
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a15fc5b176a294afbe365b504b7c1fcf8911c8a3 -
Trigger Event:
release
-
Statement type: