-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
562 update building nonstructural damage to support flood (#571)
* rewrite nonstructrual * rewrite pytest * move flood damage to nonstructural building damage * add changelog entry * switch back * update changelog * 566 update flood input to non structural damage for combined wind wave surge building damage (#577) * update to flood to non structural * update tests * changelog * overwrite the default fragility key * include hurricane; limit liquefaction to only eq * add hurricane * update output key * remove unused import * another place to use result * add retrofit strategy * fix the test * fix test buildling damage * building dataset
- Loading branch information
1 parent
f3c78de
commit 45750d7
Showing
13 changed files
with
191 additions
and
321 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
230 changes: 86 additions & 144 deletions
230
pyincore/analyses/nonstructbuildingdamage/nonstructbuildingdamage.py
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
tests/pyincore/analyses/nonstructbuildingdamage/test_flood_nonstructbuildingdamage.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from pyincore import IncoreClient, FragilityService, MappingSet, Flood, HazardService | ||
from pyincore.analyses.nonstructbuildingdamage import NonStructBuildingDamage | ||
import pyincore.globals as pyglobals | ||
|
||
|
||
def run_with_base_class(): | ||
client = IncoreClient(pyglobals.INCORE_API_DEV_URL) | ||
hazardsvc = HazardService(client) | ||
|
||
# lumberton flood | ||
flood = Flood.from_hazard_service("5f4d02e99f43ee0dde768406", hazardsvc) | ||
|
||
# lumberton building inventory v7 | ||
# bldg_dataset_id = "603010f7b1db9c28aef53214" # 40 building subset | ||
bldg_dataset_id = "603010a4b1db9c28aef5319f" # 21k full building | ||
|
||
# lumberton building mapping (with equation) | ||
mapping_id = "602f3cf981bd2c09ad8f4f9d" | ||
fragility_service = FragilityService(client) | ||
mapping_set = MappingSet(fragility_service.get_mapping(mapping_id)) | ||
|
||
non_structural_building_dmg_flood = NonStructBuildingDamage(client) | ||
non_structural_building_dmg_flood.load_remote_input_dataset("buildings", bldg_dataset_id) | ||
non_structural_building_dmg_flood.set_input_dataset('dfr3_mapping_set', mapping_set) | ||
non_structural_building_dmg_flood.set_parameter("result_name", "non_structural_building_dmg_result_flood") | ||
non_structural_building_dmg_flood.set_input_hazard("hazard", flood) | ||
non_structural_building_dmg_flood.set_parameter("num_cpu", 4) | ||
non_structural_building_dmg_flood.set_parameter("fragility_key", "Lumberton Flood Building Fragility ID Code") | ||
non_structural_building_dmg_flood.run_analysis() | ||
|
||
|
||
if __name__ == '__main__': | ||
run_with_base_class() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.