IForcing
objects.IForcing()BaseModel describing the expected variables and data types for forcing parameters of hazard model.
Methods
| Name | Description |
|---|---|
| content_fingerprint | Return a stable fingerprint of the forcing’s underlying data. |
| model_dump | Override the default model_dump to include class variables type and source. |
| save_additional | Save additional data of the forcing. |
| serialize_path | Serialize filepath-like fields by saving only the filename. It is assumed that the file will be saved in the same directory. |
content_fingerprint
objects.IForcing.content_fingerprint()Return a stable fingerprint of the forcing’s underlying data.
- If a file-backed
pathattribute exists and the file exists, hash its bytes (SHA-256). - Otherwise, hash a canonical JSON dump of the model (excluding volatile fields like
path).
Returns
: str-
A fingerprint string that changes when the forcing’s effective data changes.
model_dump
objects.IForcing.model_dump(**kwargs: Any)Override the default model_dump to include class variables type and source.
save_additional
objects.IForcing.save_additional(output_dir: Path | str | os.PathLike)Save additional data of the forcing.
serialize_path
objects.IForcing.serialize_path(value: Path)Serialize filepath-like fields by saving only the filename. It is assumed that the file will be saved in the same directory.