LocalFileStorage

class propertyestimator.storage.LocalFileStorage(root_directory='stored_data')[source]

A storage backend which stores files in directories on the local disk.

__init__(root_directory='stored_data')[source]

Constructs a new PropertyEstimatorStorage object.

Methods

__init__([root_directory])

Constructs a new PropertyEstimatorStorage object.

has_force_field(force_field)

Checks whether the force field has been previously stored in the force field directory.

retrieve_force_field(unique_id)

Retrieves a force field from storage, if it exists.

retrieve_simulation_data(substance[, …])

Retrieves any data that has been stored for a given substance.

retrieve_simulation_data_by_id(unique_id)

Attempts to retrieve a storage piece of simulation data from it’s unique id.

store_force_field(force_field)

Store the force field in the cached force field directory.

store_simulation_data(data_object, …)

Store the simulation data.

Attributes

root_directory

Returns the directory in which all stored objects are located.

property root_directory

Returns the directory in which all stored objects are located.

Type

str

store_simulation_data(data_object, data_directory)[source]

Store the simulation data.

Notes

If the storage system already contains equivalent information (i.e data stored for the same substance, thermodynamic state and parameter set) then the data will be merged according to the data objects merge method.

Parameters
  • data_object (BaseStoredData) – The data object being stored.

  • data_directory (str) – The directory which stores files associated with the data object such as trajectory files.

Returns

The unique id of the stored data.

Return type

str

retrieve_simulation_data_by_id(unique_id)[source]

Attempts to retrieve a storage piece of simulation data from it’s unique id.

Parameters

unique_id (str) – The unique id assigned to the data.

Returns

  • BaseStoredData – The stored data object.

  • str – The path to the data’s corresponding directory.

retrieve_simulation_data(substance, include_component_data=True, data_class=<class 'propertyestimator.storage.dataclasses.StoredSimulationData'>)[source]

Retrieves any data that has been stored for a given substance.

Parameters
  • substance (Substance) – The substance to check for.

  • include_component_data (bool) – If the substance if a mixture where has multiple components and include_component_data is True, data will be returned for both the mixed system, and for the individual components, otherwise only data for the mixed system will be returned.

  • data_class (subclass of BaseStoredData) – The type of data to retrieve.

Returns

A dictionary of the stored data objects and their corresponding directory paths partitioned by substance id.

Return type

dict of str and tuple of BaseStoredData and str

has_force_field(force_field)

Checks whether the force field has been previously stored in the force field directory.

Parameters

force_field (ForceField) – The force field to check for.

Returns

None if the force field has not been cached, otherwise the unique id of the cached force field.

Return type

str, optional

retrieve_force_field(unique_id)

Retrieves a force field from storage, if it exists.

Parameters

unique_id (str) – The unique id of the force field to retrieve

Returns

The force field if present in the storage system with the given key, otherwise None.

Return type

openforcefield.typing.engines.smirnoff.ForceField, optional

store_force_field(force_field)

Store the force field in the cached force field directory.

Parameters

force_field (openforcefield.typing.engines.smirnoff.ForceField) – The force field to store.

Returns

The unique id of the stored force field.

Return type

str