ATLAS Offline Software
Classes | Functions
python.ComponentAccumulator Namespace Reference

Classes

class  ComponentAccumulator
 
class  ConfigurationError
 

Functions

def __exit ()
 
def printProperties (msg, c, nestLevel=0, printDefaults=False)
 
def filterComponents (comps, onlyComponents=[])
 
def startInteractive (localVarDic)
 
def printInteractiveMsg_init ()
 
def printInteractiveMsg_run ()
 
def conf2toConfigurable (*args, **kwargs)
 
def CAtoGlobalWrapper (*args, **kwargs)
 
def appendCAtoAthena (*args, **kwargs)
 

Function Documentation

◆ __exit()

def python.ComponentAccumulator.__exit ( )
private

Definition at line 33 of file ComponentAccumulator.py.

33 def __exit():
34  ComponentAccumulator._checkUnmerged = False
35 atexit.register(__exit)
36 
37 

◆ appendCAtoAthena()

def python.ComponentAccumulator.appendCAtoAthena ( args,
**  kwargs 
)

Definition at line 1257 of file ComponentAccumulator.py.

1257  def appendCAtoAthena(*args, **kwargs):
1258  raise RuntimeError("appendCAtoAthena cannot be called in a CA job")

◆ CAtoGlobalWrapper()

def python.ComponentAccumulator.CAtoGlobalWrapper ( args,
**  kwargs 
)

Definition at line 1255 of file ComponentAccumulator.py.

1255  def CAtoGlobalWrapper(*args, **kwargs):
1256  raise RuntimeError("CAtoGlobalWrapper cannot be called in a CA job")

◆ conf2toConfigurable()

def python.ComponentAccumulator.conf2toConfigurable ( args,
**  kwargs 
)

Definition at line 1253 of file ComponentAccumulator.py.

1253  def conf2toConfigurable(*args, **kwargs):
1254  raise RuntimeError("conf2toConfigurable cannot be called in a CA job")

◆ filterComponents()

def python.ComponentAccumulator.filterComponents (   comps,
  onlyComponents = [] 
)

Definition at line 63 of file ComponentAccumulator.py.

63 def filterComponents (comps, onlyComponents = []):
64  ret = []
65  for c in comps:
66  if not onlyComponents or c.getName() in onlyComponents:
67  ret.append((c, True))
68  elif c.getName()+'-' in onlyComponents:
69  ret.append((c, False))
70  return ret
71 
72 

◆ printInteractiveMsg_init()

def python.ComponentAccumulator.printInteractiveMsg_init ( )

Definition at line 1228 of file ComponentAccumulator.py.

1229  print("Interactive mode")
1230  print("\tThe ComponentAccumulator is known as 'self', you can inspect it but changes are not taken into account.")
1231  print("\tThe application is known as 'app' but not yet initialized.")
1232  print("\t^D will exit the interactive mode and athena will continue.")
1233  print("\texit() will terminate the program now.")
1234  return
1235 
1236 

◆ printInteractiveMsg_run()

def python.ComponentAccumulator.printInteractiveMsg_run ( )

Definition at line 1237 of file ComponentAccumulator.py.

1238  print("Interactive mode")
1239  print("\tThe application is known as 'app' and initialized.")
1240  print("\tYou can process N events with 'app.run(N)'.")
1241  print("\tStoreGate is accessible as 'sg'.")
1242  print("\t^D will exit the interactive mode and athena will finalize.")
1243  return
1244 
1245 
1246 # Make legacy support available in legacy jobs

◆ printProperties()

def python.ComponentAccumulator.printProperties (   msg,
  c,
  nestLevel = 0,
  printDefaults = False 
)

Definition at line 38 of file ComponentAccumulator.py.

38 def printProperties(msg, c, nestLevel = 0, printDefaults=False):
39 
40  # Dictionary of (default and) explicitly set values with latter taking precedence
41  props = {**c.getDefaultProperties(), **c._properties} if printDefaults else c._properties
42 
43  for propname, propval in sorted(props.items()):
44 
45  # Recursively expand these types:
46  if isinstance(propval, GaudiConfig2.Configurable):
47  msg.info("%s * %s: %s", " "*nestLevel, propname, propval.getFullJobOptName())
48  printProperties(msg, propval, nestLevel+3, printDefaults)
49 
50  elif isinstance(propval, GaudiHandles.PrivateToolHandleArray):
51  msg.info( "%s * %s: PrivateToolHandleArray of size %s", " "*nestLevel, propname, len(propval))
52  for el in propval:
53  msg.info( "%s * %s/%s", " "*(nestLevel+3), el.__cpp_type__, el.getName())
54  printProperties(msg, el, nestLevel+6, printDefaults)
55 
56  # Only print handle keys:
57  elif isinstance(propval, DataHandle):
58  propval = propval.Path
59 
60  msg.info("%s * %s: %r", " "*nestLevel, propname, propval)
61 
62 

◆ startInteractive()

def python.ComponentAccumulator.startInteractive (   localVarDic)
Setup and start a useful interactive session including auto-completion and history

Definition at line 1211 of file ComponentAccumulator.py.

1211 def startInteractive(localVarDic):
1212  """Setup and start a useful interactive session including auto-completion and history"""
1213  import code
1214 
1215  # collect all global and local variables
1216  vars = sys.modules['__main__'].__dict__
1217  vars.update(globals())
1218  vars.update(localVarDic)
1219 
1220  # configure the prompt
1221  from AthenaCommon.Interactive import configureInteractivePrompt
1223 
1224  # start the interpreter
1225  code.interact(local=vars)
1226 
1227 
DerivationFramework::TriggerMatchingUtils::sorted
std::vector< typename R::value_type > sorted(const R &r, PROJ proj={})
Helper function to create a sorted vector from an unsorted range.
python.ComponentAccumulator.appendCAtoAthena
def appendCAtoAthena(*args, **kwargs)
Definition: ComponentAccumulator.py:1257
python.ComponentAccumulator.CAtoGlobalWrapper
def CAtoGlobalWrapper(*args, **kwargs)
Definition: ComponentAccumulator.py:1255
python.ComponentAccumulator.printProperties
def printProperties(msg, c, nestLevel=0, printDefaults=False)
Definition: ComponentAccumulator.py:38
python.ComponentAccumulator.conf2toConfigurable
def conf2toConfigurable(*args, **kwargs)
Definition: ComponentAccumulator.py:1253
python.ComponentAccumulator.__exit
def __exit()
Definition: ComponentAccumulator.py:33
python.Interactive.configureInteractivePrompt
def configureInteractivePrompt(completionDict=None)
Definition: Interactive.py:80
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:26
python.ComponentAccumulator.startInteractive
def startInteractive(localVarDic)
Definition: ComponentAccumulator.py:1211
python.ComponentAccumulator.printInteractiveMsg_run
def printInteractiveMsg_run()
Definition: ComponentAccumulator.py:1237
python.ComponentAccumulator.printInteractiveMsg_init
def printInteractiveMsg_init()
Definition: ComponentAccumulator.py:1228
python.ComponentAccumulator.filterComponents
def filterComponents(comps, onlyComponents=[])
Definition: ComponentAccumulator.py:63