pathsim.utils.serialization module
- pathsim.utils.serialization.serialize_callable(func)[source]
Serialize a callable (function or lambda) to a dictionary representation.
- Parameters:
func (callable) – Function or lambda to serialize
- Returns:
out – Dictionary representation of the callable
- Return type:
- pathsim.utils.serialization.deserialize_callable(func_dict, global_env=None)[source]
Deserialize a callable from its 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