From 108f72ded1c751421bc69ee79b06878f6c1baa82 Mon Sep 17 00:00:00 2001 From: sesen Date: Mon, 31 Oct 2022 11:27:24 +0100 Subject: [PATCH 1/5] add input_raw_format to funtuple --- Phys/FunTuple/python/FunTuple/functorcollections.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Phys/FunTuple/python/FunTuple/functorcollections.py b/Phys/FunTuple/python/FunTuple/functorcollections.py index 7fd13774e..34cdf9939 100644 --- a/Phys/FunTuple/python/FunTuple/functorcollections.py +++ b/Phys/FunTuple/python/FunTuple/functorcollections.py @@ -601,7 +601,7 @@ def __print_collection(coll_name): process="Hlt2", stream="dummy_strm", input_raw_format=0.5): f_dict = coll().functor_dict elif coll_name == 'SelectionInfo': - with get_hlt_reports.bind(process="Hlt2", stream="dummy_strm"): + with get_hlt_reports.bind(process="Hlt2", stream="dummy_strm", input_raw_format=0.5): f_dict = coll("Hlt2", ['dummy_line_name_Decision']).functor_dict elif 'MC' in coll_name and coll_name not in _mc_rtible_rted: dummy_dh = make_data_with_FetchDataFromFile("dummy3") -- GitLab From b3264293fab92c0ee1850ed8537ce1b7f8d4cf9e Mon Sep 17 00:00:00 2001 From: sesen Date: Fri, 4 Nov 2022 09:39:20 +0100 Subject: [PATCH 2/5] bind raw_event_format --- Phys/FunTuple/python/FunTuple/functorcollections.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Phys/FunTuple/python/FunTuple/functorcollections.py b/Phys/FunTuple/python/FunTuple/functorcollections.py index 34cdf9939..e070163cb 100644 --- a/Phys/FunTuple/python/FunTuple/functorcollections.py +++ b/Phys/FunTuple/python/FunTuple/functorcollections.py @@ -26,6 +26,7 @@ import io, sys import Functors as F from .FunctorCollection import FunctorCollection from PyConf.reading import get_odin, get_decreports +from PyConf.application import default_raw_event __all__ = ( "EventInfo", @@ -595,13 +596,14 @@ def __print_collection(coll_name): print(f"{coll_name}:") coll = globals()[coll_name] + default_raw_event.global_bind(raw_event_format=0.5) #get functor collection if coll_name == 'EventInfo': with get_odin.bind( - process="Hlt2", stream="dummy_strm", input_raw_format=0.5): + process="Hlt2", stream="dummy_strm"): f_dict = coll().functor_dict elif coll_name == 'SelectionInfo': - with get_hlt_reports.bind(process="Hlt2", stream="dummy_strm", input_raw_format=0.5): + with get_hlt_reports.bind(process="Hlt2", stream="dummy_strm"): f_dict = coll("Hlt2", ['dummy_line_name_Decision']).functor_dict elif 'MC' in coll_name and coll_name not in _mc_rtible_rted: dummy_dh = make_data_with_FetchDataFromFile("dummy3") -- GitLab From 84a7e31c56506042c645cc7f7ca56e1f1f59a345 Mon Sep 17 00:00:00 2001 From: Gitlab CI Date: Fri, 4 Nov 2022 08:39:54 +0000 Subject: [PATCH 3/5] Fixed formatting patch generated by https://gitlab.cern.ch/lhcb/Analysis/-/jobs/25600457 --- Phys/FunTuple/python/FunTuple/functorcollections.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Phys/FunTuple/python/FunTuple/functorcollections.py b/Phys/FunTuple/python/FunTuple/functorcollections.py index e070163cb..42b6e8315 100644 --- a/Phys/FunTuple/python/FunTuple/functorcollections.py +++ b/Phys/FunTuple/python/FunTuple/functorcollections.py @@ -599,8 +599,7 @@ def __print_collection(coll_name): default_raw_event.global_bind(raw_event_format=0.5) #get functor collection if coll_name == 'EventInfo': - with get_odin.bind( - process="Hlt2", stream="dummy_strm"): + with get_odin.bind(process="Hlt2", stream="dummy_strm"): f_dict = coll().functor_dict elif coll_name == 'SelectionInfo': with get_hlt_reports.bind(process="Hlt2", stream="dummy_strm"): -- GitLab From 805746b5e52253b7660faab280597272e41fc222 Mon Sep 17 00:00:00 2001 From: sesen Date: Fri, 4 Nov 2022 21:03:52 +0100 Subject: [PATCH 4/5] fix test functions --- Phys/FunTuple/tests/test_functions.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Phys/FunTuple/tests/test_functions.py b/Phys/FunTuple/tests/test_functions.py index 3935379b3..22694a295 100644 --- a/Phys/FunTuple/tests/test_functions.py +++ b/Phys/FunTuple/tests/test_functions.py @@ -12,7 +12,7 @@ import sys import pytest -from PyConf.application import make_data_with_FetchDataFromFile +from PyConf.application import make_data_with_FetchDataFromFile, default_raw_event import Functors as F from FunTuple import FunctorCollection @@ -121,7 +121,9 @@ def test_with_event_variables(data_handle, func_name, name_argument): """ Check that event variables passed as an optional argument are dealt with correctly. """ - with get_odin.bind(process="Hlt2", stream="", input_raw_format=0.5): + + with default_raw_event.bind(raw_event_format=0.5),\ + get_odin.bind(process="Hlt2", stream=""): event_variables = EventInfo(extra_info=True) tuple = getattr(this_module, func_name)( -- GitLab From f3eedb8a7f3879b192bcab69410c74d2446bfdff Mon Sep 17 00:00:00 2001 From: Gitlab CI Date: Fri, 4 Nov 2022 20:04:33 +0000 Subject: [PATCH 5/5] Fixed formatting patch generated by https://gitlab.cern.ch/lhcb/Analysis/-/jobs/25620812 --- Phys/FunTuple/tests/test_functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Phys/FunTuple/tests/test_functions.py b/Phys/FunTuple/tests/test_functions.py index 22694a295..9f58a533e 100644 --- a/Phys/FunTuple/tests/test_functions.py +++ b/Phys/FunTuple/tests/test_functions.py @@ -121,7 +121,7 @@ def test_with_event_variables(data_handle, func_name, name_argument): """ Check that event variables passed as an optional argument are dealt with correctly. """ - + with default_raw_event.bind(raw_event_format=0.5),\ get_odin.bind(process="Hlt2", stream=""): event_variables = EventInfo(extra_info=True) -- GitLab