BaseStoredData¶
-
class
propertyestimator.storage.dataclasses.
BaseStoredData
[source]¶ A base representation of cached data to be stored by a storage backend.
The expectation is that stored data will exist in storage as two parts:
A JSON serialized representation of this class (or a subclass), which contains lightweight information such as the state and composition of the system. Any larger pieces of data, such as coordinates or trajectories, should be referenced by this class as a filename.
A directory like structure (either directly a directory, or some NetCDF like compressed archive) of ancillary files which do not easily lend themselves to be serialized within a JSON object, whose files are referenced by name by the data object.
-
thermodynamic_state
¶ The state at which the data was collected.
- Type
-
provenance
¶ A dictionary containing the provenance information about how this data was generated.
- Type
dict of str and Any
-
force_field_id
¶ The server assigned unique id of the force field parameters used to generate the data.
- Type
Methods
__init__
()Constructs a new BaseStoredData object
can_merge
(other_data)Checks whether this piece of data stores the same amount of compatible information (or more) than another piece of stored data, and hence whether the two can be merged together.
merge
(stored_data_1, stored_data_2)Collapse two pieces of compatible stored data into one.
-
can_merge
(other_data)[source]¶ Checks whether this piece of data stores the same amount of compatible information (or more) than another piece of stored data, and hence whether the two can be merged together.
- Parameters
other_data (BaseStoredData) – The other stored data to compare against.
- Returns
Returns True if this piece of data stores the same amount of information or more than another piece of data, or false if it contains less or incompatible data.
- Return type
-
classmethod
merge
(stored_data_1, stored_data_2)[source]¶ Collapse two pieces of compatible stored data into one.
- Parameters
stored_data_1 (BaseStoredData) – The first piece of stored data.
stored_data_2 (BaseStoredData) – The second piece of stored data.
- Returns
The merged stored data.
- Return type