Skip to main content
Pre-release

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

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nessai_bilby-0.1.0rc0.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nessai_bilby-0.1.0rc0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file nessai_bilby-0.1.0rc0.tar.gz.

File metadata

  • Download URL: nessai_bilby-0.1.0rc0.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for nessai_bilby-0.1.0rc0.tar.gz
Algorithm Hash digest
SHA256 2cc5958bd0edd3a4055c9cd571d796a3c4f3b56caa59f3a3b9b2d0d075bf0439
MD5 c18cf744feaaad06794a0c5a7e0e91a9
BLAKE2b-256 87d292a7d9f54a47d5db4a491fe79696efec3e12d11962ccee0b467a23061a84

See more details on using hashes here.

File details

Details for the file nessai_bilby-0.1.0rc0-py3-none-any.whl.

File metadata

File hashes

Hashes for nessai_bilby-0.1.0rc0-py3-none-any.whl
Algorithm Hash digest
SHA256 05b131da5ab95862f6a1f7b0f72b627f3ac3c2c3c127d78b13d3d154be18fae8
MD5 9ceb4fa643970e43c207836a1b4fe3f8
BLAKE2b-256 3f189e41647d941f7be050e93cb55bf55c901ab3f4f96930bdbbea22987e4774

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.1

2 files

0.3.0

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0.post0

2 files

0.1.0

2 files

This release

0.1.0rc0 This release

2 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