From 0d1430ed21320779649478c0617ec0401260d722 Mon Sep 17 00:00:00 2001 From: DanSava Date: Fri, 29 Nov 2024 13:27:18 +0200 Subject: [PATCH] Add also the simulation jobs to the list of possible simulator instances. Everest is adding SIMULATION_JOB key and not FORWARD_MODEL key for the steps in the forward model --- src/ert/config/summary_config.py | 5 +++-- .../ert/unit_tests/config/test_ert_config.py | 20 ++++++++++++++----- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/ert/config/summary_config.py b/src/ert/config/summary_config.py index 5701a6f26ce..bff347a6b87 100644 --- a/src/ert/config/summary_config.py +++ b/src/ert/config/summary_config.py @@ -82,8 +82,9 @@ def from_config_dict(cls, config_dict: ConfigDict) -> Optional[SummaryConfig]: "In order to use summary responses, ECLBASE has to be set." ) time_map = set(refcase.dates) if refcase is not None else None - forward_model = config_dict.get(ConfigKeys.FORWARD_MODEL, []) - names = [fm_step[0] for fm_step in forward_model] + fm_steps = config_dict.get(ConfigKeys.FORWARD_MODEL, []) + sim_steps = config_dict.get(ConfigKeys.SIMULATION_JOB, []) + names = [fm_step[0] for fm_step in fm_steps + sim_steps] simulation_step_exists = any( any(sim in _name.lower() for sim in ["eclipse", "flow"]) for _name in names diff --git a/tests/ert/unit_tests/config/test_ert_config.py b/tests/ert/unit_tests/config/test_ert_config.py index 439df410123..da3c2450c09 100644 --- a/tests/ert/unit_tests/config/test_ert_config.py +++ b/tests/ert/unit_tests/config/test_ert_config.py @@ -1820,10 +1820,22 @@ def test_warning_raised_when_summary_key_and_no_simulation_job_present(): @pytest.mark.parametrize( - "job_name", ["eclipse", "eclipse100", "flow", "FLOW", "ECLIPSE100"] + "job_name, key", + [ + ("eclipse", "FORWARD_MODEL"), + ("eclipse100", "FORWARD_MODEL"), + ("flow", "FORWARD_MODEL"), + ("FLOW", "FORWARD_MODEL"), + ("ECLIPSE100", "FORWARD_MODEL"), + ("eclipse", "SIMULATION_JOB"), + ("eclipse100", "SIMULATION_JOB"), + ("flow", "SIMULATION_JOB"), + ("FLOW", "SIMULATION_JOB"), + ("ECLIPSE100", "SIMULATION_JOB"), + ], ) @pytest.mark.usefixtures("use_tmpdir") -def test_no_warning_when_summary_key_and_simulation_job_present(job_name): +def test_no_warning_when_summary_key_and_simulation_job_present(job_name, key): with open("job_file", "w", encoding="utf-8") as fout: fout.write("EXECUTABLE echo\nARGLIST \n") @@ -1834,9 +1846,7 @@ def test_no_warning_when_summary_key_and_simulation_job_present(job_name): fout.write("ECLBASE RESULT_SUMMARY\n") fout.write(f"INSTALL_JOB {job_name} job_file\n") - fout.write( - f"FORWARD_MODEL {job_name}(=A/, =/x)\n" - ) + fout.write(f"{key} {job_name} (=A/, =/x)\n") # Check no warning is logged when config contains # forward model step with and as arguments with warnings.catch_warnings():