From 16488c3e1f92b490d78affef44e58f5f01458297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Therese=20Natter=C3=B8y?= <61694854+tnatt@users.noreply.github.com> Date: Thu, 3 Oct 2024 15:11:44 +0200 Subject: [PATCH] ENH: Add fmu.realization.is_reference to schema --- schema/definitions/0.8.0/schema/fmu_results.json | 13 +++++++++++++ src/fmu/dataio/_model/fields.py | 15 +++++++++++++++ src/fmu/dataio/_model/root.py | 1 + 3 files changed, 29 insertions(+) diff --git a/schema/definitions/0.8.0/schema/fmu_results.json b/schema/definitions/0.8.0/schema/fmu_results.json index fe9cc24d0..329dc16f4 100644 --- a/schema/definitions/0.8.0/schema/fmu_results.json +++ b/schema/definitions/0.8.0/schema/fmu_results.json @@ -30,6 +30,7 @@ "fmu.iteration.uuid", "fmu.model", "fmu.realization.id", + "fmu.realization.is_reference", "fmu.realization.name", "fmu.realization.uuid", "fmu.workflow", @@ -6137,6 +6138,18 @@ "title": "Id", "type": "integer" }, + "is_reference": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Is Reference" + }, "jobs": { "anyOf": [ {}, diff --git a/src/fmu/dataio/_model/fields.py b/src/fmu/dataio/_model/fields.py index f09bbc125..6e32b73c2 100644 --- a/src/fmu/dataio/_model/fields.py +++ b/src/fmu/dataio/_model/fields.py @@ -298,6 +298,21 @@ class Realization(BaseModel): """The universally unique identifier for this realization. It is a hash of ``fmu.case.uuid`` and ``fmu.iteration.uuid`` and ``fmu.realization.id``.""" + is_reference: Optional[bool] = Field(default=None) + """ + Flag used to determine if this realization is tagged as a reference. + + Typically, a reference realization is one that includes prediction surfaces and + maintains all other input parameters at their default settings. However, caution + must be exercised when putting logic upon this field, as this is simply a selected + realization by the user and no guarantees of what the realization represents + can be made. + + .. note:: + Please note that users should not set this flag in the metadata upon export; + it is intended to be configured through interactions with the Sumo GUI. + """ + class CountryItem(BaseModel): """A single country in the ``smda.masterdata.country`` list of countries diff --git a/src/fmu/dataio/_model/root.py b/src/fmu/dataio/_model/root.py index a5b1cc44d..56d74c526 100644 --- a/src/fmu/dataio/_model/root.py +++ b/src/fmu/dataio/_model/root.py @@ -278,6 +278,7 @@ def dump() -> dict: "fmu.iteration.uuid", "fmu.model", "fmu.realization.id", + "fmu.realization.is_reference", "fmu.realization.name", "fmu.realization.uuid", "fmu.workflow",