openpathsampling.engines.DynamicsEngine

class openpathsampling.engines.DynamicsEngine(options=None, descriptor=None)[source]

Wraps simulation tool (parameters, storage, etc.)

on_nan

set the behaviour of the engine when NaN is detected. Possible is

  1. fail will raise an exception EngineNaNError

  2. retry will rerun the trajectory in engine.generate, these moves do not satisfy detailed balance

Type:

str

on_error

set the behaviour of the engine when an exception happens. Possible is

  1. fail will raise an exception EngineError

  2. retry will rerun the trajectory in engine.generate, these moves do not satisfy detailed balance

Type:

str

on_max_length

set the behaviour if the trajectory length is n_frames_max. If n_frames_max == 0 this will be ignored and nothing happens. Possible is

  1. fail will raise an exception EngineMaxLengthError

  2. stop will stop and return the max length trajectory (default)

  3. retry will rerun the trajectory in engine.generate, these moves do not satisfy detailed balance

Type:

str

retries_when_nan

the number of retries (if chosen) before an exception is raised

Type:

int, default: 2

retries_when_error

the number of retries (if chosen) before an exception is raised

Type:

int, default: 2

retries_when_max_length

the number of retries (if chosen) before an exception is raised

Type:

int, default: 0

on_retry

the behaviour when a try is started. Since you have already generated some trajectory you might not restart completely. Possibilities are

  1. full will restart completely and use the initial frames (default)

  2. keep_half will cut the existing in half but keeping at least the initial

  3. remove_interval will remove as many frames as the interval

  4. a callable will be used as a function to generate the new from the old trajectories, e.g. lambda t: t[:10] would restart with the first 10 frames

Type:

str or callable

Notes

Should be considered an abstract class: only its subclasses can be instantiated.

__init__(options=None, descriptor=None)[source]

Create an empty DynamicsEngine object

Notes

The purpose of an engine is to create trajectories and keep track of the results. The main method is ‘generate’ to create a trajectory, which is a list of snapshots and then can store the in the associated storage. In the initialization this storage is created as well as the related Trajectory and Snapshot classes are initialized.

Methods

__init__([options, descriptor])

Create an empty DynamicsEngine object

args()

Return a list of args of the __init__ function of a class

base()

Return the most parent class actually derived from StorableObject

check_snapshot_type(snapshot)

count_weaks()

Return number of objects subclassed from StorableObject still in memory

descendants()

Return a list of all subclassed objects

fix_name()

Set the objects name to be immutable.

from_dict(dct)

Reconstruct an object from a dictionary representaiton

generate(snapshot[, running, direction])

Generate a trajectory consisting of ntau segments of tau_steps in between storage of Snapshots.

generate_n_frames([n_frames])

Generates n_frames, from but not including the current snapshot.

generate_next_frame()

get_uuid()

idx(store)

Return the index which is used for the object in the given store.

is_valid_snapshot(snapshot)

Test the snapshot to be valid.

iter_generate(initial[, running, direction, ...])

Return a generator that will generate a trajectory, returning the current trajectory in given intervals

named(name)

Name an unnamed object.

objects()

Returns a dictionary of all storable objects

reverse_uuid()

ruuid(uid)

set_as_default()

set_observer(active)

(De-)Activate observing creation of storable objects

start([snapshot])

stop(trajectory)

Nothing special needs to be done for direct-control simulations when you hit a stop condition.

stop_conditions(trajectory[, ...])

Test whether we can continue; called by generate a couple of times, so the logic is separated here.

to_dict()

Convert object into a dictionary representation

Attributes

ACTIVE_LONG

BACKWARD

CREATION_COUNT

FORWARD

INSTANCE_UUID

base_cls

Return the base class

base_cls_name

Return the name of the base class

clear_snapshot_cache

cls

Return the class name as a string

current_snapshot

default_name

Return the default name.

default_options

dimensions

is_named

True if this object has a custom name.

name

Return the current name of the object.

observe_objects

units