smash.read_model#
- smash.read_model(path)[source]#
Read Model object.
- Parameters:
- pathstr
The file path.
- Returns:
- Model
A Model object loaded from HDF5 file.
- Raises:
- FileNotFoundError:
If file not found.
- ReadHDF5MethodError:
If file not created with
save_model.
See also
save_modelSave Model object.
ModelPrimary data structure of the hydrological model
smash.
Examples
>>> setup, mesh = smash.load_dataset("cance") >>> model = smash.Model(setup, mesh) >>> model Structure: 'gr-a' Spatio-Temporal dimension: (x: 28, y: 28, time: 1440) Last update: Initialization
Save Model
>>> smash.save_model(model, "model.hdf5")
Read Model
>>> model_rld = smash.read_model("model.hdf5") >>> model_rld Structure: 'gr-a' Spatio-Temporal dimension: (x: 28, y: 28, time: 1440) Last update: Initialization