From 3ec3995c0b124f03b02111b5a55769301275c7a1 Mon Sep 17 00:00:00 2001 From: jinyan1214 Date: Thu, 22 May 2025 10:55:13 -0700 Subject: [PATCH] jz: update the capacity spectrum method to fit the new pelicun --- .../capacitySpectrum/CapacityModels.py | 12 ++++++------ .../capacitySpectrum/DampingModels.py | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/modules/performSIMULATION/capacitySpectrum/CapacityModels.py b/modules/performSIMULATION/capacitySpectrum/CapacityModels.py index f03eee8d3..eb125e7cd 100644 --- a/modules/performSIMULATION/capacitySpectrum/CapacityModels.py +++ b/modules/performSIMULATION/capacitySpectrum/CapacityModels.py @@ -291,42 +291,42 @@ class HAZUS_cao_peterson_2006(capacity_model_base): def __init__(self, general_info, dD=0.001): # noqa: N803 # HAZUS capacity data: Table 5-7 to Table 5-10 in HAZUS 5.1 self.capacity_data = dict() # noqa: C408 - self.capacity_data['SC'] = pd.read_csv( + self.capacity_data['Severe-Code'] = pd.read_csv( os.path.join( # noqa: PTH118 os.path.dirname(__file__), # noqa: PTH118, PTH120, RUF100 'SC_capacity_data.csv', ), index_col=0, ).to_dict(orient='index') - self.capacity_data['VC'] = pd.read_csv( + self.capacity_data['Very High-Code'] = pd.read_csv( os.path.join( # noqa: PTH118 os.path.dirname(__file__), # noqa: PTH118, PTH120, RUF100 'VC_capacity_data.csv', ), index_col=0, ).to_dict(orient='index') - self.capacity_data['HC'] = pd.read_csv( + self.capacity_data['High-Code'] = pd.read_csv( os.path.join( # noqa: PTH118 os.path.dirname(__file__), # noqa: PTH118, PTH120, RUF100 'HC_capacity_data.csv', ), index_col=0, ).to_dict(orient='index') - self.capacity_data['MC'] = pd.read_csv( + self.capacity_data['Moderate-Code'] = pd.read_csv( os.path.join( # noqa: PTH118 os.path.dirname(__file__), # noqa: PTH118, PTH120, RUF100 'MC_capacity_data.csv', ), index_col=0, ).to_dict(orient='index') - self.capacity_data['LC'] = pd.read_csv( + self.capacity_data['Low-Code'] = pd.read_csv( os.path.join( # noqa: PTH118 os.path.dirname(__file__), # noqa: PTH118, PTH120, RUF100 'LC_capacity_data.csv', ), index_col=0, ).to_dict(orient='index') - self.capacity_data['PC'] = pd.read_csv( + self.capacity_data['Pre-Code'] = pd.read_csv( os.path.join( # noqa: PTH118 os.path.dirname(__file__), # noqa: PTH118, PTH120, RUF100 'PC_capacity_data.csv', diff --git a/modules/performSIMULATION/capacitySpectrum/DampingModels.py b/modules/performSIMULATION/capacitySpectrum/DampingModels.py index d6657987c..0b254eb38 100644 --- a/modules/performSIMULATION/capacitySpectrum/DampingModels.py +++ b/modules/performSIMULATION/capacitySpectrum/DampingModels.py @@ -147,12 +147,12 @@ def __init__(self): header=None, ) self.kappa_col_map = { - 'SC': {'S': 1, 'M': 2, 'L': 3}, - 'VC': {'S': 1, 'M': 2, 'L': 3}, - 'HC': {'S': 1, 'M': 2, 'L': 3}, - 'MC': {'S': 4, 'M': 5, 'L': 6}, - 'LC': {'S': 7, 'M': 8, 'L': 9}, - 'PC': {'S': 10, 'M': 11, 'L': 12}, + 'Severe-Code': {'S': 1, 'M': 2, 'L': 3}, + 'Very High-Code': {'S': 1, 'M': 2, 'L': 3}, + 'High-Code': {'S': 1, 'M': 2, 'L': 3}, + 'Moderate-Code': {'S': 4, 'M': 5, 'L': 6}, + 'Low-Code': {'S': 7, 'M': 8, 'L': 9}, + 'Pre-Code': {'S': 10, 'M': 11, 'L': 12}, } def get_beta_elastic(self, HAZUS_bldg_type): # noqa: N803 @@ -255,7 +255,7 @@ def get_beta(self, Dp, Ap): # noqa: N803 ) except: # noqa: E722 sys.exit( - f'The base model {self.base_model} does not have a useful' + f'The base model {self.base_model} does not have a useful ' 'get_kappa method.' ) if Dp <= 0 or Ap <= 0: