Skip to content
Snippets Groups Projects
Commit adc7da1a authored by Gerhard Raven's avatar Gerhard Raven
Browse files

notify user if a specified option is overruled

parent ef45e216
No related branches found
No related tags found
2 merge requests!1103Draft: Add AnalysisHelpers to DaVinci Stack,!904notify user if a specified option is overruled, fix python test
...@@ -14,6 +14,7 @@ from GaudiConf.LbExec import Options as DefaultOptions, InputProcessTypes ...@@ -14,6 +14,7 @@ from GaudiConf.LbExec import Options as DefaultOptions, InputProcessTypes
from pydantic import root_validator from pydantic import root_validator
from PyConf.reading import (upfront_decoder, reconstruction, get_tes_root) from PyConf.reading import (upfront_decoder, reconstruction, get_tes_root)
from PyConf.application import default_raw_event from PyConf.application import default_raw_event
import logging
class Options(DefaultOptions): class Options(DefaultOptions):
...@@ -56,9 +57,13 @@ class Options(DefaultOptions): ...@@ -56,9 +57,13 @@ class Options(DefaultOptions):
dict: Modified attributes of the Options object. dict: Modified attributes of the Options object.
""" """
input_process = values.get("input_process") input_process = values.get("input_process")
input_stream = values.get("input_stream")
if input_process not in { if input_process not in {
InputProcessTypes.Spruce, InputProcessTypes.TurboPass InputProcessTypes.Spruce, InputProcessTypes.TurboPass
}: } and input_stream != '':
logging.getLogger(__name__).warning(
f'input_stream is set to \'{input_stream}\', but will be reset to \'\' because current input_process = {input_process}'
)
values['input_stream'] = '' values['input_stream'] = ''
return values return values
......
...@@ -46,7 +46,7 @@ def test_add_hlt2_filter(): ...@@ -46,7 +46,7 @@ def test_add_hlt2_filter():
evt_max=1, evt_max=1,
simulation=True, simulation=True,
input_process="Hlt2", input_process="Hlt2",
input_stream="default", input_stream='',
) )
#Note here that we need to manually apply a bind to the PyConf functions #Note here that we need to manually apply a bind to the PyConf functions
# as they are not automatically configured in the pytests. # as they are not automatically configured in the pytests.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment