Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add limit/damage state #605

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Changed
- Remove unused insecure IN-CORE client [#581](https://github.com/IN-CORE/pyincore/issues/581)
- Update port inventory type and corresponding limit state and damage state calculation [#603](https://github.com/IN-CORE/pyincore/issues/603)

### Added
- Apply Black formatter [#589](https://github.com/IN-CORE/pyincore/issues/589)
Expand Down
15 changes: 15 additions & 0 deletions pyincore/models/fragilitycurveset.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ def calculate_damage_interval(
ls_ds_dspatcher = {
# 1 LS to 4 DS
("hurricane", "building", 1): FragilityCurveSet._1ls_to_4ds,
("hurricane", "berth", 1): FragilityCurveSet._1ls_to_4ds,
("hurricane", "crane", 1): FragilityCurveSet._1ls_to_4ds,
("hurricane", "equipment", 1): FragilityCurveSet._1ls_to_4ds,
("hurricane", "tank", 1): FragilityCurveSet._1ls_to_4ds,
("hurricane", "electric_facility", 1): FragilityCurveSet._1ls_to_4ds,
# 1 LS to 5 DS
("hurricane", "road", 1): FragilityCurveSet._1ls_to_5ds,
Expand All @@ -142,6 +146,7 @@ def calculate_damage_interval(
("earthquake+tsunami", "building", 3): FragilityCurveSet._3ls_to_4ds,
("tornado", "building", 3): FragilityCurveSet._3ls_to_4ds,
("hurricane", "building", 3): FragilityCurveSet._3ls_to_4ds,
("hurricane", "warehouse", 3): FragilityCurveSet._3ls_to_4ds,
longshuicy marked this conversation as resolved.
Show resolved Hide resolved
("flood", "building", 3): FragilityCurveSet._3ls_to_4ds,
("tsunami", "building", 3): FragilityCurveSet._3ls_to_4ds,
# 4 LS to 5 DS
Expand Down Expand Up @@ -405,6 +410,16 @@ def _initialize_limit_states(inventory_type):
"""
if inventory_type == "building":
output = {"LS_0": 0.0, "LS_1": 0.0, "LS_2": 0.0}
elif inventory_type == "berth":
output = {"LS_0": 0.0, "LS_1": 0.0, "LS_2": 0.0}
elif inventory_type == "tank":
output = {"LS_0": 0.0, "LS_1": 0.0, "LS_2": 0.0}
elif inventory_type == "warehouse":
longshuicy marked this conversation as resolved.
Show resolved Hide resolved
output = {"LS_0": 0.0, "LS_1": 0.0, "LS_2": 0.0}
elif inventory_type == "crane":
output = {"LS_0": 0.0, "LS_1": 0.0, "LS_2": 0.0}
elif inventory_type == "equipment":
output = {"LS_0": 0.0, "LS_1": 0.0, "LS_2": 0.0}
elif inventory_type == "pipeline":
output = {"LS_0": 0.0, "LS_1": 0.0, "LS_2": 0.0, "LS_3": 0.0}
elif inventory_type == "bridge":
Expand Down
Loading