Skip to content

Commit

Permalink
FIX: Review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
mferrera committed Nov 6, 2024
1 parent d9ce6ec commit 6050b4c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
1 change: 1 addition & 0 deletions src/fmu/dataio/providers/_fmu.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ def _get_runpath_from_env() -> Path | None:

@staticmethod
def _get_ert_meta() -> fields.Ert:
"""Constructs the `Ert` Pydantic object for the `ert` metadata field."""
try:
sim_mode = ErtSimulationMode(FmuEnv.SIMULATION_MODE.value)
except ValueError:
Expand Down
6 changes: 3 additions & 3 deletions tests/data/snakeoil/export-a-surface
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ from fmu.config import utilities as ut


def main() -> None:
snakeoil_path = Path(sys.argv[1])
CFG = ut.yaml_load(snakeoil_path / "fmuconfig/output/global_variables.yml")
project_path = Path(sys.argv[1])
CFG = ut.yaml_load(project_path / "fmuconfig/output/global_variables.yml")
surf = xtgeo.surface_from_file(
snakeoil_path / "ert/output/maps/props/poro_average.gri"
project_path / "ert/output/maps/props/poro_average.gri"
)
dataio.ExportData(
config=CFG,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def fmu_snakeoil_project(
"STDERR EXPORT_A_SURFACE.stderr\n"
"STDOUT EXPORT_A_SURFACE.stdout\n"
"EXECUTABLE ../scripts/export-a-surface\n"
"ARGLIST <SNAKEOIL_PATH>\n",
"ARGLIST <PROJECT_PATH>\n",
encoding="utf-8",
)

Expand Down
14 changes: 7 additions & 7 deletions tests/test_integration/ert_config_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from pathlib import Path


def add_create_case_workflow(filepath: Path | str) -> None:
with open(filepath, "a", encoding="utf-8") as f:
def add_create_case_workflow(ert_config_path: Path | str) -> None:
with open(ert_config_path, "a", encoding="utf-8") as f:
f.writelines(
[
"LOAD_WORKFLOW ../bin/workflows/xhook_create_case_metadata\n"
Expand All @@ -13,8 +13,8 @@ def add_create_case_workflow(filepath: Path | str) -> None:
)


def add_copy_preprocessed_workflow(filepath: Path | str) -> None:
with open(filepath, "a", encoding="utf-8") as f:
def add_copy_preprocessed_workflow(ert_config_path: Path | str) -> None:
with open(ert_config_path, "a", encoding="utf-8") as f:
f.writelines(
[
"LOAD_WORKFLOW ../bin/workflows/xhook_copy_preprocessed_data\n"
Expand All @@ -24,12 +24,12 @@ def add_copy_preprocessed_workflow(filepath: Path | str) -> None:


def add_export_a_surface_forward_model(
snakeoil_path: Path, filepath: Path | str
project_path: Path, ert_config_path: Path | str
) -> None:
with open(filepath, "a", encoding="utf-8") as f:
with open(ert_config_path, "a", encoding="utf-8") as f:
f.writelines(
[
"INSTALL_JOB EXPORT_A_SURFACE ../bin/jobs/EXPORT_A_SURFACE\n"
f"FORWARD_MODEL EXPORT_A_SURFACE(<SNAKEOIL_PATH>={snakeoil_path})\n"
f"FORWARD_MODEL EXPORT_A_SURFACE(<PROJECT_PATH>={project_path})\n"
]
)
7 changes: 4 additions & 3 deletions tests/test_units/test_fmuprovider_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,10 @@ def test_fmuprovider_workflow_reference(fmurun_w_casemetadata, globalconfig2):


def test_ert_simulation_modes_one_to_one() -> None:
"""Ensure dataio known modes match those defined by Ert. These are currently defined
in `ert.mode_definitions`. `MODULE_MODE` is skipped due to seemingly being relevant
to Ert internally -- the modes are duplicated there."""
"""Ensure dataio known modes match those defined by Ert.
These are currently defined in `ert.mode_definitions`. `MODULE_MODE` is skipped due
to seemingly being relevant to Ert internally -- the modes are duplicated there."""
ert_mode_definitions = importlib.import_module("ert.mode_definitions")
ert_modes = {
getattr(ert_mode_definitions, name)
Expand Down

0 comments on commit 6050b4c

Please sign in to comment.