smash.io.save_setup#

smash.io.save_setup(setup, path)[source]#

Save the Model initialization setup dictionary to YAML.

Parameters:
setupdict[str, Any]

The setup dictionary to be saved to YAML file.

pathstr

The file path. If the path not end with .yaml, the extension is automatically added to the file path.

See also

read_setup

Read the Model initialization setup dictionary from YAML.

Examples

>>> from smash.factory import load_dataset
>>> from smash.io import save_setup, read_setup
>>> setup, mesh = load_dataset("cance")
>>> setup
{'hydrological_module': 'gr4', 'routing_module': 'lr', 'dt': 3600, 'start_time': '2014-09-15 00:00', ...}

Save setup to YAML

>>> save_setup(setup, "setup.yaml")