Skip to content

Commit

Permalink
Fix everest output folder rolling
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
DanSava committed Nov 27, 2024
1 parent 25e431f commit 8f8a329
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/everest/bin/everest_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))


Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8f8a329

Please sign in to comment.