LoadModule.dump#
- LoadModule.dump(stream=None)[source]#
Save a module 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. Otherwise, returns None.
Note
dumphandles the serialization of array-like objects (e.g. time series and logs) differently depending on the value ofstream. Ifstream is None, array-like objects are serialized inline. Ifstreamis a stream to a file-like object, however, array-like objects will be serialized as .csv.gz files in a directory relative tostream, and the relative locations stored inline in the YAML file. For an example of this behavior, see data/scenario/pymgrid25/microgrid_0.