## Submodules¶

class adaptivemd.engine.engine.Engine[source]

Bases: adaptivemd.generator.TaskGenerator

An generator for trajectory simulation tasks

classmethod from_dict(dct)[source]
to_dict()[source]
run(target)[source]

Create a task that returns a trajectory given in the input

Parameters: target (Trajectory) – location of the created target trajectory the task object containing the job description Task
extend(target, length)[source]

Create a task that extends a trajectory given in the input

Parameters: target (Trajectory) – location of the target trajectory to be extended length (int) – number of additional frames to be computed the task object containing the job description Task
add_output_type(name, filename=None, stride=1, selection=None)[source]

Add an output type for a trajectory kind to be generated by this engine

Parameters: name (str) – the name to call the output type by filename (str) – a filename to be used for this output type stride (int) – the stride used by this particular trajectory relative to the native steps of the engine. selection (str) – an mdtraj.Topology.select type filter string to store only a subset of atoms
native_stride

The least common multiple stride of all generated trajectories.

If you want consistent trajectory length your simulation length need to be multiples of this number. The number is relative to the native time steps

Returns: the lcm stride relative to the engines timesteps int
full_strides

list of strides for trajectories that have full coordinates

this is useful to figure out from which frames you can restart a new trajectory. Usually you only have a single one with full frames.

Returns: the list of strides for full trajectories list of int
adaptivemd.engine.engine.gcd(a, b)[source]

Return greatest common divisor using Euclid’s Algorithm.

adaptivemd.engine.engine.lcm(a, b)[source]

Return lowest common multiple.

adaptivemd.engine.engine.lcmm(*args)[source]

Return lcm of args.

class adaptivemd.engine.engine.Trajectory(location, frame, length, engine=None)[source]

Bases: adaptivemd.file.File

Represents a trajectory File on the cluster

Variables: location (str or File) – the File location frame (Frame or File) – the initial frame used for the trajectory length (int) – the length of the trajectory in frames engine (Engine) – the engine used to create the trajectory
engine
clone()[source]
pick()[source]

Return a random frame from all possible full frames

Returns: the frame you can restart from Frame
is_folder
file(f)[source]

Return a file location to a file inside the trajectory folder

Parameters: f (str or OutputTypeDescription) – the filename to be appended to the trajectories directory the object containing the location File
run()[source]

Return a task to run this engine

Returns: the task object that can be submitted to the queue Task
extend(length)[source]

Get a task to extend this trajectory if the engine is set

Parameters: length (int or list of int) – the length to extend by as a single int or a list of ints the task object to extend the trajectory Task
outputs(outtype)[source]

Get a location to the file containing the output by given name

Parameters: outtype (str or OutputTypeDescription) – the name of the outputtype as str or the full description object a file location that points to the concrete file that contains the data for a particular output type File
types

Return the OutputTypeDescriptions for this trajectory

Returns: dict str – the output description dict of the engine OutputTypeDescription
existing_frames
Returns: a sorted list of frame indices with full coordinates that can be used for restart. relative to the engines timesteps list of int
class adaptivemd.engine.engine.Frame(trajectory, index)[source]

Represents a frame of a trajectory

Variables: trajectory (Trajectory) – the origin trajectory index (int) – the frame index staring from zero
index_in_outputs

Return output type and effective frame index for this frame

Returns: str – the name of the output type int – the effective index within this trajectory obeying the trajectories own stride
exists
Returns: if True there is a concrete trajectory file with full coordinates for this frame bool
class adaptivemd.engine.engine.TrajectoryGenerationTask(generator=None, trajectory=None)[source]

Bases: adaptivemd.task.Task

A task that will generate a trajectory

extend(length)[source]

Extend the trajectory that was generated by this task

Parameters: length (int) – the number of frames resp to native engine timesteps a task to extend the current trajectory Task
class adaptivemd.engine.engine.TrajectoryExtensionTask(generator=None, trajectory=None, source=None)[source]

A task that generates a trajectory out of a source trajectory

ready
class adaptivemd.engine.engine.OutputTypeDescription(filename=None, stride=1, selection=None)[source]

A description of a general trajectory type

Variables: filename (str) – a filename to store these type of trajectory in stride (int) – the stride to be used relative to native engine timesteps selection (str) – a mdtraj.Topolopgy.select() like selection of an atom subset