pyrevs.runner

Submodules

Classes

RunnerConfig

Runner configuration.

Functions

make_runner(→ BaseRunner)

Factory that instantiates a configured runner.

ms_worker(→ pyrevs.trajectory.Trajectory)

A worker to restart trajectories.

pool_worker(→ pyrevs.trajectory.Trajectory)

A worker to generate each initial trajectory.

Package Contents

class RunnerConfig[source]

Runner configuration.

type: str = 'asyncio'
nworkers: int = 1
dask_config: DaskConfig
make_runner(runner_cfg: pyrevs.runner.config.RunnerConfig, worker_fn: collections.abc.Callable, loglevel: str = 'INFO', logfile: str | None = None, max_workers: int = -1) BaseRunner[source]

Factory that instantiates a configured runner.

Parameters:
  • runner_cfg – a config mapping for the runner

  • worker_fn – a worker function

  • loglevel – logging level

  • logfile – logging file

  • max_workers – maximum number of workers

ms_worker(from_traj: pyrevs.trajectory.Trajectory, rst_traj: pyrevs.trajectory.Trajectory, min_val: float, new_weight: float, termination_criteria: list[pyrevs.strategies.base.TerminationCriterion], end_date: datetime.date, trajdb_path: str | None = None, db_path: str | None = None) pyrevs.trajectory.Trajectory[source]

A worker to restart trajectories.

Parameters:
  • from_traj – a trajectory to restart from

  • rst_traj – the trajectory being restarted

  • min_val – the value of the score function to restart from

  • new_weight – the weight of the new child trajectory

  • termination_criteria – a list of termination criterion for the advance call

  • end_date – the time limit to advance the trajectory

  • trajdb_path – a path to the SQL database

  • db_path – an optional path to the run database

pool_worker(traj: pyrevs.trajectory.Trajectory, termination_criteria: list[pyrevs.strategies.base.TerminationCriterion], end_date: datetime.date, trajdb_path: str | None = None, db_path: str | None = None) pyrevs.trajectory.Trajectory[source]

A worker to generate each initial trajectory.

Parameters:
  • traj – a trajectory

  • termination_criteria – a list of termination criterion for the advance call

  • end_date – the time limit to advance the trajectory

  • trajdb_path – an optional path to the SQL database

  • db_path – an optional path to the run database

Returns:

The updated trajectory