ATLAS Offline Software
Loading...
Searching...
No Matches
python.ComponentAccumulator Namespace Reference

Classes

class  ConfigurationError
class  ComponentAccumulator

Functions

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

Function Documentation

◆ __exit()

python.ComponentAccumulator.__exit ( )
private

Definition at line 33 of file ComponentAccumulator.py.

33def __exit():
34 ComponentAccumulator._checkUnmerged = False

◆ appendCAtoAthena()

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

Definition at line 1260 of file ComponentAccumulator.py.

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

◆ CAtoGlobalWrapper()

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

Definition at line 1258 of file ComponentAccumulator.py.

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

◆ conf2toConfigurable()

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

Definition at line 1256 of file ComponentAccumulator.py.

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

◆ filterComponents()

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

Definition at line 63 of file ComponentAccumulator.py.

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

python.ComponentAccumulator.printInteractiveMsg_init ( )

Definition at line 1231 of file ComponentAccumulator.py.

1231def printInteractiveMsg_init():
1232 print("Interactive mode")
1233 print("\tThe ComponentAccumulator is known as 'self', you can inspect it but changes are not taken into account.")
1234 print("\tThe application is known as 'app' but not yet initialized.")
1235 print("\t^D will exit the interactive mode and athena will continue.")
1236 print("\texit() will terminate the program now.")
1237 return
1238
1239
void print(char *figname, TCanvas *c1)

◆ printInteractiveMsg_run()

python.ComponentAccumulator.printInteractiveMsg_run ( )

Definition at line 1240 of file ComponentAccumulator.py.

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

◆ printProperties()

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

Definition at line 38 of file ComponentAccumulator.py.

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

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

Definition at line 1214 of file ComponentAccumulator.py.

1214def startInteractive(localVarDic):
1215 """Setup and start a useful interactive session including auto-completion and history"""
1216 import code
1217
1218 # collect all global and local variables
1219 vars = sys.modules['__main__'].__dict__
1220 vars.update(globals())
1221 vars.update(localVarDic)
1222
1223 # configure the prompt
1224 from AthenaCommon.Interactive import configureInteractivePrompt
1225 configureInteractivePrompt(vars)
1226
1227 # start the interpreter
1228 code.interact(local=vars)
1229
1230