pyiron_base.interfaces.has_dict

pyiron_base.interfaces.has_dict#

Interface for classes to serialize to dictionary.

This also contains classes to ease the transition from HDF based storage to dict based serialization. Roughly we want to proceed as follows:

1. Any new object directly implements HasDict and derives from HasHDFfromDict to be compatible to older code that still relies on the HDF interface. 2. Any old object that doesn’t yet directly implements HasDict can trivially derive from HasDictfromHDF to be compatible to newer code that uses the dict based serialization. 3. Step by step we can transition old objects to directly implement HasDict.

Functions

create_from_dict(obj_dict)

Create and restores an object previously written as a dictionary.

Classes

HasDict()

Abstract interface to convert objects to dictionaries for storage.

HasDictfromHDF()

Implements HasDict in terms of HasHDF.

HasHDFfromDict()

Implements HasHDF in terms of HasDict.