From a7d90b83afba6fff1843f88c1e3aaea43ebb140e Mon Sep 17 00:00:00 2001 From: mhostert Date: Fri, 25 Nov 2022 18:05:04 -0500 Subject: [PATCH] fixed path name for script test --- src/DarkNews/GenLauncher.py | 2 +- tests/test_scripts.py | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/DarkNews/GenLauncher.py b/src/DarkNews/GenLauncher.py index 2c8db83..8885c21 100644 --- a/src/DarkNews/GenLauncher.py +++ b/src/DarkNews/GenLauncher.py @@ -339,7 +339,7 @@ def __init__(self, param_file=None, **kwargs): # append all transition magnetic moments _TMMs = [ f'{x}_{getattr(self.bsm_model, x):.4g}_' for x in self.bsm_model.__dict__.keys() if ('mu_tr_' in x and getattr(self.bsm_model, x) != 0)] if len(_TMMs) > 0: - _boson_string = _boson_string.join(_TMMs) + _boson_string += ''.join(_TMMs) # HNL masses _mass_strings = [f'{m}_{getattr(self.bsm_model, m)}_' for m in ['m6', 'm5', 'm4'] if getattr(self.bsm_model, m) is not None] diff --git a/tests/test_scripts.py b/tests/test_scripts.py index 8fa44f2..1fdb76d 100644 --- a/tests/test_scripts.py +++ b/tests/test_scripts.py @@ -9,15 +9,18 @@ def test_dn_gen(): # dark photon os.system('dn_gen --path="./test_script_v1" --HNLtype="majorana" --make_summary_plots') + filename = 'test_script_v1/data/miniboone_fhc/3plus1/m4_0.15_mzprime_1.25_majorana/pandas_df.pckl' + assert os.path.exists(filename), f'Could not find dn_gen output in {filename}' + plots_path = 'test_script_v1/data/miniboone_fhc/3plus1/m4_0.15_mzprime_1.25_majorana/summary_plots' + assert os.path.exists(plots_path), f'Could not find summary plots in {plots_path}' + # now for TMM os.system('dn_gen --path="./test_script_v2" --HNLtype="majorana" --decay_product="photon" --mu_tr_mu4=1e-6 --make_summary_plots') - for i in range(1,3): - filename=f'test_script_v{i}/data/miniboone_fhc/3plus1/m4_0.15_mzprime_1.25_majorana/pandas_df.pckl' - assert os.path.exists(filename), f'Could not find dn_gen output in {filename}' - plots_path=f'test_script_v{i}/data/miniboone_fhc/3plus1/m4_0.15_mzprime_1.25_majorana/summary_plots' - assert os.path.exists(plots_path), f'Could not find summary plots in {plots_path}' - + filename = 'test_script_v2/data/miniboone_fhc/3plus1/m4_0.15_mzprime_1.25_mu_tr_mu4_1e-06_majorana/pandas_df.pckl' + assert os.path.exists(filename), f'Could not find dn_gen output in {filename}' + plots_path = 'test_script_v2/data/miniboone_fhc/3plus1/m4_0.15_mzprime_1.25_mu_tr_mu4_1e-06_majorana/summary_plots' + assert os.path.exists(plots_path), f'Could not find summary plots in {plots_path}' @pytest.mark.skip(reason="Still need to find a way to set up git for venvs") def test_examples_download():