openpathsampling.engines.SnapshotDescriptor
- class openpathsampling.engines.SnapshotDescriptor(contents)[source]
Container for information about snapshots generated by an engine.
Snapshot descriptors are used to define the dimensions of the features used in a snapshot, in order to set correct sizes in storage. For example, the arrays of atomic positions and velocities will each be of shape
(n_atoms, n_spatial). The snapshot descriptor stores the values ofn_atomsandn_spatial. It also knows the class of snapshot to be created by the engine. This is usually created upon initialization of the engine, using information from the engine’s initialization parameters.In practice, it is probably easiest to create snapshot descriptors using their
construct()method.- Parameters:
contents (list of 2-tuples) – Key-value pairs for information to be stored. One must be the key ‘class’, mapped to a snapshot class.
Methods
__init__(contents)args()Return a list of args of the __init__ function of a class
base()Return the most parent class actually derived from StorableObject
construct(snapshot_class, snapshot_dimensions)Convenience method to create a snapshot descriptor.
copyReturn a shallow copy of a set.
count_weaks()Return number of objects subclassed from StorableObject still in memory
descendants()Return a list of all subclassed objects
differenceReturn the difference of two or more sets as a new set.
from_dict(dct)Reconstruct an object from a dictionary representaiton
get_uuid()idx(store)Return the index which is used for the object in the given store.
intersectionReturn the intersection of two sets as a new set.
isdisjointReturn True if two sets have a null intersection.
issubset(other, /)Test whether every element in the set is in other.
issuperset(other, /)Test whether every element in other is in the set.
objects()Returns a dictionary of all storable objects
reverse_uuid()ruuid(uid)set_observer(active)(De-)Activate observing creation of storable objects
symmetric_differenceReturn the symmetric difference of two sets as a new set.
to_dict()Convert object into a dictionary representation
unionReturn the union of sets as a new set.
Attributes
ACTIVE_LONGCREATION_COUNTINSTANCE_UUIDbase_clsReturn the base class
base_cls_nameReturn the name of the base class
clsReturn the class name as a string
dimensionsobserve_objectssnapshot_class