ATLAS Offline Software
|
Public Member Functions | |
def | __init__ (self, typeAndName, **kwargs) |
def | getName (self) |
def | getType (self) |
def | addSelfToJob (self, job) |
def | __getattr__ (self, name) |
def | __setattr__ (self, key, value) |
def | __eq__ (self, other) |
def | __ne__ (self, other) |
def | __str__ (self) |
def | addPrivateTool (self, name, type) |
def | addPrivateToolInArray (self, name, type) |
Static Public Attributes | |
int | printHeaderWidth = 80 |
int | printHeaderPre = 3 |
Static Private Member Functions | |
def | _printHeader (title) |
def | _printFooter (title) |
Private Attributes | |
_props | |
Standalone Analysis Component Configuration This class is used to describe the configuration of an analysis component (a C++ class inheriting from asg::AsgComponentConfig) in Python. It behaves similar to an Athena configurable, but is implemented in a much simpler way. An example of using it in configuring an EventLoop job could look like: job = ROOT.EL.Job() ... from AnaAlgorithm.PythonConfig import PythonConfig alg = PythonConfig( "EL::UnitTestAlg2/TestAlg", property = 1.23 ) alg.setComponentType( "AnaAlgorithm" ) alg.string_property = "Foo" job.algsAdd( alg ) Note that the python code doesn't know what properties can actually be set on any given C++ algorithm. Any mistake made in the Python configuration (apart from syntax errors) is only discovered while initialising the analysis job.
Definition at line 8 of file PythonConfig.py.
def python.PythonConfig.PythonConfig.__init__ | ( | self, | |
typeAndName, | |||
** | kwargs | ||
) |
Constructor for an algorithm configuration object Keyword arguments: typeAndName -- The type/instance name of the algorithm Note that you can pass (initial) properties to the constructor like: alg = PythonConfig( "EL::UnitTestAlg2/TestAlg", property = 1.23 )
Definition at line 37 of file PythonConfig.py.
def python.PythonConfig.PythonConfig.__eq__ | ( | self, | |
other | |||
) |
Check for equality with another object The implementation of this is very simple. We only check that the type and the name of the algorithms would match.
Definition at line 137 of file PythonConfig.py.
def python.PythonConfig.PythonConfig.__getattr__ | ( | self, | |
name | |||
) |
Get a previously set property value from the configuration This function allows us to retrieve the value of a property that was already set for the algorithm, to possibly use it in some configuration decisions in the Python code itself. Keyword arguments: name -- The name of the property
Definition at line 92 of file PythonConfig.py.
def python.PythonConfig.PythonConfig.__ne__ | ( | self, | |
other | |||
) |
Check for an inequality with another object This is just defined to make the '!=' operator of Python behave consistently with the '==' operator for such objects.
Definition at line 152 of file PythonConfig.py.
def python.PythonConfig.PythonConfig.__setattr__ | ( | self, | |
key, | |||
value | |||
) |
Set an algorithm property on an existing configuration object This function allows us to set/override properties on an algorithm configuration object. Allowing for the following syntax: alg = ... alg.IntProperty = 66 alg.FloatProperty = 3.141592 alg.StringProperty = "Foo" Keyword arguments: key -- The key/name of the property value -- The value to set for the property
Definition at line 111 of file PythonConfig.py.
def python.PythonConfig.PythonConfig.__str__ | ( | self | ) |
Print the algorithm configuration in a user friendly way This is just to help with debugging configurations, allowing the user to get a nice printout of their job configuration.
Definition at line 160 of file PythonConfig.py.
|
staticprivate |
Produce a nice footer when printing the configuration This function is used for printing the footer of both algorithms and tools. Keyword arguments: indentString -- String used as indentation title -- The title of the algorithm/tool
Definition at line 283 of file PythonConfig.py.
|
staticprivate |
Produce a nice header when printing the configuration This function is used for printing the header of both algorithms and tools. Keyword arguments: indentString -- String used as indentation title -- The title of the algorithm/tool
Definition at line 266 of file PythonConfig.py.
def python.PythonConfig.PythonConfig.addPrivateTool | ( | self, | |
name, | |||
type | |||
) |
Create a private tool for the algorithm This function is used in 'standalone' mode to declare a private tool for the algorithm, or a private tool for an already declared private tool. Can be used like: config.addPrivateTool( 'tool1', 'ToolType1' ) config.addPrivateTool( 'tool1.tool2', 'ToolType2' ) Keyword arguments: name -- The full name of the private tool type -- The C++ type of the private tool
Definition at line 181 of file PythonConfig.py.
def python.PythonConfig.PythonConfig.addPrivateToolInArray | ( | self, | |
name, | |||
type | |||
) |
Create a private tool in an array for the algorithm This function is used in 'standalone' mode to declare a private tool in a tool array for the algorithm, or a private tool in a tool array for an already declared private tool. Can be used like: tool = config.addPrivateToolInArray( 'tool1', 'ToolType1' ) tool = config.addPrivateToolInArray( 'tool1.tool2', 'ToolType2' ) Keyword arguments: name -- The full name of the private tool type -- The C++ type of the private tool
Definition at line 224 of file PythonConfig.py.
def python.PythonConfig.PythonConfig.addSelfToJob | ( | self, | |
job | |||
) |
add a copy of this config to the EventLoop job object Keyword arguments: job -- The job object to add ourself to
Definition at line 83 of file PythonConfig.py.
def python.PythonConfig.PythonConfig.getName | ( | self | ) |
Get the instance name of the algorithm This is for compatibility with the getName() function of Athena configurables.
Definition at line 65 of file PythonConfig.py.
def python.PythonConfig.PythonConfig.getType | ( | self | ) |
Get the type name of the algorithm This is for compatibility with the getType() function of Athena configurables.
Definition at line 74 of file PythonConfig.py.
|
private |
Definition at line 55 of file PythonConfig.py.
|
static |
Definition at line 35 of file PythonConfig.py.
|
static |
Definition at line 34 of file PythonConfig.py.