From b8a14c157348de29272b7e91e36688c9e105bbeb Mon Sep 17 00:00:00 2001 From: Stefano Serafin <serafin@jet01.img.univie.ac.at> Date: Wed, 12 Mar 2025 16:36:25 +0100 Subject: [PATCH] Combined load_or_run and get_experiment into a single function, for clarity --- PE_CBL.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/PE_CBL.py b/PE_CBL.py index 7b7ccee..0445b00 100644 --- a/PE_CBL.py +++ b/PE_CBL.py @@ -12,7 +12,10 @@ from ENDA import experiment from PE_CBL_models import CBL from PE_CBL_graphics import * -def load_or_run(settings): +def get_experiment(settings_file): + + with open(settings_file, 'r') as fp: + settings = json.load(fp) try: exp = pickle.load(open(settings['path']+'/'+settings['filename'], "rb")) @@ -24,14 +27,6 @@ def load_or_run(settings): return exp -def get_experiment(settings_file): - - with open(settings_file, 'r') as fp: - settings = json.load(fp) - exp = load_or_run(settings) - - return exp - if __name__ == '__main__': workdir = "./runs/seed=181612_enssize=200_EAKF_6hrs/" @@ -41,7 +36,6 @@ if __name__ == '__main__': if not os.path.exists(workdir): os.makedirs(workdir) - ################################################################################## # Check if the necessary config files exist in the working directory. # If not, copy them. # for src in args[:-1]: -- GitLab