Skip to content

Commit

Permalink
ENH: Add 'simulationtimeseries' content type
Browse files Browse the repository at this point in the history
  • Loading branch information
mferrera committed Dec 6, 2024
1 parent 2980989 commit 0fd91cc
Show file tree
Hide file tree
Showing 4 changed files with 332 additions and 0 deletions.
308 changes: 308 additions & 0 deletions schema/definitions/0.8.0/schema/fmu_results.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@
{
"$ref": "#/$defs/SeismicData"
},
{
"$ref": "#/$defs/SimulationTimeSeriesData"
},
{
"$ref": "#/$defs/SubcropData"
},
Expand Down Expand Up @@ -7307,6 +7310,311 @@
"title": "SeismicData",
"type": "object"
},
"SimulationTimeSeriesData": {
"description": "The ``data`` block contains information about the data contained in this object.\nThis class contains metadata for simulation time series. This is a time series\nresult derived from some simulator like OPM Flow.",
"properties": {
"alias": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Alias"
},
"base": {
"anyOf": [
{
"$ref": "#/$defs/Layer"
},
{
"type": "null"
}
],
"default": null
},
"bbox": {
"anyOf": [
{
"$ref": "#/$defs/BoundingBox3D"
},
{
"$ref": "#/$defs/BoundingBox2D"
},
{
"type": "null"
}
],
"default": null,
"title": "Bbox"
},
"content": {
"const": "simulationtimeseries",
"enum": [
"simulationtimeseries"
],
"title": "Content",
"type": "string"
},
"description": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Description"
},
"domain_reference": {
"anyOf": [
{
"$ref": "#/$defs/DomainReference"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"msl",
"sb",
"rkb"
]
},
"format": {
"examples": [
"irap_binary"
],
"title": "Format",
"type": "string"
},
"geometry": {
"anyOf": [
{
"$ref": "#/$defs/Geometry"
},
{
"type": "null"
}
],
"default": null
},
"grid_model": {
"anyOf": [
{
"$ref": "#/$defs/GridModel"
},
{
"type": "null"
}
],
"default": null
},
"is_observation": {
"title": "Is Observation",
"type": "boolean"
},
"is_prediction": {
"title": "Is Prediction",
"type": "boolean"
},
"layout": {
"anyOf": [
{
"$ref": "#/$defs/Layout"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"regular",
"cornerpoint"
]
},
"name": {
"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/FaultRoomSurfaceSpecification"
},
{
"$ref": "#/$defs/PointSpecification"
},
{
"$ref": "#/$defs/CubeSpecification"
},
{
"$ref": "#/$defs/PolygonsSpecification"
},
{
"$ref": "#/$defs/SurfaceSpecification"
},
{
"$ref": "#/$defs/TableSpecification"
},
{
"type": "null"
}
],
"default": null,
"title": "Spec"
},
"stratigraphic": {
"title": "Stratigraphic",
"type": "boolean"
},
"stratigraphic_alias": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Stratigraphic Alias"
},
"table_index": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"examples": [
[
"ZONE",
"REGION"
]
],
"title": "Table Index"
},
"tagname": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"ds_extract_geogrid",
"ds_post_strucmod"
],
"title": "Tagname"
},
"time": {
"anyOf": [
{
"$ref": "#/$defs/Time"
},
{
"type": "null"
}
],
"default": null
},
"top": {
"anyOf": [
{
"$ref": "#/$defs/Layer"
},
{
"type": "null"
}
],
"default": null
},
"undef_is_zero": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Undef Is Zero"
},
"unit": {
"default": "",
"examples": [
"m"
],
"title": "Unit",
"type": "string"
},
"vertical_domain": {
"anyOf": [
{
"$ref": "#/$defs/VerticalDomain"
},
{
"type": "null"
}
],
"default": null,
"examples": [
"depth",
"time"
]
}
},
"required": [
"content",
"name",
"stratigraphic",
"format",
"is_observation",
"is_prediction"
],
"title": "SimulationTimeSeriesData",
"type": "object"
},
"Smda": {
"description": "The ``masterdata.smda`` block contains SMDA-related attributes.",
"properties": {
Expand Down
12 changes: 12 additions & 0 deletions src/fmu/dataio/_model/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,17 @@ class SeismicData(Data):
"""A block describing seismic data. See :class:`Seismic`."""


class SimulationTimeSeriesData(Data):
"""
The ``data`` block contains information about the data contained in this object.
This class contains metadata for simulation time series. This is a time series
result derived from some simulator like OPM Flow.
"""

content: Literal[enums.Content.simulationtimeseries]
"""The type of content these data represent."""


class SubcropData(Data):
"""
The ``data`` block contains information about the data contained in this object.
Expand Down Expand Up @@ -650,6 +661,7 @@ class AnyData(RootModel):
RelpermData,
RFTData,
SeismicData,
SimulationTimeSeriesData,
SubcropData,
ThicknessData,
TimeData,
Expand Down
1 change: 1 addition & 0 deletions src/fmu/dataio/_model/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class Content(str, Enum):
relperm = "relperm"
rft = "rft"
seismic = "seismic"
simulationtimeseries = "simulationtimeseries"
subcrop = "subcrop"
thickness = "thickness"
time = "time"
Expand Down
11 changes: 11 additions & 0 deletions tests/test_units/test_contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,17 @@ def test_content_seismic(polygons, globalconfig2):
# tested various other places


def test_content_simulationtimeseries(dataframe, globalconfig2):
"""Test export of the simulationtimeseries content."""
meta = ExportData(
config=globalconfig2,
name="MyName",
content="simulationtimeseries",
).generate_metadata(dataframe)

assert meta["data"]["content"] == "simulationtimeseries"


def test_content_subcrop(polygons, globalconfig2):
"""Test export of the subcrop content."""
meta = ExportData(
Expand Down

0 comments on commit 0fd91cc

Please sign in to comment.