key4hep / k4FWCore

Core Components for the Gaudi-based Key4hep Framework
Apache License 2.0
10 stars 26 forks source link

Not possible to set `Algorithm.OutputLevel` from commandline? #211

Open Zehvogel opened 2 months ago

Zehvogel commented 2 months ago

Or at least I am too stupid to figure out the correct syntax, but when I try something like

k4run mysteeringfile.py --MyAlgorithm.OutputLevel=ERROR

I only get a

k4run: error: argument --MyAlgorithm.OutputLevel/--OutputLevel.MyAlgorithm: invalid int value: 'ERROR'
tmadlener commented 2 months ago

You would need to convert ERROR to an integer for this to work, which in turn would probably require some custom arg parsing logic. It could make sense to do that for the OutputLevel, but I am not sure about all properties.

jmcarcell commented 2 months ago

Here you have the constants, thanks for the PR @Zehvogel!!!! https://gitlab.cern.ch/gaudi/Gaudi/-/blob/master/GaudiKernel/python/GaudiKernel/Constants.py#L28

As a workaround you can pass the integer value and that will work, like

k4run mysteeringfile.py --MyAlgorithm.OutputLevel 5
Zehvogel commented 2 months ago

Thx for the workaround :)