smash.io.save_model_ddt#

smash.io.save_model_ddt(model, path)[source]#

Save some derived data types of the Model object to HDF5.

This method is considerably lighter than smash.io.save_model method that saves the entire Model object. However, it is not capable of reconstructing the Model object from the saved data file.

By default, the following data are stored into the HDF5 file:

Parameters:
modelModel

The Model object to save derived data types as a HDF5 file.

pathstr

The file path.

See also

read_model_ddt

Read derived data types of the Model object from HDF5.

smash.Model

Primary data structure of the hydrological model smash.

Examples

>>> from smash.factory import load_dataset
>>> from smash.io import save_model_ddt
>>> setup, mesh = load_dataset("cance")
>>> model = smash.Model(setup, mesh)

Save some derived data types of the Model object to HDF5

>>> save_model_ddt(model, "model_ddt.hdf5")