ATLAS Offline Software
Loading...
Searching...
No Matches
python.trfAMI.TrfConfig Class Reference

Stores the configuration of a transform. More...

Inheritance diagram for python.trfAMI.TrfConfig:
Collaboration diagram for python.trfAMI.TrfConfig:

Public Types

typedef HLT::TypeInformation::for_each_type_c< typenameEDMLIST::map, my_functor, my_result<>, my_arg< HLT::TypeInformation::get_cont, CONTAINER > >::type result

Public Member Functions

 __init__ (self)
 __iter__ (self)
 __str__ (self)

Public Attributes

 name = None
 release = None
dict physics = {}
dict inFiles = {}
dict outFiles = {}
dict outputs = {}
 inDS = None
list outfmts = []
bool newTransform = False

Protected Member Functions

 _argsToString (self, adict)

Detailed Description

Stores the configuration of a transform.

Definition at line 28 of file trfAMI.py.

Member Typedef Documentation

◆ result

Definition at line 90 of file EDM_MasterSearch.h.

Constructor & Destructor Documentation

◆ __init__()

python.trfAMI.TrfConfig.__init__ ( self)

Definition at line 29 of file trfAMI.py.

29 def __init__(self):
30 self.name=None
31 self.release=None
32 self.physics={}
33 self.inFiles={}
34 self.outFiles={}
35 self.outputs={}
36 self.inDS=None
37 self.outfmts=[]
38 self.newTransform=False
39

Member Function Documentation

◆ __iter__()

python.trfAMI.TrfConfig.__iter__ ( self)

Definition at line 40 of file trfAMI.py.

40 def __iter__(self):
41 theDict=self.inFiles.copy()
42 theDict.update(self.outFiles)
43 theDict.update(self.physics)
44 for (k,v) in theDict.items():
45 yield k,v
46

◆ __str__()

python.trfAMI.TrfConfig.__str__ ( self)

Definition at line 47 of file trfAMI.py.

47 def __str__(self):
48 string = 'asetup '+self.release+'\n'+self.name
49 string += self._argsToString(self.physics) +'\n'
50
51 string +='\nInput file arguments:\n'
52 if self.inFiles:
53 string += self._argsToString(self.inFiles) +'\n'
54 if self.inDS:
55 string +='\nExample input dataset: '+ self.inDS + '\n'
56
57 string +='\nOutput file arguments:\n'
58 if self.outFiles:
59 string += self._argsToString(self.outFiles) + '\n'
60
61 string +='\nAMI outputs:\n'
62 if self.outputs != {}:
63 string += self.outputs + '\n'
64
65 if self.outfmts:
66 string += '\nPossible output data types: '+ str(self.outfmts) + '\n'
67 return string
68

◆ _argsToString()

python.trfAMI.TrfConfig._argsToString ( self,
adict )
protected

Definition at line 69 of file trfAMI.py.

69 def _argsToString(self, adict):
70 string=''
71 for (k,v) in adict.items():
72 if self.newTransform:
73 if not k.startswith('--'):
74 k = "--"+k
75 # Now the tricky bit: we have to hackishly massage back to a CLI
76 # value depending on the value type and possibly the key
77 # type
78 if isinstance(v, dict):
79 # Should be a substep argument
80 if 'Exec' in k: # preExec, postExec
81 string += " " + k
82 for vk, vv in v.items():
83 string += " " + _parseExecDict(vk, vv)
84 elif 'Include' in k: # preInclude, postInclude
85 string += " " + k
86 for vk, vv in v.items():
87 string += " " + _parseIncludeDict(vk, vv)
88 else:
89 # Misc substep string/number argument...?
90 # Be careful with the triggerConfig, which is a bit special in the separator
91 if 'triggerConfig' in k:
92 separator='='
93 else:
94 separator=':'
95 string += " " + k
96 for vk, vv in v.items():
97 string += " " + vk + separator + str(vv)
98 elif isinstance(v, (list, tuple)):
99 # athenaopts are special - space separated
100 if "athenaopts" in k:
101 string += " " + k + "=" + "'" + " ".join(v).replace("'", "\\'") + "'"
102 elif "Exec" in k or "Include" in k:
103 # Special intermediate treatment for pre/postExec from prodsys
104 string += " " + k + " " + " ".join(["'"+element.replace("'", "\\'")+"'" for element in v])
105 else:
106 string += " " + k + "=" + " ".join(["'" + element.replace("'", "\\'") + "'" for element in v])
107 else:
108 # Assume some vanilla value
109 string +=" "+k+" "+"'"+str(v).replace("'", "\\'")+"'"
110 else:
111 string +=" "+k+"="+"'"+str(v).replace("'", "\\'")+"'"
112# string += '\n'
113 return string
114
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition hcg.cxx:310

Member Data Documentation

◆ inDS

python.trfAMI.TrfConfig.inDS = None

Definition at line 36 of file trfAMI.py.

◆ inFiles

dict python.trfAMI.TrfConfig.inFiles = {}

Definition at line 33 of file trfAMI.py.

◆ name

python.trfAMI.TrfConfig.name = None

Definition at line 30 of file trfAMI.py.

◆ newTransform

bool python.trfAMI.TrfConfig.newTransform = False

Definition at line 38 of file trfAMI.py.

◆ outFiles

python.trfAMI.TrfConfig.outFiles = {}

Definition at line 34 of file trfAMI.py.

◆ outfmts

list python.trfAMI.TrfConfig.outfmts = []

Definition at line 37 of file trfAMI.py.

◆ outputs

dict python.trfAMI.TrfConfig.outputs = {}

Definition at line 35 of file trfAMI.py.

◆ physics

python.trfAMI.TrfConfig.physics = {}

Definition at line 32 of file trfAMI.py.

◆ release

python.trfAMI.TrfConfig.release = None

Definition at line 31 of file trfAMI.py.


The documentation for this class was generated from the following file: