Skip to content

Commit

Permalink
include setup_damage_parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
jensdebruijn committed Sep 12, 2024
1 parent 4e9719f commit 1f85f92
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions geb/setup/geb.py
Original file line number Diff line number Diff line change
Expand Up @@ -5474,6 +5474,28 @@ def to_yml(
)
return None

def setup_damage_parameters(self, parameters):
for hazard, hazard_parameters in parameters.items():
for asset_type, asset_parameters in hazard_parameters.items():
for component, asset_compontents in asset_parameters.items():
curve = pd.DataFrame(
asset_compontents["curve"], columns=["severity", "damage_ratio"]
)

self.set_table(
curve,
name=f"damage_parameters/{hazard}/{asset_type}/{component}/curve",
)

maximum_damage = {
"maximum_damage": asset_compontents["maximum_damage"]
}

self.set_dict(
maximum_damage,
name=f"damage_parameters/{hazard}/{asset_type}/{component}/maximum_damage",
)

def setup_discharge_observations(self, files):
transform = self.grid.raster.transform

Expand Down

0 comments on commit 1f85f92

Please sign in to comment.