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. Note that there is no method to reconstruct the Model object with the saved data file from this method, as some information is left out to ensure a lighter memory backup. To read the saved data, use smash.io.read_model_ddt, which returns a dictionary reflecting the structure of the Model object.

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")