Skip to content
Snippets Groups Projects
Commit 4c75a3af authored by Rosen Matev's avatar Rosen Matev :sunny:
Browse files

Merge branch 'improve-diagnostic' into 'master'

notify user if a specified option is overruled, fix python test

See merge request !904
parents ef45e216 00326c72
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
Pipeline #5699180 passed
......@@ -45,7 +45,7 @@ def print_decay_tree(options: Options):
def print_header(options: Options):
ph = PrintHeader(ODINLocation=make_odin())
ph = PrintHeader(name='PrintHeader', ODINLocation=make_odin())
node = CompositeNode("PHNode", children=[ph])
......
......@@ -24,7 +24,7 @@
</set></argument>
<argument name="validator"><text>
findReferenceBlock("""
PrintHeader_14578b4c INFO Number of counters : 1
PrintHeader INFO Number of counters : 1
| Counter | # | sum | mean/eff^* | rms/err^* | min | max |
| "EventCount" | 7 |
ApplicationMgr INFO Application Manager Stopped successfully
......
......@@ -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
......
......@@ -9,6 +9,8 @@
# or submit itself to any jurisdiction. #
###############################################################################
from PyConf.Algorithms import Gaudi__Examples__VoidConsumer as VoidConsumer
from PyConf.components import Algorithm
from PyConf import components
from DaVinci import Options
from DaVinci.algorithms import (make_fsr_algs, create_lines_filter, add_filter,
......@@ -17,10 +19,16 @@ from PyConf.reading import get_odin, get_decreports, get_hlt_reports, upfront_de
from PyConf.application import default_raw_event
from GaudiConf.LbExec import InputProcessTypes
import re
def reset_global_store(algorithm_store={}):
old_algorithm_store = Algorithm._algorithm_store
Algorithm._algorithm_store = algorithm_store
components._IDENTITY_TABLE.clear()
return old_algorithm_store
def test_define_write_fsr():
reset_global_store()
"""
Check if DaVinci imports correctly the algorithm to merge and write FSRs.
"""
......@@ -37,6 +45,7 @@ def test_define_write_fsr():
def test_add_hlt2_filter():
reset_global_store()
"""
Check if DaVinci is able to implement correctly a filter on an HLT2 line.
"""
......@@ -46,7 +55,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.
......@@ -60,6 +69,7 @@ def test_add_hlt2_filter():
def test_add_spruce_filter():
reset_global_store()
"""
Check if DaVinci is able to implement correctly a filter on a Sprucing line.
"""
......@@ -79,6 +89,7 @@ def test_add_spruce_filter():
def test_add_void_filter():
reset_global_store()
"""
Check if DaVinci is able to implement correcty a Void filter
if 'HLT_PASS' string is not found in the filter code."
......@@ -94,6 +105,7 @@ def test_add_void_filter():
def test_apply_filters():
reset_global_store()
"""
Check if DaVinci applies correctly a filter in front of a given algorithm
"""
......@@ -115,6 +127,7 @@ def test_apply_filters():
def test_configured_funtuple():
reset_global_store()
"""
Check if the configured_FunTuple provides a correct instance of FunTuple.
"""
......@@ -148,6 +161,7 @@ def test_configured_funtuple():
def test_get_odin():
reset_global_store()
"""
Check if get_odin provides a correct instance of ODIN.
"""
......@@ -162,11 +176,11 @@ def test_get_odin():
raw_event_format=options.input_raw_format,
stream=options.input_stream):
odin = get_odin()
assert re.fullmatch("/Event/createODIN_[0-9a-f]*/ODIN",
odin.location) is not None
assert "/Event/Decode_ODIN/ODIN" == odin.location
def test_get_decreports():
reset_global_store()
"""
Check if get_decreports provide a correct instance of HltDecReportsDecoder.
"""
......
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