Skip to content

ENH: Add support for sampler plugins

Inspired by how asimov handles new pipelines, I thought we should support adding samplers via a plugin interface.

This would allow users to add support without having to edit bilby itself. This has various advantages, including allowing sampler interfaces to change independently of bilby.

Usage

An external sampler will provide an entry point, e.g. in a pyproject.toml.

[project.entry-points."bilby.samplers"]
mysampler = "mysampler.plugins.bilby:MySampler"

The code will then check for these entry points and add them to the IMPLEMENTED_SAMPLERS dictionary. The user can then call them as they would any other sampler.

To-Do

  • Documentation
  • Unit tests
  • Implement a sampler to test this (all the samplers use entry points now)
Edited by Michael Williams

Merge request reports