Migrate PyConf to GaudiConfig2
GaudiConfig2 provides a new model for configuring Gaudi applications. The biggest changes are:
- The replacement of the
Configurables
module with theGaudiConfig2.Configurables
module, where the important configurables are no longer named-based singletons. - The move to a function-based method of defining the application configuration. An 'options file' must be an
import
'able file containing a function which explicitly returns the configuration of the application.
PyConf already contains wrappers which mimic the GaudiConfig2
configurables (in that they are not named-based singletons), so we just need to change the wrappers to instantiate the new configurable type at the right moment.
The second point allows us to perform transformations of the configuration in much more transparent ways. One use-case is renaming the random locations PyConf assigns to algorithm outputs to pretty locations suitable for downstream applications:
def main():
config = run_moore(options, make_lines)
return rename_locations(config, {"/Event/KalmanFilterAlg/Output": "/Event/Tracks")
where rename_locations
loops over the configuration and replaces all instances of one location with another.