Serialisation

Provides an ability to serialise Stone Soup objects into and from YAML.

Stone Soup utilises YAML for serialisation. The Declarative Base feature of components is exploited in order to store the data of the components and data types.

class stonesoup.serialise.YAML(typ='rt')[source]

Class for YAML serialisation.

dumps(data, *args, **kwargs)[source]

Return as a string.

classmethod yaml_tag(class_)[source]

Return YAML tag for object.

Constructed from module and class name.

classmethod declarative_to_yaml(representer, node)[source]

Convert declarative class instances to YAML.

Store as mapping of declared properties, skipping any which are the default value.

classmethod declarative_from_yaml(constructor, tag_suffix, node)[source]

Convert YAML to declarative class instances.

ndarray_to_yaml(representer, node)[source]

Convert numpy.ndarray to YAML.

static ndarray_from_yaml(constructor, node)[source]

Convert YAML to numpy.ndarray.

classmethod array_from_yaml(constructor, tag_suffix, node)[source]

Convert YAML to numpy.ndarray.

static numpy_int_to_yaml(representer, node)[source]

Convert numpy ints to YAML

static numpy_float_to_yaml(representer, node)[source]

Convert numpy floats to YAML

static timedelta_to_yaml(representer, node)[source]

Convert datetime.timedelta to YAML.

Value is total number of seconds.

static timedelta_from_yaml(constructor, node)[source]

Convert YAML to datetime.timedelta.

Value should be total number of seconds.

static path_to_yaml(representer, node)[source]

Convert path to YAML.

Value is total number of seconds.

static path_from_yaml(constructor, node)[source]

Convert YAML to datetime.timedelta.

Value should be total number of seconds.

static deque_to_yaml(representer, node)[source]

Convert collections.deque to YAML

static deque_from_yaml(constructor, node)[source]

Convert YAML to collections.deque