principia_materia.io_interface.yaml_dump module
- principia_materia.io_interface.yaml_dump.yaml_dumps(data, prec=8)
Save data in a custom YAML format string.
The official yaml module cannot dump data in a consistent format, this function solves that problem by using a consistent format for various data types. Additionally, data types like numpy.ndarray can be safely saved into YAML nested list format without extra work, making saving YAML file much easier.
- Parameters:
data (dict) – The data to save.
prec (int, optional, default to 8) – The decimal points to round the floating point numbers to.