Skip to content

Commit

Permalink
Remove superfluous layer in ert_config
Browse files Browse the repository at this point in the history
  • Loading branch information
AugustoMagalhaes committed Dec 15, 2024
1 parent ebe548e commit 361b84c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 32 deletions.
27 changes: 0 additions & 27 deletions src/ert/config/ert_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,33 +221,6 @@ def handle_default(fm_step: ForwardModelStep, arg: str) -> str:
}


def forward_model_data_to_json(
substitutions: Substitutions,
forward_model_steps: list[ForwardModelStep],
env_vars: dict[str, str],
env_pr_fm_step: dict[str, dict[str, Any]] | None = None,
user_config_file: str | None = "",
run_id: str | None = None,
iens: int = 0,
itr: int = 0,
context_env: dict[str, str] | None = None,
):
if context_env is None:
context_env = {}
if env_pr_fm_step is None:
env_pr_fm_step = {}
return create_forward_model_json(
context=substitutions,
forward_model_steps=forward_model_steps,
user_config_file=user_config_file,
env_vars={**env_vars, **context_env},
env_pr_fm_step=env_pr_fm_step,
run_id=run_id,
iens=iens,
itr=itr,
)


@dataclass
class ErtConfig:
DEFAULT_ENSPATH: ClassVar[str] = "storage"
Expand Down
9 changes: 4 additions & 5 deletions src/ert/enkf_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import xarray as xr
from numpy.random import SeedSequence

from ert.config.ert_config import forward_model_data_to_json
from ert.config.ert_config import create_forward_model_json
from ert.config.forward_model_step import ForwardModelStep
from ert.config.model_config import ModelConfig
from ert.substitutions import Substitutions, substitute_runpath_name
Expand Down Expand Up @@ -272,16 +272,15 @@ def create_run_path(
path = run_path / "jobs.json"
_backup_if_existing(path)

forward_model_output = forward_model_data_to_json(
substitutions=substitutions,
forward_model_output: dict[str, Any] = create_forward_model_json(
context=substitutions,
forward_model_steps=forward_model_steps,
user_config_file=user_config_file,
env_vars=env_vars,
env_vars={**env_vars, **context_env},
env_pr_fm_step=env_pr_fm_step,
run_id=run_arg.run_id,
iens=run_arg.iens,
itr=ensemble.iteration,
context_env=context_env,
)
with open(run_path / "jobs.json", mode="wb") as fptr:
fptr.write(
Expand Down

0 comments on commit 361b84c

Please sign in to comment.