Skip to content

Commit

Permalink
Resolving conflicts after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
DanSava committed Sep 30, 2024
1 parent 9522b96 commit 62098c7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 29 deletions.
26 changes: 0 additions & 26 deletions src/ert/config/ert_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
parse as parse_observations,
)
from .queue_config import QueueConfig
from .summary_config import SummaryConfig
from .workflow import Workflow
from .workflow_job import ErtScriptLoadFailure, WorkflowJob

Expand Down Expand Up @@ -318,31 +317,6 @@ def from_dict(cls, config_dict) -> Self:
for key, val in config_dict.get("SETENV", []):
env_vars[key] = val

forward_model_steps = cls._create_list_of_forward_model_steps_to_run(
installed_forward_model_steps,
substitution_list,
config_dict,
)

simulation_step_exists = False
for step in forward_model_steps:
for name in ["eclipse", "flow"]:
if name in step.name.lower():
simulation_step_exists = True
break
if simulation_step_exists:
break

has_summary_config = any(
isinstance(config, SummaryConfig)
for config in ensemble_config.response_configuration
)

if has_summary_config and not simulation_step_exists:
ConfigWarning.warn(
"Config contians a SUMMARY key but no simulation job known to generate a summary file detected in the forward model"
)

return cls(
substitution_list=substitution_list,
ensemble_config=ensemble_config,
Expand Down
17 changes: 15 additions & 2 deletions src/ert/config/summary_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from ._read_summary import read_summary
from .ensemble_config import Refcase
from .parsing import ConfigDict, ConfigKeys
from .parsing.config_errors import ConfigValidationError
from .parsing.config_errors import ConfigValidationError, ConfigWarning
from .response_config import ResponseConfig
from .responses_index import responses_index

Expand Down Expand Up @@ -67,7 +67,20 @@ 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, [])

Check failure on line 70 in src/ert/config/summary_config.py

View workflow job for this annotation

GitHub Actions / type-checking (3.12)

No overload variant of "get" of "dict" matches argument types "ConfigKeys", "list[Never]"
names = [step[0] for step in forward_model]
simulation_step_exists = False
for job_name in names:
for name in ["eclipse", "flow"]:
if name in job_name.lower():
simulation_step_exists = True
break
if simulation_step_exists:
break
if not simulation_step_exists:
ConfigWarning.warn(
"Config contains a SUMMARY key but no forward model steps known to generate a summary file"
)
return cls(
name="summary",
input_files=[eclbase.replace("%d", "<IENS>")],
Expand Down
2 changes: 1 addition & 1 deletion tests/ert/unit_tests/config/test_ert_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1638,7 +1638,7 @@ def test_warning_raised_when_summary_key_and_no_simulation_job_present(caplog, r
assert issubclass(recwarn[0].category, ConfigWarning)
assert (
recwarn[0].message.info.message
== "Config contians a SUMMARY key but no simulation job known to generate a summary file detected in the forward model"
== "Config contains a SUMMARY key but no forward model steps known to generate a summary file"
)


Expand Down

0 comments on commit 62098c7

Please sign in to comment.