1 """! Utility script for printing help about component classes."""
11 _ignore = (
'Component',
'EventGenerator',
'StdHepTool',
'JavaTool',
'MG')
15 """! Accepts Component class and prints info about it."""
17 if isinstance(v, str):
21 obj = eval(v.__name__)()
22 print(
'%s(%s)' % (v.__name__,
','.join([b.__name__
for b
in v.__bases__])))
24 print(
' DESCRIPTION: \n %s' % v.__doc__.strip())
26 print(
' REQUIRED PARAMETERS:')
27 for pname
in obj.required_parameters():
28 print(
' - %s' % pname)
30 print(
' OPTIONAL PARAMETERS:')
31 for pname
in obj.optional_parameters():
32 print(
' - %s' % pname)
35 for cname
in obj.required_config():
36 print(
' - %s' % cname)
39 print(
' APPEND TOKEN:\n %s' % obj.append_tok)
44 print(
' OUTPUT EXTENSION:\n %s' % obj.output_ext)
48 except Exception
as e:
53 """! Print info for all Component classes."""
54 print(
"AVAILABLE COMPONENTS: ")
55 for k
in sorted(globals().keys()):
57 if isinstance(v, Component.__class__):
58 if v.__name__
not in _ignore:
59 print(
' {}'.format(v.__name__))
65 job.script = script_path
68 job.input_files = {
'signal':
'signal',
70 job.output_files = {
'dummy.out':
'dummy.out'}
71 job.params[
'run_params'] =
'4pt55'
72 job.params[
'nevents'] = 9999
76 print(
'JOB SCRIPT: {}'.format(job.script))
78 print(
' DESCRIPTION: {}'.format(job.description))
81 for component
in job.components:
82 print(
' {}'.format(component.__class__.__name__))
85 for ptag
in job.ptags:
86 print(
' {}'.format(ptag))
89 if __name__ ==
'__main__':
Primary class to run HPS jobs from a Python script.
def print_component(v)
Accepts Component class and prints info about it.
def print_job_script(script_path)
def print_components()
Print info for all Component classes.