Skip to content

Commit e4b8566

Browse files
authored
Merge pull request #395 from jinyan1214/master
jz: update the capacity spectrum method to fit the new pelicun
2 parents 9208093 + 3ec3995 commit e4b8566

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

modules/performSIMULATION/capacitySpectrum/CapacityModels.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -291,42 +291,42 @@ class HAZUS_cao_peterson_2006(capacity_model_base):
291291
def __init__(self, general_info, dD=0.001): # noqa: N803
292292
# HAZUS capacity data: Table 5-7 to Table 5-10 in HAZUS 5.1
293293
self.capacity_data = dict() # noqa: C408
294-
self.capacity_data['SC'] = pd.read_csv(
294+
self.capacity_data['Severe-Code'] = pd.read_csv(
295295
os.path.join( # noqa: PTH118
296296
os.path.dirname(__file__), # noqa: PTH118, PTH120, RUF100
297297
'SC_capacity_data.csv',
298298
),
299299
index_col=0,
300300
).to_dict(orient='index')
301-
self.capacity_data['VC'] = pd.read_csv(
301+
self.capacity_data['Very High-Code'] = pd.read_csv(
302302
os.path.join( # noqa: PTH118
303303
os.path.dirname(__file__), # noqa: PTH118, PTH120, RUF100
304304
'VC_capacity_data.csv',
305305
),
306306
index_col=0,
307307
).to_dict(orient='index')
308-
self.capacity_data['HC'] = pd.read_csv(
308+
self.capacity_data['High-Code'] = pd.read_csv(
309309
os.path.join( # noqa: PTH118
310310
os.path.dirname(__file__), # noqa: PTH118, PTH120, RUF100
311311
'HC_capacity_data.csv',
312312
),
313313
index_col=0,
314314
).to_dict(orient='index')
315-
self.capacity_data['MC'] = pd.read_csv(
315+
self.capacity_data['Moderate-Code'] = pd.read_csv(
316316
os.path.join( # noqa: PTH118
317317
os.path.dirname(__file__), # noqa: PTH118, PTH120, RUF100
318318
'MC_capacity_data.csv',
319319
),
320320
index_col=0,
321321
).to_dict(orient='index')
322-
self.capacity_data['LC'] = pd.read_csv(
322+
self.capacity_data['Low-Code'] = pd.read_csv(
323323
os.path.join( # noqa: PTH118
324324
os.path.dirname(__file__), # noqa: PTH118, PTH120, RUF100
325325
'LC_capacity_data.csv',
326326
),
327327
index_col=0,
328328
).to_dict(orient='index')
329-
self.capacity_data['PC'] = pd.read_csv(
329+
self.capacity_data['Pre-Code'] = pd.read_csv(
330330
os.path.join( # noqa: PTH118
331331
os.path.dirname(__file__), # noqa: PTH118, PTH120, RUF100
332332
'PC_capacity_data.csv',

modules/performSIMULATION/capacitySpectrum/DampingModels.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,12 @@ def __init__(self):
147147
header=None,
148148
)
149149
self.kappa_col_map = {
150-
'SC': {'S': 1, 'M': 2, 'L': 3},
151-
'VC': {'S': 1, 'M': 2, 'L': 3},
152-
'HC': {'S': 1, 'M': 2, 'L': 3},
153-
'MC': {'S': 4, 'M': 5, 'L': 6},
154-
'LC': {'S': 7, 'M': 8, 'L': 9},
155-
'PC': {'S': 10, 'M': 11, 'L': 12},
150+
'Severe-Code': {'S': 1, 'M': 2, 'L': 3},
151+
'Very High-Code': {'S': 1, 'M': 2, 'L': 3},
152+
'High-Code': {'S': 1, 'M': 2, 'L': 3},
153+
'Moderate-Code': {'S': 4, 'M': 5, 'L': 6},
154+
'Low-Code': {'S': 7, 'M': 8, 'L': 9},
155+
'Pre-Code': {'S': 10, 'M': 11, 'L': 12},
156156
}
157157

158158
def get_beta_elastic(self, HAZUS_bldg_type): # noqa: N803
@@ -255,7 +255,7 @@ def get_beta(self, Dp, Ap): # noqa: N803
255255
)
256256
except: # noqa: E722
257257
sys.exit(
258-
f'The base model {self.base_model} does not have a useful'
258+
f'The base model {self.base_model} does not have a useful '
259259
'get_kappa method.'
260260
)
261261
if Dp <= 0 or Ap <= 0:

0 commit comments

Comments
 (0)