- class openpathsampling.SampleSet(samples, movepath=None)
SampleSet is essentially a list of samples, with a few conveniences. It can be treated as a list of samples (using, e.g., .append), or as a dictionary of ensembles mapping to a list of samples, or as a dictionary of replica IDs to samples. Replica ID has to an integer but it can be negative or zero.
The dictionaries ensemble_dict and replica_dict are conveniences which should be kept consistent by any method which modifies the container. They do not need to be stored.
Current implementation is as an unordered set. Therefore we don’t have some of the convenient tools in Python sequences (e.g., slices). On the other hand, I’m not sure whether that is meaningful here. Since replicas are integers we add slicing/ranges for replicas. In addition we support any iterable as input in __getitem__ an it will return an iterable over the results. This makes it possible to write sset[0:5] to get a list of of ordered samples by replica_id, or sset[list_of_ensembles]. replica_ids can be any number do not have to be subsequent to slicing does not make sense and we ignore it. We will also ignore missing replica_ids. A slice 1:5 will return all existing replica ids >=1 and <5. If you want exactly all replicas from 1 to 4 use sset[xrange(1,5)]
The samples included in this set.
list of Sample
A dictionary with Ensemble objects as keys and lists of Samples as values.
A dictionary with replica IDs as keys and lists of Samples as values
- __init__(samples, movepath=None)
Adds the given sample to this SampleSet, with a new replica ID.
Update by setting samples by replica in the order given
Return a list of args of the __init__ function of a class
Return the most parent class actually derived from StorableObject
Check for missing or extra ensembles in the sampleset
Check that all internal dictionaries are consistent
Return a copy of the sample set where all samples.parents are removed
Return number of objects subclassed from StorableObject still in memory
Return a list of all subclassed objects
Returns the list of ensembles in this SampleSet
Reconstruct an object from a dictionary representaiton
generate_from_trajectories(ensembles, ...[, ...])
Create a SampleSet with as many initial samples as possible.
Return the index which is used for the object in the given store.
Return SampleSet mapping one trajectory to all ensembles.
Returns a dictionary of all storable objects
Return a SampleSet with one trajectory ID per ensemble in ssets
Returns the list of replicas IDs in this SampleSet
Checks that the sample trajectories satisfy their ensembles
(De-)Activate observing creation of storable objects
Convert object into a dictionary representation
Return SampleSet using new_ensembles as ensembles.
Return the base class
Return the name of the base class
Return the class name as a string
Descriptor class to handle proxy objects in attributes