How to use the pelicun.auto.auto_populate function in pelicun

To help you get started, we’ve selected a few pelicun examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NHERI-SimCenter / pelicun / pelicun / examples / SimCenter / DL_calculation.py View on Github external
# 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)

pelicun

Probabilistic Estimation of Losses, Injuries, and Community resilience Under Natural hazard events

BSD-2-Clause
Latest version published 11 days ago

Package Health Score

63 / 100
Full package analysis