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.

This module functions as a plug-in for ruamel.yaml, specified by typ='stonesoup', but for convenience it is recommended to use YAML which defaults with the plug-in enabled.

It is also possible to extend the serialisation for other types with Stone Soup, via stonesoup.serialise.yaml entry point, typically expected to be used with stonesoup.plugins. The entry point should point to a function which expects a single argument, a ruamel.yaml.YAML instance.

For example:

setup(
    ...
    entry_points={
        'stonesoup.plugins': 'my_plugin = my_package',
        'stonesoup.serialise.yaml': 'my_plugin = my_package:yaml_init_func}
    ...
)
class stonesoup.serialise.YAML(**kwargs)[source]

Class for YAML serialisation in Stone Soup.

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

Return as a string.