From 5a0ff5f28e60d171200bf52d919161ffc806fe1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Berland?= Date: Mon, 13 Jan 2025 07:36:09 +0100 Subject: [PATCH] Adapt everest to run_reservoirsimulator This is a fixup of a regression from 1ae12f6efb66e9fa4208faef2a04898043cdcb37 --- .github/workflows/test_ert_with_flow.yml | 1 - src/everest/simulator/everest_to_ert.py | 13 ++++++++++++- tests/everest/test_egg_simulation.py | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_ert_with_flow.yml b/.github/workflows/test_ert_with_flow.yml index c1256860d18..d46c9b91dfa 100644 --- a/.github/workflows/test_ert_with_flow.yml +++ b/.github/workflows/test_ert_with_flow.yml @@ -57,7 +57,6 @@ jobs: - name: Run Everest on an example configuration with flow run: | - set +e pushd test-data/everest/egg/everest/model everest lint config_flow.yml everest run config_flow.yml diff --git a/src/everest/simulator/everest_to_ert.py b/src/everest/simulator/everest_to_ert.py index 9af43c8d6b1..b1ac72bc962 100644 --- a/src/everest/simulator/everest_to_ert.py +++ b/src/everest/simulator/everest_to_ert.py @@ -414,7 +414,18 @@ def _extract_forward_model(ever_config: EverestConfig, ert_config): fm_steps = ert_config.get(ErtConfigKeys.FORWARD_MODEL, []) for job in forward_model: job_name, *args = job.split() - fm_steps.append([job_name, args]) + match job_name: + # All three reservoir simulator fm_steps map to + # "run_reservoirsimulator" which requires the simulator name + # as its first argument. + case "eclipse100": + fm_steps.append(["eclipse100", ["eclipse", *args]]) + case "eclipse300": + fm_steps.append(["eclipse300", ["e300", *args]]) + case "flow": + fm_steps.append(["flow", ["flow", *args]]) + case _: + fm_steps.append([job_name, args]) ert_config[ErtConfigKeys.FORWARD_MODEL] = fm_steps diff --git a/tests/everest/test_egg_simulation.py b/tests/everest/test_egg_simulation.py index 8494c9d52b1..97111480e78 100644 --- a/tests/everest/test_egg_simulation.py +++ b/tests/everest/test_egg_simulation.py @@ -540,7 +540,7 @@ def _generate_exp_ert_config(config_path, output_dir): ], [ "eclipse100", - ["eclipse/model/EGG.DATA", "--version", "2020.2"], + ["eclipse", "eclipse/model/EGG.DATA", "--version", "2020.2"], ], ["rf", ["-s", "eclipse/model/EGG", "-o", "rf"]], ],