ATLAS Offline Software
Loading...
Searching...
No Matches
python.Configurables.CfgPyAlgorithm Class Reference

Configurable base class for PyAlgorithms -------------------------------—. More...

Inheritance diagram for python.Configurables.CfgPyAlgorithm:
Collaboration diagram for python.Configurables.CfgPyAlgorithm:

Public Member Functions

 __init__ (self, name, **kw)
 getGaudiType (self)
 getType (self)
 setup (self)
 getDlls (self)
 msg (self)
 getHandle (self)
 __getstate__ (self)
 __setstate__ (self, state)
 merge (self, other)

Public Attributes

 OutputLevel = _get_prop_value (self, 'OutputLevel')
 special case of the OutputLevel: take the value from the svcMgr.MessageSvc if none already set by user

Private Attributes

 __dict__

Detailed Description

Configurable base class for PyAlgorithms -------------------------------—.

Definition at line 130 of file Configurables.py.

Constructor & Destructor Documentation

◆ __init__()

python.Configurables.CfgPyAlgorithm.__init__ ( self,
name,
** kw )

Definition at line 131 of file Configurables.py.

131 def __init__( self, name, **kw ):
132 if isinstance(self, LegacyConfigurable):
133 _alg_base.__init__(self, name)
134 else:
135 _alg_base.__init__(self, name, **kw)
136 CfgPyComponent.__init__(self, name, **kw)
137

Member Function Documentation

◆ __getstate__()

python.Configurables.CfgPyComponent.__getstate__ ( self)
inherited

Definition at line 63 of file Configurables.py.

63 def __getstate__(self):
64 state = super().__getstate__()
65 state.update(self.__dict__)
66 return state
67

◆ __setstate__()

python.Configurables.CfgPyComponent.__setstate__ ( self,
state )
inherited

Definition at line 68 of file Configurables.py.

68 def __setstate__(self, state):
69 self.__dict__.update(state)
70 super().__setstate__(state)
71

◆ getDlls()

python.Configurables.CfgPyComponent.getDlls ( self)
inherited

Definition at line 52 of file Configurables.py.

52 def getDlls(self):
53 return 'AthenaPython'
54

◆ getGaudiType()

python.Configurables.CfgPyAlgorithm.getGaudiType ( self)

Definition at line 138 of file Configurables.py.

138 def getGaudiType( self ): return 'Algorithm'

◆ getHandle()

python.Configurables.CfgPyComponent.getHandle ( self)
inherited

Definition at line 60 of file Configurables.py.

60 def getHandle(self):
61 return None
62

◆ getType()

python.Configurables.CfgPyAlgorithm.getType ( self)

Definition at line 139 of file Configurables.py.

139 def getType(self): return 'PyAthena::Alg'
140

◆ merge()

python.Configurables.CfgPyComponent.merge ( self,
other )
inherited
Basic merge for Python components.
Checks that all attributes/properties are identical.

Definition at line 91 of file Configurables.py.

91 def merge(self, other):
92 """Basic merge for Python components.
93 Checks that all attributes/properties are identical.
94 """
95 if self is other:
96 return self
97
98 if type(self) is not type(other):
99 raise TypeError(f"cannot merge instance of {type(other).__name__} into "
100 f"an instance of { type(self).__name__}")
101
102 if self.name != other.name:
103 raise ValueError(f"cannot merge configurables with different names ({self.name} and {other.name})")
104
105 for prop in other.__dict__:
106 if (hasattr(self, prop) and getattr(self, prop) == getattr(other, prop)):
107 continue
108 else:
109 raise ValueError(f"conflicting settings for property {prop} of {self.name}: "
110 f"{getattr(self,prop)} vs {getattr(other,prop)}")
111 return self
112
113
Definition merge.py:1

◆ msg()

python.Configurables.CfgPyComponent.msg ( self)
inherited

Definition at line 56 of file Configurables.py.

56 def msg(self):
57 import AthenaCommon.Logging as _L
58 return _L.logging.getLogger( self.getName() )
59
MsgStream & msg
Definition testRead.cxx:32

◆ setup()

python.Configurables.CfgPyAlgorithm.setup ( self)

Reimplemented from python.Configurables.CfgPyComponent.

Definition at line 141 of file Configurables.py.

141 def setup(self):
142
143 from AthenaPython import PyAthena
144 setattr(PyAthena.algs, self.getName(), self)
145
146
147 CfgPyComponent.setup(self)
148 if isinstance(self, LegacyConfigurable):
149 ConfigurableAlgorithm.setup(self)
150
151
bool setup(asg::AnaToolHandle< Interface > &tool, const std::string &type, const std::vector< std::string > &config, const std::string &progressFile="")
mostly useful for athena, which will otherwise re-use the previous tool

Member Data Documentation

◆ __dict__

python.Configurables.CfgPyComponent.__dict__
privateinherited

Definition at line 65 of file Configurables.py.

◆ OutputLevel

python.Configurables.CfgPyComponent.OutputLevel = _get_prop_value (self, 'OutputLevel')
inherited

special case of the OutputLevel: take the value from the svcMgr.MessageSvc if none already set by user

Definition at line 81 of file Configurables.py.


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