From 942ba19546be73082e7066458fba8fc940f7d52b Mon Sep 17 00:00:00 2001 From: Arthur Loureiro Date: Fri, 8 Dec 2023 10:38:19 +0100 Subject: [PATCH] added Jessie's hack to avoid params values to be printed to the screen --- src/blind_2pt_cosmosis/run_cosmosis_2pt.py | 12 ++++++++++++ tests/test_run_cosmosis_2pt.py | 1 - 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/blind_2pt_cosmosis/run_cosmosis_2pt.py b/src/blind_2pt_cosmosis/run_cosmosis_2pt.py index 7986f93..901da5b 100644 --- a/src/blind_2pt_cosmosis/run_cosmosis_2pt.py +++ b/src/blind_2pt_cosmosis/run_cosmosis_2pt.py @@ -12,6 +12,18 @@ def setup_pipeline(inifile, angles_file=None, nz_file=None): Initialize and set up the Cosmosis pipeline. """ ini = Inifile(inifile) + # These are necessary to make sure that the pipeline doesn't + # accidentally print information we are trying to conceal + if 'test' in ini.__dict__['_sections'].keys(): + ini.__dict__['_sections']['test']['save_dir']='' + if 'output' in ini.__dict__['_sections'].keys(): + ini.__dict__['_sections']['output']['filename']='' + ini.__dict__['_sections']['pipeline']['debug']='F' + ini.__dict__['_sections']['pipeline']['quiet']='T' + + if 'camb' in ini.__dict__['_sections'].keys(): + ini.__dict__['_sections']['camb']['feedback']=0 + # Modify settings to suppress unnecessary outputs ini = modify_settings(ini, angles_file, nz_file) pipeline = LikelihoodPipeline(ini) diff --git a/tests/test_run_cosmosis_2pt.py b/tests/test_run_cosmosis_2pt.py index fa5060d..1f188fe 100644 --- a/tests/test_run_cosmosis_2pt.py +++ b/tests/test_run_cosmosis_2pt.py @@ -62,7 +62,6 @@ def test_setup_pipeline(): # Setup inifile = './src/blind_2pt_cosmosis/cosmosis_files/default_blinding_template.ini' angles_file = './src/blind_2pt_cosmosis/cosmosis_files/sim_fiducial.fits' - nz_file = './src/blind_2pt_cosmosis/cosmosis_files/sim_fiducial.fits' # Exercise pipeline = setup_pipeline(inifile)