diff --git a/pelicun/assessment.py b/pelicun/assessment.py index 1df62c5d9..6e7f2f7d3 100644 --- a/pelicun/assessment.py +++ b/pelicun/assessment.py @@ -83,6 +83,8 @@ '1_excessive.coll.DEM': {'DS1': 'collapse_DS1'}, '2_collapse': {'DS1': 'ALL_NA'}, '3_excessiveRID': {'DS1': 'irreparable_DS1'}, + '4_irreparable': {'DS1': 'ALL_NA'}, + '5_irreparable': {'DS1': 'collapse_DS0'}, }, # TODO(AZ): expand with ground failure logic 'Hazus Earthquake': { @@ -982,14 +984,14 @@ def calculate_damage( # noqa: C901 component_db = [] if component_database_path is not None: - if custom_model_dir is None: - msg = ( - '`custom_model_dir` needs to be specified ' - 'when `component_database_path` is not None.' - ) - raise ValueError(msg) - if 'CustomDLDataFolder' in component_database_path: + if custom_model_dir is None: + msg = ( + '`custom_model_dir` needs to be specified ' + 'when `component_database_path` includes CustomDLDataFolder.' + ) + raise ValueError(msg) + component_database_path = component_database_path.replace( 'CustomDLDataFolder', custom_model_dir ) @@ -1501,14 +1503,14 @@ def load_consequence_info( conseq_df = pd.DataFrame() if consequence_database_path is not None: - if custom_model_dir is None: - msg = ( - 'When `consequence_database_path` is specified, ' - '`custom_model_dir` needs to be specified as well.' - ) - raise ValueError(msg) - if 'CustomDLDataFolder' in consequence_database_path: + if custom_model_dir is None: + msg = ( + 'When `consequence_database_path` includes CustomDLDataFolder, ' + '`custom_model_dir` needs to be specified as well.' + ) + raise ValueError(msg) + consequence_database_path = consequence_database_path.replace( 'CustomDLDataFolder', custom_model_dir ) diff --git a/pelicun/base.py b/pelicun/base.py index d26341fb3..50c10684e 100644 --- a/pelicun/base.py +++ b/pelicun/base.py @@ -1323,6 +1323,11 @@ def dedupe_index(dataframe: pd.DataFrame, dtype: type = str) -> pd.DataFrame: 'Peak Link Beam Chord Rotation': 'LBR', # Wind Intensity 'Peak Gust Wind Speed': 'PWS', + # Wind Demands + 'Peak Wind Force': 'PWF', + 'Peak Internal Force': 'PIF', + 'Peak Line Force': 'PLF', + 'Peak Wind Pressure': 'PWP', # Inundation Intensity 'Peak Inundation Height': 'PIH', # Shaking Intensity diff --git a/pelicun/settings/default_units.json b/pelicun/settings/default_units.json index 1b387b4a4..3931968fe 100644 --- a/pelicun/settings/default_units.json +++ b/pelicun/settings/default_units.json @@ -56,6 +56,13 @@ "kip": 4448.2179868, "kips": 4448.2179868 }, + "line_force": { + "Npm": 1.0, + "kNpm": 1000.0, + "lbpft": 14.5939, + "kippft": 14593.9, + "kipspft": 14593.9 + }, "pressure": { "Pa": 1.0, "kPa": 1000.0, diff --git a/pelicun/settings/input_schema.json b/pelicun/settings/input_schema.json index 19f54ce6b..346a9b05b 100644 --- a/pelicun/settings/input_schema.json +++ b/pelicun/settings/input_schema.json @@ -213,9 +213,7 @@ }, "required": [ "DemandType", - "CapacityDistribution", - "CapacityMedian", - "Theta_1" + "CapacityMedian" ] }, "DamageProcess": { @@ -322,9 +320,7 @@ }, "required": [ "Unit", - "Median", - "Distribution", - "Theta_1" + "Median" ] }, "ReplacementCarbon": { @@ -359,9 +355,7 @@ }, "required": [ "Unit", - "Median", - "Distribution", - "Theta_1" + "Median" ] }, "ReplacementTime": { @@ -396,9 +390,7 @@ }, "required": [ "Unit", - "Median", - "Distribution", - "Theta_1" + "Median" ] }, "ReplacementCost": { @@ -433,9 +425,7 @@ }, "required": [ "Unit", - "Median", - "Distribution", - "Theta_1" + "Median" ] } } diff --git a/pelicun/tests/basic/test_base.py b/pelicun/tests/basic/test_base.py index 327ef9c36..11f8e2dee 100644 --- a/pelicun/tests/basic/test_base.py +++ b/pelicun/tests/basic/test_base.py @@ -864,6 +864,11 @@ def test_parse_units() -> None: 'lbf': 4.4482179868, 'kip': 4448.2179868, 'kips': 4448.2179868, + 'Npm': 1.0, + 'kNpm': 1000.0, + 'lbpft': 14.5939, + 'kippft': 14593.9, + 'kipspft': 14593.9, 'Pa': 1.0, 'kPa': 1000.0, 'MPa': 1000000.0, diff --git a/pelicun/tools/DL_calculation.py b/pelicun/tools/DL_calculation.py index 95df82cd3..74f3fd44f 100644 --- a/pelicun/tools/DL_calculation.py +++ b/pelicun/tools/DL_calculation.py @@ -839,6 +839,14 @@ def _parse_config_file( # noqa: C901 # Ensure `DL/Damage/CollapseFragility` contains all required keys. if is_specified(config, 'DL/Damage/CollapseFragility'): + if is_unspecified( + config, 'DL/Damage/CollapseFragility/CapacityDistribution' + ): + config['DL']['Damage']['CollapseFragility']['CapacityDistribution'] = ( + 'deterministic' + ) + config['DL']['Damage']['CollapseFragility']['Theta_1'] = 'N/A' + for thing in ('CapacityDistribution', 'CapacityMedian', 'Theta_1'): if is_unspecified(config, f'DL/Damage/CollapseFragility/{thing}'): msg = (