pathsim.utils.serialization module
- pathsim.utils.serialization.serialize_callable(func)[source]
Serialize a callable with priority for human-readable formats
- Parameters:
func (callable) – function to serialize into dict
- Returns:
serialized function
- Return type:
- pathsim.utils.serialization.serialize_object(obj)[source]
Serialize any object by capturing its module and class
- pathsim.utils.serialization.deserialize(data)[source]
Deserialize an object from dictionary representation
- class pathsim.utils.serialization.Serializable[source]
Bases:
objectMixin that provides automatic serialization based on __init__ parameters and loading/saving to json formatted readable files
- save(path='')[source]
Save the dictionary representation of object to an external file
- Parameters:
path (str) – filepath to save data to
- classmethod load(path='')[source]
Load and instantiate an object from an external file in json format
- Parameters:
path (str) – filepath to load data from
- Returns:
out – reconstructed object from dict representation
- Return type:
obj