DiscreteMicrogridEnv.dump#

DiscreteMicrogridEnv.dump(stream=None)[source]#

Save a microgrid to a YAML buffer.

Supports both strings of YAML or storing YAML in a path-like object.

Parameters#

streamfile-like object or None, default None

Stream to save the YAML document. If None, returns the document instead.

Returns#

str or None :

Returns the YAMl document as a string if stream=None. Returns None otherwise

Note

dump handles the serialization of array-like objects (e.g. time series and logs) differently depending on the value of stream. If stream is None, array-like objects are serialized inline. If stream is a stream to a file-like object, however, array-like objects will be serialized as .csv.gz files in a directory relative to stream, and the relative locations stored inline in the YAML file. For an example of this behavior, see data/scenario/pymgrid25/microgrid_0.