pyrevs.sampler

Submodules

Classes

SamplerConfig

Sampler configuration.

RareEventSampler

The top-level interface for rare event sampling.

Functions

build_sampler(→ RareEventSampler)

Instantiate the top-level sampler.

Package Contents

class SamplerConfig[source]

Sampler configuration.

strategy: str = 'ams'
deterministic: bool = False
class RareEventSampler(fmodel_t: Any, runtime_cfg: pyrevs.core.RuntimeConfig, strategy: pyrevs.strategies.base.BaseSamplingStrategy, database: pyrevs.database.Database)[source]

The top-level interface for rare event sampling.

This class provides a user-facing entry point to perform rare event sampling using a specified BaseSamplingStrategy. It is responsible for:

  • Parsing configuration from a TOML input file

  • Initializing logging

  • Instanciating the proper sampling strategy

  • Managing global runtime parameters (e.g., walltime)

  • Setting up the database

  • Running the sampling strategy

Variables:
  • _config (Config) – Configuration parameters parsed from the input file

  • _strategy (BaseSamplingStrategy) – The sampling strategy

The configuration file is also passed to the logging and strategy setup routine.

run() None[source]

Execute the rare event sampling procedure.

This method starts the sampling process by delegating execution to the configured BaseSamplingStrategy.

Notes

This method is typically the main entry point after initialization. At this point, it does not return a value; results are expected to be stored in the database or written to disk by the strategy. Future extensions will allow to perform several runs (possibly in parallel)

property database: pyrevs.database.Database

Access the sampling database.

build_sampler(fmodel_t: Any, a_args: list[str] | None = None) RareEventSampler[source]

Instantiate the top-level sampler.

Parameters:
  • fmodel_t – Forward model type

  • a_args – optional list of options

Returns:

Ready-to-run RareEventSampler