From f4908a84545277b8b4edc8e28a0e6fc8a931c505 Mon Sep 17 00:00:00 2001 From: janbjorge Date: Fri, 9 Feb 2024 15:41:11 +0100 Subject: [PATCH] ENH: Add facies_thickness as content type (#465) --- schema/definitions/0.8.0/schema/fmu_meta.json | 257 ++++++++++++++++++ .../definitions/0.8.0/schema/fmu_results.json | 1 + src/fmu/dataio/datastructure/meta/content.py | 5 + src/fmu/dataio/datastructure/meta/enums.py | 1 + 4 files changed, 264 insertions(+) diff --git a/schema/definitions/0.8.0/schema/fmu_meta.json b/schema/definitions/0.8.0/schema/fmu_meta.json index bbffa5217..b603fd0a3 100644 --- a/schema/definitions/0.8.0/schema/fmu_meta.json +++ b/schema/definitions/0.8.0/schema/fmu_meta.json @@ -93,6 +93,7 @@ "discriminator": { "mapping": { "depth": "#/$defs/DepthContent", + "facies_thickness": "#/$defs/FaciesThicknessContent", "fault_lines": "#/$defs/FaultLinesContent", "field_outline": "#/$defs/FieldOutlineContent", "field_region": "#/$defs/FieldRegionContent", @@ -123,6 +124,9 @@ { "$ref": "#/$defs/DepthContent" }, + { + "$ref": "#/$defs/FaciesThicknessContent" + }, { "$ref": "#/$defs/FaultLinesContent" }, @@ -1130,6 +1134,259 @@ "title": "FMUTimeObject", "type": "object" }, + "FaciesThicknessContent": { + "properties": { + "content": { + "const": "facies_thickness", + "title": "Content" + }, + "alias": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Alias" + }, + "bbox": { + "anyOf": [ + { + "$ref": "#/$defs/BoundingBox" + }, + { + "type": "null" + } + ], + "default": null + }, + "description": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "format": { + "examples": [ + "irap_binary" + ], + "title": "Format", + "type": "string" + }, + "grid_model": { + "anyOf": [ + { + "$ref": "#/$defs/GridModel" + }, + { + "type": "null" + } + ], + "default": null + }, + "is_observation": { + "title": "Is observation flag", + "type": "boolean" + }, + "is_prediction": { + "title": "Is prediction flag", + "type": "boolean" + }, + "layout": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "examples": [ + "regular" + ], + "title": "Layout" + }, + "name": { + "description": "Name of the data object. If stratigraphic, match the entry in the stratigraphic column", + "examples": [ + "VIKING GP. Top" + ], + "title": "Name", + "type": "string" + }, + "offset": { + "default": 0.0, + "title": "Offset", + "type": "number" + }, + "spec": { + "anyOf": [ + { + "$ref": "#/$defs/CPGridPropertySpecification" + }, + { + "$ref": "#/$defs/CPGridSpecification" + }, + { + "$ref": "#/$defs/CubeSpecification" + }, + { + "$ref": "#/$defs/PolygonsSpecification" + }, + { + "$ref": "#/$defs/SurfaceSpecification" + }, + { + "$ref": "#/$defs/TableSpecification" + }, + { + "$ref": "#/$defs/WellPointsDictionaryCaseSpecification" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Spec" + }, + "stratigraphic_alias": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Stratigraphic Alias" + }, + "stratigraphic": { + "description": "True if data object represents an entity in the stratigraphic column", + "title": "Stratigraphic", + "type": "boolean" + }, + "tagname": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "A semi-human readable tag for internal usage and uniqueness", + "examples": [ + "ds_extract_geogrid", + "ds_post_strucmod" + ], + "title": "Tagname" + }, + "time": { + "anyOf": [ + { + "$ref": "#/$defs/Time" + }, + { + "type": "null" + } + ], + "default": null + }, + "undef_is_zero": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Flag if undefined values are to be interpreted as zero", + "title": "Undef Is Zero" + }, + "unit": { + "default": "", + "examples": [ + "m" + ], + "title": "Unit", + "type": "string" + }, + "vertical_domain": { + "anyOf": [ + { + "enum": [ + "depth", + "time" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "examples": [ + "depth" + ], + "title": "Vertical Domain" + }, + "base": { + "anyOf": [ + { + "$ref": "#/$defs/Layer" + }, + { + "type": "null" + } + ], + "default": null + }, + "top": { + "anyOf": [ + { + "$ref": "#/$defs/Layer" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "content", + "format", + "is_observation", + "is_prediction", + "name", + "stratigraphic" + ], + "title": "FaciesThicknessContent", + "type": "object" + }, "FaultLinesContent": { "properties": { "content": { diff --git a/schema/definitions/0.8.0/schema/fmu_results.json b/schema/definitions/0.8.0/schema/fmu_results.json index 6f6927e17..c54b43838 100644 --- a/schema/definitions/0.8.0/schema/fmu_results.json +++ b/schema/definitions/0.8.0/schema/fmu_results.json @@ -280,6 +280,7 @@ "description": "The contents of this data object", "enum": [ "depth", + "facies_thickness", "time", "thickness", "property", diff --git a/src/fmu/dataio/datastructure/meta/content.py b/src/fmu/dataio/datastructure/meta/content.py index 329e2d744..4a0a65372 100644 --- a/src/fmu/dataio/datastructure/meta/content.py +++ b/src/fmu/dataio/datastructure/meta/content.py @@ -214,6 +214,10 @@ class DepthContent(Content): depth_reference: Literal["msl", "sb", "rkb"] +class FaciesThicknessContent(Content): + content: Literal[enums.ContentEnum.facies_thickness] + + class FaultLinesContent(Content): content: Literal[enums.ContentEnum.fault_lines] @@ -326,6 +330,7 @@ class AnyContent(RootModel): root: Annotated[ Union[ DepthContent, + FaciesThicknessContent, FaultLinesContent, FieldOutlineContent, FieldRegionContent, diff --git a/src/fmu/dataio/datastructure/meta/enums.py b/src/fmu/dataio/datastructure/meta/enums.py index d930bf967..0e2c1f1d6 100644 --- a/src/fmu/dataio/datastructure/meta/enums.py +++ b/src/fmu/dataio/datastructure/meta/enums.py @@ -5,6 +5,7 @@ class ContentEnum(str, Enum): depth = "depth" + facies_thickness = "facies_thickness" fault_lines = "fault_lines" field_outline = "field_outline" field_region = "field_region"