How to use the pelicun.base.str2bool 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
def main(args):

	parser = argparse.ArgumentParser()
	parser.add_argument('--filenameDL')
	parser.add_argument('--filenameEDP')
	parser.add_argument('--DL_Method', default = None)
	parser.add_argument('--Realizations', default = None)
	parser.add_argument('--outputEDP', default='EDP.csv')
	parser.add_argument('--outputDM', default = 'DM.csv')
	parser.add_argument('--outputDV', default = 'DV.csv')
	parser.add_argument('--dirnameOutput', default = None)
	parser.add_argument('--event_time', default=None)
	parser.add_argument('--detailed_results', default = True,
		type = str2bool, nargs='?', const=True)
	parser.add_argument('--coupled_EDP', default = False,
		type = str2bool, nargs='?', const=False)
	parser.add_argument('--log_file', default = True,
		type = str2bool, nargs='?', const=True)
	parser.add_argument('--ground_failure', default = False,
		type = str2bool, nargs='?', const=False)
	args = parser.parse_args(args)

	log_msg('Initializing pelicun calculation...')

	#print(args)
	run_pelicun(
		args.filenameDL, args.filenameEDP,
		args.DL_Method, args.Realizations, 
		args.outputEDP, args.outputDM, args.outputDV,
		output_path = args.dirnameOutput,
github NHERI-SimCenter / pelicun / pelicun / examples / SimCenter / DL_calculation.py View on Github external
def main(args):

	parser = argparse.ArgumentParser()
	parser.add_argument('--filenameDL')
	parser.add_argument('--filenameEDP')
	parser.add_argument('--DL_Method', default = None)
	parser.add_argument('--Realizations', default = None)
	parser.add_argument('--outputEDP', default='EDP.csv')
	parser.add_argument('--outputDM', default = 'DM.csv')
	parser.add_argument('--outputDV', default = 'DV.csv')
	parser.add_argument('--dirnameOutput', default = None)
	parser.add_argument('--event_time', default=None)
	parser.add_argument('--detailed_results', default = True,
		type = str2bool, nargs='?', const=True)
	parser.add_argument('--coupled_EDP', default = False,
		type = str2bool, nargs='?', const=False)
	parser.add_argument('--log_file', default = True,
		type = str2bool, nargs='?', const=True)
	parser.add_argument('--ground_failure', default = False,
		type = str2bool, nargs='?', const=False)
	args = parser.parse_args(args)

	log_msg('Initializing pelicun calculation...')

	#print(args)
	run_pelicun(
		args.filenameDL, args.filenameEDP,
		args.DL_Method, args.Realizations, 
		args.outputEDP, args.outputDM, args.outputDV,
		output_path = args.dirnameOutput, 
		detailed_results = args.detailed_results, 
		coupled_EDP = args.coupled_EDP,

pelicun

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

BSD-2-Clause
Latest version published 1 month ago

Package Health Score

69 / 100
Full package analysis