ATLAS Offline Software
Public Member Functions | Public Attributes | Private Member Functions | List of all members
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 Member Functions

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

Public Attributes

 name
 
 release
 
 physics
 
 inFiles
 
 outFiles
 
 outputs
 
 inDS
 
 outfmts
 
 newTransform
 

Private Member Functions

def _argsToString (self, adict)
 

Detailed Description

Stores the configuration of a transform.

Definition at line 28 of file trfAMI.py.

Constructor & Destructor Documentation

◆ __init__()

def 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__()

def 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__()

def 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()

def python.trfAMI.TrfConfig._argsToString (   self,
  adict 
)
private

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 

Member Data Documentation

◆ inDS

python.trfAMI.TrfConfig.inDS

Definition at line 36 of file trfAMI.py.

◆ inFiles

python.trfAMI.TrfConfig.inFiles

Definition at line 33 of file trfAMI.py.

◆ name

python.trfAMI.TrfConfig.name

Definition at line 30 of file trfAMI.py.

◆ newTransform

python.trfAMI.TrfConfig.newTransform

Definition at line 38 of file trfAMI.py.

◆ outFiles

python.trfAMI.TrfConfig.outFiles

Definition at line 34 of file trfAMI.py.

◆ outfmts

python.trfAMI.TrfConfig.outfmts

Definition at line 37 of file trfAMI.py.

◆ outputs

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

Definition at line 31 of file trfAMI.py.


The documentation for this class was generated from the following file:
replace
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition: hcg.cxx:307
python.trfAMI._parseExecDict
def _parseExecDict(substep, value)
Back convert a pre/postExec dictionary into a set of command line compatible strings.
Definition: trfAMI.py:117
python.Bindings.__iter__
__iter__
Definition: Control/AthenaPython/python/Bindings.py:791
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
python.trfAMI._parseIncludeDict
def _parseIncludeDict(substep, value, joinWithChar=",")
Back convert a pre/postInclude dictionary into a set of command line compatible strings By default us...
Definition: trfAMI.py:126
str
Definition: BTagTrackIpAccessor.cxx:11
calibdata.copy
bool copy
Definition: calibdata.py:27