Skip to content

Commit

Permalink
ENH: Add realization and iteration object metadata definitions (#785)
Browse files Browse the repository at this point in the history
  • Loading branch information
equinor-ruaj authored and ErichSuter committed Sep 26, 2024
1 parent 53fcc5e commit 01d77c2
Show file tree
Hide file tree
Showing 7 changed files with 498 additions and 0 deletions.
64 changes: 64 additions & 0 deletions schema/definitions/0.8.0/examples/iteration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Example metadata for an FMU Iteration object.

$schema: https://main-fmu-schemas-dev.radix.equinor.com/schemas/0.8.0/fmu_results.json
version: "0.8.0"
source: fmu
tracklog:
- datetime: 2020-10-28T14:28:02
user:
id: peesv
event: created
- datetime: 2020-10-28T14:46:14
user:
id: peesv
event: updated

class: iteration # class is the main identifier of the data type.

fmu: # the fmu-block contains information directly related to the FMU context
model:
name: ff
revision: 21.0.0.dev
description:
- detailed description
- optional

case:
name: MyCaseName
uuid: 8bb56d60-8758-481a-89a4-6bac8561d38e
user:
id: jriv # $USER from ERT
description:
- yet other detailed description
- optional

context:
stage: iteration

iteration:
id: 0
name: iter-0
uuid: fd6e8f2a-f298-434a-80f4-90f0f6f84688

access:
asset:
name: Drogon
classification: internal

masterdata:
smda:
country:
- identifier: Norway
uuid: ad214d85-8a1d-19da-e053-c918a4889309
discovery:
- short_identifier: DROGON
uuid: 00000000-0000-0000-0000-000000000000 # mock uuid for Drogon
field:
- identifier: DROGON
uuid: 00000000-0000-0000-0000-000000000000 # mock uuid for Drogon
coordinate_system:
identifier: ST_WGS84_UTM37N_P32637
uuid: ad214d85-dac7-19da-e053-c918a4889309
stratigraphic_column:
identifier: DROGON_2020
uuid: 00000000-0000-0000-0000-000000000000 # mock uuid for Drogon
72 changes: 72 additions & 0 deletions schema/definitions/0.8.0/examples/realization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Example metadata for an FMU Realization object.

$schema: https://main-fmu-schemas-dev.radix.equinor.com/schemas/0.8.0/fmu_results.json
version: "0.8.0"
source: fmu
tracklog:
- datetime: 2020-10-28T14:28:02
user:
id: peesv
event: created
- datetime: 2020-10-28T14:46:14
user:
id: peesv
event: updated

class: realization # class is the main identifier of the data type.

fmu: # the fmu-block contains information directly related to the FMU context
model:
name: ff
revision: 21.0.0.dev
description:
- detailed description
- optional

case:
name: MyCaseName
uuid: 8bb56d60-8758-481a-89a4-6bac8561d38e
user:
id: jriv # $USER from ERT
description:
- yet other detailed description
- optional

context:
stage: realization

iteration:
id: 0
name: iter-0
uuid: fd6e8f2a-f298-434a-80f4-90f0f6f84688

realization:
id: 0
name: realization-0
uuid: 8ba597f5-07e0-a789-b9ad-fd16b1966f58
parameters:
param1: val1
param2: val2

access:
asset:
name: Drogon
classification: internal

masterdata:
smda:
country:
- identifier: Norway
uuid: ad214d85-8a1d-19da-e053-c918a4889309
discovery:
- short_identifier: DROGON
uuid: 00000000-0000-0000-0000-000000000000 # mock uuid for Drogon
field:
- identifier: DROGON
uuid: 00000000-0000-0000-0000-000000000000 # mock uuid for Drogon
coordinate_system:
identifier: ST_WGS84_UTM37N_P32637
uuid: ad214d85-dac7-19da-e053-c918a4889309
stratigraphic_column:
identifier: DROGON_2020
uuid: 00000000-0000-0000-0000-000000000000 # mock uuid for Drogon
196 changes: 196 additions & 0 deletions schema/definitions/0.8.0/schema/fmu_results.json
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,60 @@
"title": "FMUContext",
"type": "string"
},
"FMUIteration": {
"description": "The ``fmu`` block contains all attributes specific to FMU. The idea is that the FMU\nresults data model can be applied to data from *other* sources - in which the\nfmu-specific stuff may not make sense or be applicable.\nThis is a specialization of the FMU block for ``iteration`` objects.",
"properties": {
"case": {
"$ref": "#/$defs/Case"
},
"context": {
"$ref": "#/$defs/IterationContext"
},
"iteration": {
"$ref": "#/$defs/Iteration"
},
"model": {
"$ref": "#/$defs/Model"
}
},
"required": [
"case",
"model",
"context",
"iteration"
],
"title": "FMUIteration",
"type": "object"
},
"FMURealization": {
"description": "The ``fmu`` block contains all attributes specific to FMU. The idea is that the FMU\nresults data model can be applied to data from *other* sources - in which the\nfmu-specific stuff may not make sense or be applicable.\nThis is a specialization of the FMU block for ``realization`` objects.",
"properties": {
"case": {
"$ref": "#/$defs/Case"
},
"context": {
"$ref": "#/$defs/RealizationContext"
},
"iteration": {
"$ref": "#/$defs/Iteration"
},
"model": {
"$ref": "#/$defs/Model"
},
"realization": {
"$ref": "#/$defs/Realization"
}
},
"required": [
"case",
"model",
"context",
"iteration",
"realization"
],
"title": "FMURealization",
"type": "object"
},
"FaciesThicknessData": {
"description": "The ``data`` block contains information about the data contained in this object.\nThis class contains metadata for facies thickness.",
"properties": {
Expand Down Expand Up @@ -3286,6 +3340,74 @@
"title": "Iteration",
"type": "object"
},
"IterationContext": {
"description": "The ``fmu.context`` block contains the FMU context in which this data object\nwas produced. Here ``stage`` is required to be ``iteration``.",
"properties": {
"stage": {
"const": "iteration",
"default": "iteration",
"enum": [
"iteration"
],
"title": "Stage",
"type": "string"
}
},
"title": "IterationContext",
"type": "object"
},
"IterationMetadata": {
"description": "The FMU metadata model for an FMU Iteration.\n\nAn object representing a single Iteration of a specific case.",
"properties": {
"access": {
"$ref": "#/$defs/Access"
},
"class": {
"const": "iteration",
"enum": [
"iteration"
],
"title": "metadata_class",
"type": "string"
},
"fmu": {
"$ref": "#/$defs/FMUIteration"
},
"masterdata": {
"$ref": "#/$defs/Masterdata"
},
"source": {
"const": "fmu",
"enum": [
"fmu"
],
"title": "Source",
"type": "string"
},
"tracklog": {
"$ref": "#/$defs/Tracklog"
},
"version": {
"const": "0.8.0",
"enum": [
"0.8.0"
],
"title": "Version",
"type": "string"
}
},
"required": [
"class",
"masterdata",
"tracklog",
"source",
"version",
"fmu",
"access"
],
"title": "IterationMetadata",
"type": "object"
},
"KPProductData": {
"description": "The ``data`` block contains information about the data contained in this object.\nThis class contains metadata for KP products.",
"properties": {
Expand Down Expand Up @@ -6059,6 +6181,74 @@
"title": "Realization",
"type": "object"
},
"RealizationContext": {
"description": "The ``fmu.context`` block contains the FMU context in which this data object\nwas produced. Here ``stage`` is required to be ``realization``.",
"properties": {
"stage": {
"const": "realization",
"default": "realization",
"enum": [
"realization"
],
"title": "Stage",
"type": "string"
}
},
"title": "RealizationContext",
"type": "object"
},
"RealizationMetadata": {
"description": "The FMU metadata model for an FMU Realization.\n\nAn object representing a single Realization of a specific Iteration.",
"properties": {
"access": {
"$ref": "#/$defs/Access"
},
"class": {
"const": "realization",
"enum": [
"realization"
],
"title": "metadata_class",
"type": "string"
},
"fmu": {
"$ref": "#/$defs/FMURealization"
},
"masterdata": {
"$ref": "#/$defs/Masterdata"
},
"source": {
"const": "fmu",
"enum": [
"fmu"
],
"title": "Source",
"type": "string"
},
"tracklog": {
"$ref": "#/$defs/Tracklog"
},
"version": {
"const": "0.8.0",
"enum": [
"0.8.0"
],
"title": "Version",
"type": "string"
}
},
"required": [
"class",
"masterdata",
"tracklog",
"source",
"version",
"fmu",
"access"
],
"title": "RealizationMetadata",
"type": "object"
},
"RegionsData": {
"description": "The ``data`` block contains information about the data contained in this object.\nThis class contains metadata for regions.",
"properties": {
Expand Down Expand Up @@ -9632,6 +9822,12 @@
},
{
"$ref": "#/$defs/ObjectMetadata"
},
{
"$ref": "#/$defs/RealizationMetadata"
},
{
"$ref": "#/$defs/IterationMetadata"
}
],
"then": {
Expand Down
2 changes: 2 additions & 0 deletions src/fmu/dataio/_model/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ class FMUClass(str, Enum):
"""The class of a data object by FMU convention or standards."""

case = "case"
realization = "realization"
iteration = "iteration"
surface = "surface"
table = "table"
cpgrid = "cpgrid"
Expand Down
Loading

0 comments on commit 01d77c2

Please sign in to comment.