The Gaudi Framework  master (5be87c39)
Loading...
Searching...
No Matches
GaudiConfig2._configurables Namespace Reference

Classes

class  Configurable
 
class  ConfigurableMeta
 
class  Property
 

Functions

 useGlobalInstances (enable)
 
 opt_repr (value)
 
 makeConfigurableClass (name, **namespace)
 
 all_options (explicit_defaults=False)
 

Variables

bool _GLOBAL_INSTANCES = False
 (c) Copyright 1998-2026 CERN for the benefit of the LHCb and ATLAS collaborations # # This software is distributed under the terms of the Apache version 2 licence, # copied verbatim in the file "LICENSE".
 

Function Documentation

◆ all_options()

GaudiConfig2._configurables.all_options ( explicit_defaults = False)
Return a dictionary with all explicitly set options, or with also the
defaults if explicit_defaults is set to True.

Definition at line 314 of file _configurables.py.

314def all_options(explicit_defaults=False):
315 """
316 Return a dictionary with all explicitly set options, or with also the
317 defaults if explicit_defaults is set to True.
318 """
319 opts = {}
320 for c in Configurable.instances.values():
321 opts.update(c.__opt_properties__(explicit_defaults))
322 return opts

◆ makeConfigurableClass()

GaudiConfig2._configurables.makeConfigurableClass ( name,
** namespace )
Create a Configurable specialization.

Definition at line 304 of file _configurables.py.

304def makeConfigurableClass(name, **namespace):
305 """
306 Create a Configurable specialization.
307 """
308 properties = namespace.pop("properties", {})
309 namespace.update({pname: Property(*pargs) for pname, pargs in properties.items()})
310
311 return type(name, (Configurable,), namespace)
312
313

◆ opt_repr()

GaudiConfig2._configurables.opt_repr ( value)
String representation of the value, such that it can be consumed be the
Gaudi option parsers.

Definition at line 121 of file _configurables.py.

121def opt_repr(value):
122 """
123 String representation of the value, such that it can be consumed be the
124 Gaudi option parsers.
125 """
126 if hasattr(value, "__opt_repr__"):
127 return value.__opt_repr__()
128 return repr(value)
129
130

◆ useGlobalInstances()

GaudiConfig2._configurables.useGlobalInstances ( enable)
Enable or disable the global instances database.

By default global instances are enabled.

Definition at line 15 of file _configurables.py.

15def useGlobalInstances(enable):
16 """
17 Enable or disable the global instances database.
18
19 By default global instances are enabled.
20 """
21 global _GLOBAL_INSTANCES
22 if enable == _GLOBAL_INSTANCES:
23 return
24 if not enable:
25 assert (
26 not Configurable.instances
27 ), "Configurable instances DB not empty, cannot be disabled"
28 _GLOBAL_INSTANCES = enable
29
30

Variable Documentation

◆ _GLOBAL_INSTANCES

bool GaudiConfig2._configurables._GLOBAL_INSTANCES = False
protected

(c) Copyright 1998-2026 CERN for the benefit of the LHCb and ATLAS collaborations # # This software is distributed under the terms of the Apache version 2 licence, # copied verbatim in the file "LICENSE".

# # In applying this licence, CERN does not waive the privileges and immunities # granted to it by virtue of its status as an Intergovernmental Organization # or submit itself to any jurisdiction. #

Classes and functions for handling Configurables

Definition at line 12 of file _configurables.py.