Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# read the type of assessment from the DL input file
with open(DL_input_path, 'r') as f:
DL_input = json.load(f)
# check if the DL input file has information about the loss model
if 'DamageAndLoss' in DL_input:
pass
else:
# if the loss model is not defined, give a warning
print('WARNING No loss model defined in the BIM file. Trying to auto-populate.')
EDP_input_path = EDP_files[s_i]
# and try to auto-populate the loss model using the BIM information
DL_input, DL_input_path = auto_populate(DL_input_path, EDP_input_path,
DL_method, realization_count,
coupled_EDP, event_time,
ground_failure)
DL_method = DL_input['DamageAndLoss']['_method']
stripe_str = '' if len(stripes) == 1 else str(stripe)+'_'
if DL_method == 'FEMA P58':
A = FEMA_P58_Assessment(log_file=log_file)
elif DL_method in ['HAZUS MH EQ', 'HAZUS MH', 'HAZUS MH EQ IM']:
A = HAZUS_Assessment(hazard = 'EQ', log_file=log_file)
elif DL_method == 'HAZUS MH HU':
A = HAZUS_Assessment(hazard = 'HU', log_file=log_file)