diff --git a/src/fmu/dataio/_export_item.py b/src/fmu/dataio/_export_item.py index 1cae8c747..05d838e68 100644 --- a/src/fmu/dataio/_export_item.py +++ b/src/fmu/dataio/_export_item.py @@ -901,6 +901,9 @@ def _construct_filename_fmustandard1(self): """ stem = "unset" outroot = self.dataio.runpath / "share" / "results" + if self.dataio.is_observation: + outroot = self.dataio.runpath / "share" / "observations" + loc = self.efolder stem = self.name.lower() diff --git a/src/fmu/dataio/dataio.py b/src/fmu/dataio/dataio.py index 9f8e4aeee..215bcba23 100644 --- a/src/fmu/dataio/dataio.py +++ b/src/fmu/dataio/dataio.py @@ -122,7 +122,8 @@ class ExportData: timedata: If given, a list of lists with dates, .e.g. [[20200101, "monitor"], [20180101, "base"]] or just [[20210101]] is_prediction: True (default) of model prediction data - is_observation: Default is False. + is_observation: Default is False. If True, then disk storage will be on the + "share/observations" folder workflow: Short tag desciption of workflow (as description) name: The name of the object. If not set it is tried to be inferred from diff --git a/tests/test_fmu_dataio_cube.py b/tests/test_fmu_dataio_cube.py index c68bedb14..16d088905 100644 --- a/tests/test_fmu_dataio_cube.py +++ b/tests/test_fmu_dataio_cube.py @@ -114,7 +114,13 @@ def test_cube_io_larger_case_ertrun(tmp_path): runfolder = current / "mycase" / "realization-0" / "iter-0" / "rms" / "model" runfolder.mkdir(parents=True, exist_ok=True) out = ( - current / "mycase" / "realization-0" / "iter-0" / "share" / "results" / "cubes" + current + / "mycase" + / "realization-0" + / "iter-0" + / "share" + / "observations" + / "cubes" ) # alternative 1, set inside_rms True (developer setting for testing) @@ -124,9 +130,9 @@ def test_cube_io_larger_case_ertrun(tmp_path): content="depth", unit="m", vertical_domain={"depth": "msl"}, - timedata=None, + timedata=[[20290101, "monitor"], [19990601, "base"]], is_prediction=True, - is_observation=False, + is_observation=True, tagname="what Descr", verbosity="INFO", runfolder=runfolder.resolve(), @@ -137,7 +143,7 @@ def test_cube_io_larger_case_ertrun(tmp_path): cube = xtgeo.Cube(ncol=23, nrow=12, nlay=5) exp1.export(cube, verbosity="INFO") - metadataout = out / ".volantis--what_descr.segy.yml" + metadataout = out / ".volantis--what_descr--20290101_19990601.segy.yml" assert metadataout.is_file() is True @@ -146,7 +152,8 @@ def test_cube_io_larger_case_ertrun(tmp_path): meta = yaml.safe_load(mstream) assert ( meta["file"]["relative_path"] - == "realization-0/iter-0/share/results/cubes/volantis--what_descr.segy" + == "realization-0/iter-0/share/observations/cubes/volantis--what_descr" + + "--20290101_19990601.segy" ) assert meta["fmu"]["model"]["name"] == "ff" assert meta["fmu"]["iteration"]["name"] == "iter-0"