From 8f8a329e12fcaf826b5914f98f51a2133cbc6564 Mon Sep 17 00:00:00 2001 From: DanSava Date: Wed, 27 Nov 2024 10:48:10 +0200 Subject: [PATCH] Fix everest output folder rolling If ert config is initialized before execution rolling logic we end up with two everest output folders the current one and an empty rolled one. --- src/everest/bin/everest_script.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/everest/bin/everest_script.py b/src/everest/bin/everest_script.py index 34ba86af2e3..f1c11320c3c 100755 --- a/src/everest/bin/everest_script.py +++ b/src/everest/bin/everest_script.py @@ -52,15 +52,6 @@ def everest_entry(args=None): partial(handle_keyboard_interrupt, options=options), ) - # Validate ert config - try: - _ = everest_to_ert_config(options.config) - except ValueError as exc: - raise SystemExit(f"Config validation error: {exc}") from exc - - if EverestRunModel.create(options.config).check_if_runpath_exists(): - warn_user_that_runpath_is_nonempty() - asyncio.run(run_everest(options)) @@ -116,6 +107,16 @@ async def run_everest(options): logger.info("Everest forward model contains job {}".format(job_name)) makedirs_if_needed(options.config.output_dir, roll_if_exists=True) + + # Validate ert config + try: + _ = everest_to_ert_config(options.config) + except ValueError as exc: + raise SystemExit(f"Config validation error: {exc}") from exc + + if EverestRunModel.create(options.config).check_if_runpath_exists(): + warn_user_that_runpath_is_nonempty() + try: output_dir = options.config.output_dir config_file = options.config.config_file