Skip to main content

nessai-bilby

Interface and plugin for using nessai in bilby.

This plugin provides two samplers that can be used in bilby:

  • nessai: the standard nested sampler from nessai
  • inessai: the importance nested sampler from nessai

It also provides a means to use bilby likelihoods and priors directly in nessai, see using bilby likelihoods in nessai

Installation

The package can be installed using pip

pip install nessai-bilby

or conda

conda install conda-forge::nessai-bilby

However, we recommend following installing PyTorch manually to ensure the correct device support.

Note: this plugin requires "bilby>=2.3.0".

Usage

In bilby

One nessai-bilby is installed, both samplers can be used directly in bilby via the run_sampler function. See the bilby documentation for more details on how to run different samplers.

Using bilby likelihoods in nessai

nessai-bilby also provides two model classes that allow bilby likelihood and priors to be used directly with nessai:

  • nessai_bilby.model.BilbyModel:
  • nessai_bilby.model.BilbyModelLikelihoodConstraint:

Either model can be used by creating an instance of the model and running nessai as usual:

from nessai.flowsampler import FlowSampler
from nessai_bilby.model import BilbyModel

likelihood = ...    # bilby likelihood object
priors = ... # bilby PriorDict

model = BilbyModel(
    priors=priors,
    likelihood=likelihood,
    use_ratio=True    # Whether to use the log-likelihood ratio
)

fs = FlowSampler(
    model,
    ...,
)

fs.run()

Citing

If you use nessai-bilby, please cite the nessai and bilby code bases and the corresponding papers.

Metadata

Release files for nessai-bilby 0.3.2

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

Source distribution (sdist)

Source distribution for nessai-bilby 0.3.2
File Size Uploaded
nessai_bilby-0.3.2.tar.gz 15.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nessai-bilby 0.3.2
File Interpreter ABI Platform
nessai_bilby-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 24.8 kB

Release files / nessai_bilby-0.3.2.tar.gz

Download URL nessai_bilby-0.3.2.tar.gz
Size 15.8 kB
Tags Source
SHA-256 checksum
How to use checksums
fa24116afda51b2b9ede156a00ad8cda716789a014421b43180c6fbf43fc2b6e
BLAKE2b-256 checksum
How to use checksums
ee72efa802379d80ef507a9910b446939231bfd20f9aa86773a30445184b44ab
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 Oct 8, 2026.

Transparency log

Release files / nessai_bilby-0.3.2-py3-none-any.whl

Download URL nessai_bilby-0.3.2-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4fd501a74c8b417df641f1fbfca0c0bcaae5a6bfa5e370e5b925a379be1079a1
BLAKE2b-256 checksum
How to use checksums
59ad6d9c82678fb087de7a19e071135444ee44b6bb3c5275cd6da670660caa9a
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 Oct 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

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