pyrevs.database.extension

A protocol database extension class for specific strategies.

Classes

StrategyDatabaseExtension

A base extension class for specific strategies.

Module Contents

class StrategyDatabaseExtension[source]

Bases: Protocol

A base extension class for specific strategies.

The core database only holds data relative to the model trajectories, as well as accessor and convienience methods to extract trajectory data. This extension class aims at gathering strategy-specific data and methods that belong to a given sampling run database. For instance, the (T)AMS strategy requires keeping track of the weight of the ensemble at each iteration, as well as information about score levels or number of selection/mutations.

The extension can store some data in-memory and the serialize/ deserialize methods are used while checkpointing a sampling run. In addition, if the strategy requires long tables, one can use SQL to store the data (see the AMS strategy for example).

Currently an empty type definition might be extended in the future for pickling purposes.

abstractmethod serialize() → None[source]

Serialize the extension.

abstractmethod deserialize() → None[source]

Deserialize the extension.

abstractmethod get_event_probability() → float[source]

Return the event probability.