From ee99fbdecf349aef57bdedd84e6bd00d25fb3bcb Mon Sep 17 00:00:00 2001 From: Dirk Zerwas Date: Mon, 9 Dec 2024 16:31:14 +0100 Subject: [PATCH 1/9] dynamical Generator loading --- python/Generators/Generators.py | 107 +++++++++++++++++++------------- 1 file changed, 63 insertions(+), 44 deletions(-) diff --git a/python/Generators/Generators.py b/python/Generators/Generators.py index c757270..1ad7c35 100644 --- a/python/Generators/Generators.py +++ b/python/Generators/Generators.py @@ -1,3 +1,5 @@ +import importlib + from . import Sherpa from . import Whizard from . import Madgraph @@ -22,49 +24,66 @@ def set_process_info(self, proc_info): self.proc_info = proc_info def initialize_generators(self): - if "Sherpa" in self.generator_list: - if Sherpa is not None: - self.sherpa = Sherpa.Sherpa(self.proc_info, self.settings) - self.sherpa.write_file() - self.sherpa.write_key4hepfile() - else: - print("Sherpa module not found. Unable to initialize Sherpa.") - if "Whizard" in self.generator_list: - if Whizard is not None: - self.whizard = Whizard.Whizard(self.proc_info, self.settings) - self.whizard.write_file() - self.whizard.write_key4hepfile() - else: - print("Whizard module not found. Unable to initialize Whizard.") - - if "Madgraph" in self.generator_list: - if Madgraph is not None: - self.madgraph = Madgraph.Madgraph(self.proc_info, self.settings) - self.madgraph.write_file() - self.madgraph.write_key4hepfile() - else: - print("Madgraph module not found. Unable to initialize Madgraph.") - - if "Babayaga" in self.generator_list: - if Babayaga is not None: - self.babayaga = Babayaga.Babayaga(self.proc_info, self.settings) - self.babayaga.write_file() - self.babayaga.write_key4hepfile() - else: - print("Babayaga module not found. Unable to initialize Babayaga.") - if "KKMC" in self.generator_list: - if KKMC is not None: - self.kkmc = KKMC.KKMC(self.proc_info, self.settings) - self.kkmc.write_file() - self.kkmc.write_key4hepfile() - else: - print("KKMC module not found. Unable to initialize KKMC.") + for generatorName in self.generator_list: + # get the module + try: + generator = importlib.import_module(generatorName) + # get the ClassObject + generatorClass = getattr(generator,generatorName) + # execute the object + generatorObj = generatorClass(self.proc_info, self.settings) + #writing file + generatorObj.write_file() + #writing key4hep file + generatorObj.write_key4hepfile() + except: + print("Requested enerator: "+generatorName+" could not be configured") - if "Pythia" in self.generator_list: - if Pythia is not None: - self.pythia = Pythia.Pythia(self.proc_info, self.settings) - self.pythia.write_file() - self.pythia.write_key4hepfile() - else: - print("Pythia module not found. Unable to initialize Pythia.") + +# if "Sherpa" in self.generator_list: +# if Sherpa is not None: +# self.sherpa = Sherpa.Sherpa(self.proc_info, self.settings) +# self.sherpa.write_file() +# self.sherpa.write_key4hepfile() +# else: +# print("Sherpa module not found. Unable to initialize Sherpa.") +# if "Whizard" in self.generator_list: +# if Whizard is not None: +# self.whizard = Whizard.Whizard(self.proc_info, self.settings) +# self.whizard.write_file() +# self.whizard.write_key4hepfile() +# else: +# print("Whizard module not found. Unable to initialize Whizard.") +# +# if "Madgraph" in self.generator_list: +# if Madgraph is not None: +# self.madgraph = Madgraph.Madgraph(self.proc_info, self.settings) +# self.madgraph.write_file() +# self.madgraph.write_key4hepfile() +# else: +# print("Madgraph module not found. Unable to initialize Madgraph.") +# +# if "Babayaga" in self.generator_list: +# if Babayaga is not None: +# self.babayaga = Babayaga.Babayaga(self.proc_info, self.settings) +# self.babayaga.write_file() +# self.babayaga.write_key4hepfile() +# else: +# print("Babayaga module not found. Unable to initialize Babayaga.") +# +# if "KKMC" in self.generator_list: +# if KKMC is not None: +# self.kkmc = KKMC.KKMC(self.proc_info, self.settings) +# self.kkmc.write_file() +# self.kkmc.write_key4hepfile() +# else: +# print("KKMC module not found. Unable to initialize KKMC.") +# +# if "Pythia" in self.generator_list: +# if Pythia is not None: +# self.pythia = Pythia.Pythia(self.proc_info, self.settings) +# self.pythia.write_file() +# self.pythia.write_key4hepfile() +# else: +# print("Pythia module not found. Unable to initialize Pythia.") From 60854a52505c508c8b0f1231dbe3f97b7b08a2de Mon Sep 17 00:00:00 2001 From: Dirk Zerwas Date: Mon, 9 Dec 2024 16:37:53 +0100 Subject: [PATCH 2/9] update paths for Sherpa --- python/Generators/Sherpa.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/Generators/Sherpa.py b/python/Generators/Sherpa.py index 0644250..582aa58 100644 --- a/python/Generators/Sherpa.py +++ b/python/Generators/Sherpa.py @@ -1,5 +1,5 @@ -from .GeneratorBase import GeneratorBase -from . import SherpaProcDB +from GeneratorBase import GeneratorBase +from SherpaProcDB import SherpaProcDB class Sherpa(GeneratorBase): @@ -12,7 +12,7 @@ def __init__(self, procinfo, settings): self.file = "" self.cuts = "" - self.procDB = SherpaProcDB.SherpaProcDB(self.procinfo) + self.procDB = SherpaProcDB(self.procinfo) if settings.get("usedefaults", True): self.procDB.write_DBInfo() From d74dc8c4199276a0f3fb795811612c07e2ff5765 Mon Sep 17 00:00:00 2001 From: Dirk Zerwas Date: Mon, 9 Dec 2024 16:47:00 +0100 Subject: [PATCH 3/9] change import for dynamic loading --- python/Generators/Babayaga.py | 6 +++--- python/Generators/KKMC.py | 6 +++--- python/Generators/Madgraph.py | 6 +++--- python/Generators/Pythia.py | 6 +++--- python/Generators/Whizard.py | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/python/Generators/Babayaga.py b/python/Generators/Babayaga.py index 52c02e9..7158b83 100644 --- a/python/Generators/Babayaga.py +++ b/python/Generators/Babayaga.py @@ -1,5 +1,5 @@ -from .GeneratorBase import GeneratorBase -from . import BabayagaProcDB +from GeneratorBase import GeneratorBase +from BabayagaProcDB import BabayagaProcDB class Babayaga(GeneratorBase): @@ -13,7 +13,7 @@ def __init__(self, procinfo, settings): self.process = "" self.cuts = "" - self.procDB = BabayagaProcDB.BabayagaProcDB(self.procinfo) + self.procDB = BabayagaProcDB(self.procinfo) if settings.get("usedefaults", True): self.procDB.write_DBInfo() diff --git a/python/Generators/KKMC.py b/python/Generators/KKMC.py index be347e2..eecf5cd 100644 --- a/python/Generators/KKMC.py +++ b/python/Generators/KKMC.py @@ -1,5 +1,5 @@ -from .GeneratorBase import GeneratorBase -from . import KKMCProcDB +from GeneratorBase import GeneratorBase +from KKMCProcDB import KKMCProcDB import os, sys @@ -14,7 +14,7 @@ def __init__(self, procinfo, settings): self.process = "" self.cuts = "" - self.procDB = KKMCProcDB.KKMCProcDB(self.procinfo) + self.procDB = KKMCProcDB(self.procinfo) if settings.get("usedefaults", True): self.procDB.write_DBInfo() diff --git a/python/Generators/Madgraph.py b/python/Generators/Madgraph.py index 0d97c45..deb5604 100644 --- a/python/Generators/Madgraph.py +++ b/python/Generators/Madgraph.py @@ -1,5 +1,5 @@ -from .GeneratorBase import GeneratorBase -from . import MadgraphProcDB +from GeneratorBase import GeneratorBase +from MadgraphProcDB import MadgraphProcDB from Particles import Particle as part @@ -14,7 +14,7 @@ def __init__(self, procinfo, settings): self.add_header() self.executable = "mg5_aMC" - self.procDB = MadgraphProcDB.MadgraphProcDB(self.procinfo) + self.procDB = MadgraphProcDB(self.procinfo) if settings.get("usedefaults", True): self.procDB.write_DBInfo() diff --git a/python/Generators/Pythia.py b/python/Generators/Pythia.py index 8ebd1bc..eac4bf2 100644 --- a/python/Generators/Pythia.py +++ b/python/Generators/Pythia.py @@ -1,5 +1,5 @@ -from .GeneratorBase import GeneratorBase -from . import PythiaProcDB +from GeneratorBase import GeneratorBase +from PythiaProcDB import PythiaProcDB class Pythia(GeneratorBase): @@ -13,7 +13,7 @@ def __init__(self, procinfo, settings): self.cuts = "" self.PythiaSelectorFileExtension = "selectors" - self.procDB = PythiaProcDB.PythiaProcDB(self.procinfo) + self.procDB = PythiaProcDB(self.procinfo) if settings.get("usedefaults", True): self.procDB.write_DBInfo() diff --git a/python/Generators/Whizard.py b/python/Generators/Whizard.py index 6a34e3c..261815b 100644 --- a/python/Generators/Whizard.py +++ b/python/Generators/Whizard.py @@ -1,5 +1,5 @@ -from .GeneratorBase import GeneratorBase -from . import WhizardProcDB +from GeneratorBase import GeneratorBase +from WhizardProcDB import WhizardProcDB class Whizard(GeneratorBase): @@ -13,7 +13,7 @@ def __init__(self, procinfo, settings): self.cuts = "" self.integrate = "" - self.procDB = WhizardProcDB.WhizardProcDB(self.procinfo) + self.procDB = WhizardProcDB(self.procinfo) if settings.get("usedefaults", True): self.procDB.write_DBInfo() From 0e4b11c4711d6688785d28371a2b54b4eaca333b Mon Sep 17 00:00:00 2001 From: Dirk Zerwas Date: Mon, 9 Dec 2024 17:44:31 +0100 Subject: [PATCH 4/9] clean up and make error more verbose --- python/Generators/Generators.py | 55 +-------------------------------- 1 file changed, 1 insertion(+), 54 deletions(-) diff --git a/python/Generators/Generators.py b/python/Generators/Generators.py index 1ad7c35..f58e629 100644 --- a/python/Generators/Generators.py +++ b/python/Generators/Generators.py @@ -14,11 +14,6 @@ class Generators: def __init__(self, settings): self.settings = settings self.generator_list = settings.gens() - self.sherpa = None - self.whizard = None - self.madgraph = None - self.babayaga = None - self.proc_info = None def set_process_info(self, proc_info): self.proc_info = proc_info @@ -38,52 +33,4 @@ def initialize_generators(self): #writing key4hep file generatorObj.write_key4hepfile() except: - print("Requested enerator: "+generatorName+" could not be configured") - - -# if "Sherpa" in self.generator_list: -# if Sherpa is not None: -# self.sherpa = Sherpa.Sherpa(self.proc_info, self.settings) -# self.sherpa.write_file() -# self.sherpa.write_key4hepfile() -# else: -# print("Sherpa module not found. Unable to initialize Sherpa.") -# if "Whizard" in self.generator_list: -# if Whizard is not None: -# self.whizard = Whizard.Whizard(self.proc_info, self.settings) -# self.whizard.write_file() -# self.whizard.write_key4hepfile() -# else: -# print("Whizard module not found. Unable to initialize Whizard.") -# -# if "Madgraph" in self.generator_list: -# if Madgraph is not None: -# self.madgraph = Madgraph.Madgraph(self.proc_info, self.settings) -# self.madgraph.write_file() -# self.madgraph.write_key4hepfile() -# else: -# print("Madgraph module not found. Unable to initialize Madgraph.") -# -# if "Babayaga" in self.generator_list: -# if Babayaga is not None: -# self.babayaga = Babayaga.Babayaga(self.proc_info, self.settings) -# self.babayaga.write_file() -# self.babayaga.write_key4hepfile() -# else: -# print("Babayaga module not found. Unable to initialize Babayaga.") -# -# if "KKMC" in self.generator_list: -# if KKMC is not None: -# self.kkmc = KKMC.KKMC(self.proc_info, self.settings) -# self.kkmc.write_file() -# self.kkmc.write_key4hepfile() -# else: -# print("KKMC module not found. Unable to initialize KKMC.") -# -# if "Pythia" in self.generator_list: -# if Pythia is not None: -# self.pythia = Pythia.Pythia(self.proc_info, self.settings) -# self.pythia.write_file() -# self.pythia.write_key4hepfile() -# else: -# print("Pythia module not found. Unable to initialize Pythia.") + print("Requested Generator: "+generatorName+" could not be configured for "+self.proc_info.get("_proclabel")) From 7781de3ffe7c0614e3b2c85cdeeb446eb95337e3 Mon Sep 17 00:00:00 2001 From: Dirk Zerwas Date: Mon, 16 Dec 2024 15:02:48 +0100 Subject: [PATCH 5/9] update to follow Thomas syntax suggestion --- python/Generators/Babayaga.py | 4 ++-- python/Generators/Generators.py | 11 ++--------- python/Generators/KKMC.py | 4 ++-- python/Generators/Madgraph.py | 4 ++-- python/Generators/Pythia.py | 4 ++-- python/Generators/Sherpa.py | 4 ++-- python/Generators/Whizard.py | 4 ++-- 7 files changed, 14 insertions(+), 21 deletions(-) diff --git a/python/Generators/Babayaga.py b/python/Generators/Babayaga.py index 7158b83..89d9c38 100644 --- a/python/Generators/Babayaga.py +++ b/python/Generators/Babayaga.py @@ -1,5 +1,5 @@ -from GeneratorBase import GeneratorBase -from BabayagaProcDB import BabayagaProcDB +from .GeneratorBase import GeneratorBase +from . import BabayagaProcDB class Babayaga(GeneratorBase): diff --git a/python/Generators/Generators.py b/python/Generators/Generators.py index f58e629..4eebf3f 100644 --- a/python/Generators/Generators.py +++ b/python/Generators/Generators.py @@ -1,13 +1,5 @@ import importlib -from . import Sherpa -from . import Whizard -from . import Madgraph -from . import Babayaga -from . import KKMC -from . import Pythia - - class Generators: """Generator class""" @@ -23,7 +15,8 @@ def initialize_generators(self): for generatorName in self.generator_list: # get the module try: - generator = importlib.import_module(generatorName) + # import the generators + generator = importlib.import_module(f"Generators.{generatorName}") # get the ClassObject generatorClass = getattr(generator,generatorName) # execute the object diff --git a/python/Generators/KKMC.py b/python/Generators/KKMC.py index eecf5cd..99a4a0d 100644 --- a/python/Generators/KKMC.py +++ b/python/Generators/KKMC.py @@ -1,5 +1,5 @@ -from GeneratorBase import GeneratorBase -from KKMCProcDB import KKMCProcDB +from .GeneratorBase import GeneratorBase +from . import KKMCProcDB import os, sys diff --git a/python/Generators/Madgraph.py b/python/Generators/Madgraph.py index deb5604..d403079 100644 --- a/python/Generators/Madgraph.py +++ b/python/Generators/Madgraph.py @@ -1,5 +1,5 @@ -from GeneratorBase import GeneratorBase -from MadgraphProcDB import MadgraphProcDB +from .GeneratorBase import GeneratorBase +from . import MadgraphProcDB from Particles import Particle as part diff --git a/python/Generators/Pythia.py b/python/Generators/Pythia.py index eac4bf2..3c575ad 100644 --- a/python/Generators/Pythia.py +++ b/python/Generators/Pythia.py @@ -1,5 +1,5 @@ -from GeneratorBase import GeneratorBase -from PythiaProcDB import PythiaProcDB +from .GeneratorBase import GeneratorBase +from . import PythiaProcDB class Pythia(GeneratorBase): diff --git a/python/Generators/Sherpa.py b/python/Generators/Sherpa.py index 582aa58..924a6ab 100644 --- a/python/Generators/Sherpa.py +++ b/python/Generators/Sherpa.py @@ -1,5 +1,5 @@ -from GeneratorBase import GeneratorBase -from SherpaProcDB import SherpaProcDB +from .GeneratorBase import GeneratorBase +from . import SherpaProcDB class Sherpa(GeneratorBase): diff --git a/python/Generators/Whizard.py b/python/Generators/Whizard.py index 261815b..659b9f1 100644 --- a/python/Generators/Whizard.py +++ b/python/Generators/Whizard.py @@ -1,5 +1,5 @@ -from GeneratorBase import GeneratorBase -from WhizardProcDB import WhizardProcDB +from .GeneratorBase import GeneratorBase +from . import WhizardProcDB class Whizard(GeneratorBase): From 3daa014ece6631acba25a679f05f4c7f846ec8b3 Mon Sep 17 00:00:00 2001 From: Dirk Zerwas Date: Mon, 16 Dec 2024 18:59:37 +0100 Subject: [PATCH 6/9] getting full dynamic loading of generators to run --- python/Generators/Babayaga.py | 2 +- python/Generators/Generators.py | 23 ++++++++++++++--------- python/Generators/KKMC.py | 2 +- python/Generators/Madgraph.py | 2 +- python/Generators/Pythia.py | 2 +- python/Generators/Sherpa.py | 5 +++-- python/Generators/Whizard.py | 2 +- 7 files changed, 22 insertions(+), 16 deletions(-) diff --git a/python/Generators/Babayaga.py b/python/Generators/Babayaga.py index 89d9c38..bedbc72 100644 --- a/python/Generators/Babayaga.py +++ b/python/Generators/Babayaga.py @@ -1,5 +1,5 @@ from .GeneratorBase import GeneratorBase -from . import BabayagaProcDB +from .BabayagaProcDB import BabayagaProcDB class Babayaga(GeneratorBase): diff --git a/python/Generators/Generators.py b/python/Generators/Generators.py index 4eebf3f..f9866ce 100644 --- a/python/Generators/Generators.py +++ b/python/Generators/Generators.py @@ -15,15 +15,20 @@ def initialize_generators(self): for generatorName in self.generator_list: # get the module try: - # import the generators generator = importlib.import_module(f"Generators.{generatorName}") # get the ClassObject - generatorClass = getattr(generator,generatorName) - # execute the object - generatorObj = generatorClass(self.proc_info, self.settings) - #writing file - generatorObj.write_file() - #writing key4hep file - generatorObj.write_key4hepfile() + if hasattr(generator,generatorName): + generatorClass = getattr(generator,generatorName) + # execute the object + try: + generatorObj = generatorClass(self.proc_info, self.settings) + #writing file + generatorObj.write_file() + #writing key4hep file + generatorObj.write_key4hepfile() + except: + print(f"Requested Generator: {generatorName} object could not be executed, output files not written for {self.proc_info.get('_proclabel')}") + else: + print(f"Requested Generator: {generatorName} class could not be loaded via getattr {self.proc_info.get('_proclabel')}") except: - print("Requested Generator: "+generatorName+" could not be configured for "+self.proc_info.get("_proclabel")) + print(f"Requested Generator: {generatorName} could not be configured for {self.proc_info.get('_proclabel')}") diff --git a/python/Generators/KKMC.py b/python/Generators/KKMC.py index 99a4a0d..2fa5d9d 100644 --- a/python/Generators/KKMC.py +++ b/python/Generators/KKMC.py @@ -1,5 +1,5 @@ from .GeneratorBase import GeneratorBase -from . import KKMCProcDB +from .KKMCProcDB import KKMCProcDB import os, sys diff --git a/python/Generators/Madgraph.py b/python/Generators/Madgraph.py index d403079..c3972e5 100644 --- a/python/Generators/Madgraph.py +++ b/python/Generators/Madgraph.py @@ -1,5 +1,5 @@ from .GeneratorBase import GeneratorBase -from . import MadgraphProcDB +from .MadgraphProcDB import MadgraphProcDB from Particles import Particle as part diff --git a/python/Generators/Pythia.py b/python/Generators/Pythia.py index 3c575ad..1c987d4 100644 --- a/python/Generators/Pythia.py +++ b/python/Generators/Pythia.py @@ -1,5 +1,5 @@ from .GeneratorBase import GeneratorBase -from . import PythiaProcDB +from .PythiaProcDB import PythiaProcDB class Pythia(GeneratorBase): diff --git a/python/Generators/Sherpa.py b/python/Generators/Sherpa.py index 924a6ab..4457257 100644 --- a/python/Generators/Sherpa.py +++ b/python/Generators/Sherpa.py @@ -1,5 +1,5 @@ from .GeneratorBase import GeneratorBase -from . import SherpaProcDB +from .SherpaProcDB import SherpaProcDB class Sherpa(GeneratorBase): @@ -7,7 +7,7 @@ class Sherpa(GeneratorBase): def __init__(self, procinfo, settings): super().__init__(procinfo, settings, "Sherpa", "dat") - + print("GOT INTO SHERPA") self.version = "x.y.z" self.file = "" self.cuts = "" @@ -15,6 +15,7 @@ def __init__(self, procinfo, settings): self.procDB = SherpaProcDB(self.procinfo) if settings.get("usedefaults", True): self.procDB.write_DBInfo() + print("SHERPA AFTER PROCDB") self.executable = "Sherpa -f" self.gen_settings = settings.get_block("sherpa") diff --git a/python/Generators/Whizard.py b/python/Generators/Whizard.py index 659b9f1..cdbad85 100644 --- a/python/Generators/Whizard.py +++ b/python/Generators/Whizard.py @@ -1,5 +1,5 @@ from .GeneratorBase import GeneratorBase -from . import WhizardProcDB +from .WhizardProcDB import WhizardProcDB class Whizard(GeneratorBase): From 1ff43b2c918472983faa71c23e0a213b81b46553 Mon Sep 17 00:00:00 2001 From: Dirk Zerwas Date: Tue, 17 Dec 2024 10:26:07 +0100 Subject: [PATCH 7/9] remove debug prints --- python/Generators/Sherpa.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python/Generators/Sherpa.py b/python/Generators/Sherpa.py index 4457257..d050e1d 100644 --- a/python/Generators/Sherpa.py +++ b/python/Generators/Sherpa.py @@ -7,7 +7,7 @@ class Sherpa(GeneratorBase): def __init__(self, procinfo, settings): super().__init__(procinfo, settings, "Sherpa", "dat") - print("GOT INTO SHERPA") + self.version = "x.y.z" self.file = "" self.cuts = "" @@ -15,7 +15,6 @@ def __init__(self, procinfo, settings): self.procDB = SherpaProcDB(self.procinfo) if settings.get("usedefaults", True): self.procDB.write_DBInfo() - print("SHERPA AFTER PROCDB") self.executable = "Sherpa -f" self.gen_settings = settings.get_block("sherpa") From 7827e0f1c57ea3be94ac468467b6cc6d0194904d Mon Sep 17 00:00:00 2001 From: Dirk Zerwas Date: Tue, 17 Dec 2024 15:35:48 +0100 Subject: [PATCH 8/9] Simplify structure of Generators steering by intelligent exception handling --- python/Generators/Generators.py | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/python/Generators/Generators.py b/python/Generators/Generators.py index f9866ce..c5b0d33 100644 --- a/python/Generators/Generators.py +++ b/python/Generators/Generators.py @@ -17,18 +17,19 @@ def initialize_generators(self): try: generator = importlib.import_module(f"Generators.{generatorName}") # get the ClassObject - if hasattr(generator,generatorName): - generatorClass = getattr(generator,generatorName) - # execute the object - try: - generatorObj = generatorClass(self.proc_info, self.settings) - #writing file - generatorObj.write_file() - #writing key4hep file - generatorObj.write_key4hepfile() - except: - print(f"Requested Generator: {generatorName} object could not be executed, output files not written for {self.proc_info.get('_proclabel')}") - else: - print(f"Requested Generator: {generatorName} class could not be loaded via getattr {self.proc_info.get('_proclabel')}") + generatorClass = getattr(generator,generatorName) + # execute the object + generatorObj = generatorClass(self.proc_info, self.settings) + #writing file + generatorObj.write_file() + #writing key4hep file + generatorObj.write_key4hepfile() + + except ModuleNotFoundError: + print(f"{generatorName} python module not found for {self.proc_info.get('_proclabel')}") + except AttributeError: + print(f"{generatorName} class could not be loaded with getattr for {self.proc_info.get('_proclabel')}") except: - print(f"Requested Generator: {generatorName} could not be configured for {self.proc_info.get('_proclabel')}") + # all that remains is an excption from the execution of the modules + print(f"Execution of {generatorName} for {self.proc_info.get('_proclabel')} resulted in an exception, check the module for problems with loading doownstream modules like the corresponding ProcDB etc") + print("Datacard files and execution scripts not written for this generator") From f535ed312d135eb0c95e2ce3e4c6366ec78faeb6 Mon Sep 17 00:00:00 2001 From: Dirk Zerwas <148551698+dirkzerwas@users.noreply.github.com> Date: Tue, 17 Dec 2024 17:11:47 +0100 Subject: [PATCH 9/9] Update python/Generators/Generators.py with raise after exception treatement Co-authored-by: Thomas Madlener --- python/Generators/Generators.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/Generators/Generators.py b/python/Generators/Generators.py index c5b0d33..6f42542 100644 --- a/python/Generators/Generators.py +++ b/python/Generators/Generators.py @@ -33,3 +33,4 @@ def initialize_generators(self): # all that remains is an excption from the execution of the modules print(f"Execution of {generatorName} for {self.proc_info.get('_proclabel')} resulted in an exception, check the module for problems with loading doownstream modules like the corresponding ProcDB etc") print("Datacard files and execution scripts not written for this generator") + raise