From adc7da1a1f31f0513652185183d72c35ea97ce96 Mon Sep 17 00:00:00 2001
From: Gerhard Raven <gerhard.raven@nikhef.nl>
Date: Thu, 11 May 2023 10:09:50 +0200
Subject: [PATCH] notify user if a specified option is overruled

---
 Phys/DaVinci/python/DaVinci/LbExec.py        | 7 ++++++-
 Phys/DaVinci/tests/config/test_algorithms.py | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/Phys/DaVinci/python/DaVinci/LbExec.py b/Phys/DaVinci/python/DaVinci/LbExec.py
index d4e27a82a..1f74ed93c 100644
--- a/Phys/DaVinci/python/DaVinci/LbExec.py
+++ b/Phys/DaVinci/python/DaVinci/LbExec.py
@@ -14,6 +14,7 @@ from GaudiConf.LbExec import Options as DefaultOptions, InputProcessTypes
 from pydantic import root_validator
 from PyConf.reading import (upfront_decoder, reconstruction, get_tes_root)
 from PyConf.application import default_raw_event
+import logging
 
 
 class Options(DefaultOptions):
@@ -56,9 +57,13 @@ class Options(DefaultOptions):
         dict: Modified attributes of the Options object.
       """
         input_process = values.get("input_process")
+        input_stream = values.get("input_stream")
         if input_process not in {
                 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'] = ''
 
         return values
diff --git a/Phys/DaVinci/tests/config/test_algorithms.py b/Phys/DaVinci/tests/config/test_algorithms.py
index 8494e78f2..ab54c3159 100644
--- a/Phys/DaVinci/tests/config/test_algorithms.py
+++ b/Phys/DaVinci/tests/config/test_algorithms.py
@@ -46,7 +46,7 @@ def test_add_hlt2_filter():
         evt_max=1,
         simulation=True,
         input_process="Hlt2",
-        input_stream="default",
+        input_stream='',
     )
     #Note here that we need to manually apply a bind to the PyConf functions
     # as they are not automatically configured in the pytests.
-- 
GitLab