From 3edf2bdea908ddbbfce09c2931ee76cb7b31b23b Mon Sep 17 00:00:00 2001 From: mferrera Date: Wed, 3 Jul 2024 12:06:45 +0200 Subject: [PATCH] fixup: Content to Data, review comments --- schema/definitions/0.8.0/schema/fmu_meta.json | 166 +++++++++--------- .../datastructure/_internal/internal.py | 6 +- src/fmu/dataio/datastructure/meta/content.py | 127 +++++++------- src/fmu/dataio/datastructure/meta/meta.py | 12 +- src/fmu/dataio/providers/objectdata/_base.py | 8 +- 5 files changed, 163 insertions(+), 156 deletions(-) diff --git a/schema/definitions/0.8.0/schema/fmu_meta.json b/schema/definitions/0.8.0/schema/fmu_meta.json index bbdbc389e..d6e36301b 100644 --- a/schema/definitions/0.8.0/schema/fmu_meta.json +++ b/schema/definitions/0.8.0/schema/fmu_meta.json @@ -106,7 +106,7 @@ "title": "Aggregation", "type": "object" }, - "AnyContent": { + "AnyData": { "dependencies": { "base": { "required": [ @@ -119,88 +119,88 @@ ] } }, - "description": "The ``data`` block contains information about the data contained in this object.\nThis class, ``AnyContent``, is a root model that allows for data with more specific\ncontent types to be placed within it. It can contain the metadata for any data\nobject.\n\nSee :class:`Content` to get an overview of all of the subfields used in the ``data``\nblock. Between the different content types, only the ``data.content`` field will\ndiffer. This field indicates the type of content the data are representing.", + "description": "The ``data`` block contains information about the data contained in this object.\nThis class, ``AnyData``, is a root model that allows for data with more specific\ncontent types to be placed within it. It can contain the metadata for any data\nobject.\n\nSee :class:`Data` to get an overview of all of the subfields used in the ``data``\nblock. Between the different content types, only the ``data.content`` field will\ndiffer. This field indicates the type of content the data are representing.", "discriminator": { "propertyName": "content" }, "oneOf": [ { - "$ref": "#/$defs/DepthContent" + "$ref": "#/$defs/DepthData" }, { - "$ref": "#/$defs/FaciesThicknessContent" + "$ref": "#/$defs/FaciesThicknessData" }, { - "$ref": "#/$defs/FaultLinesContent" + "$ref": "#/$defs/FaultLinesData" }, { - "$ref": "#/$defs/FieldOutlineContent" + "$ref": "#/$defs/FieldOutlineData" }, { - "$ref": "#/$defs/FieldRegionContent" + "$ref": "#/$defs/FieldRegionData" }, { - "$ref": "#/$defs/FluidContactContent" + "$ref": "#/$defs/FluidContactData" }, { - "$ref": "#/$defs/KPProductContent" + "$ref": "#/$defs/KPProductData" }, { - "$ref": "#/$defs/LiftCurvesContent" + "$ref": "#/$defs/LiftCurvesData" }, { - "$ref": "#/$defs/NamedAreaContent" + "$ref": "#/$defs/NamedAreaData" }, { - "$ref": "#/$defs/ParametersContent" + "$ref": "#/$defs/ParametersData" }, { - "$ref": "#/$defs/PinchoutContent" + "$ref": "#/$defs/PinchoutData" }, { - "$ref": "#/$defs/PropertyContent" + "$ref": "#/$defs/PropertyData" }, { - "$ref": "#/$defs/FaultPropertiesContent" + "$ref": "#/$defs/FaultPropertiesData" }, { - "$ref": "#/$defs/PVTContent" + "$ref": "#/$defs/PVTData" }, { - "$ref": "#/$defs/RegionsContent" + "$ref": "#/$defs/RegionsData" }, { - "$ref": "#/$defs/RelpermContent" + "$ref": "#/$defs/RelpermData" }, { - "$ref": "#/$defs/RFTContent" + "$ref": "#/$defs/RFTData" }, { - "$ref": "#/$defs/SeismicContent" + "$ref": "#/$defs/SeismicData" }, { - "$ref": "#/$defs/SubcropContent" + "$ref": "#/$defs/SubcropData" }, { - "$ref": "#/$defs/ThicknessContent" + "$ref": "#/$defs/ThicknessData" }, { - "$ref": "#/$defs/TimeContent" + "$ref": "#/$defs/TimeData" }, { - "$ref": "#/$defs/TimeSeriesContent" + "$ref": "#/$defs/TimeSeriesData" }, { - "$ref": "#/$defs/VelocityContent" + "$ref": "#/$defs/VelocityData" }, { - "$ref": "#/$defs/VolumesContent" + "$ref": "#/$defs/VolumesData" }, { - "$ref": "#/$defs/WellPicksContent" + "$ref": "#/$defs/WellPicksData" } ], - "title": "AnyContent" + "title": "AnyData" }, "Asset": { "description": "The ``access.asset`` block contains information about the owner asset of\nthese data.", @@ -533,7 +533,7 @@ "type": "object" }, "CountryItem": { - "description": "The ``smda.masterdata.country`` block contains a list of countries known\nto SMDA.", + "description": "The ``smda.masterdata.country`` block contains a list of countries known\nto SMDA. This class represents one such country.", "properties": { "identifier": { "examples": [ @@ -651,8 +651,8 @@ "title": "CubeSpecification", "type": "object" }, - "DepthContent": { - "description": "The ``data`` block contains information about the data contained in this object.\nThis class contains metadata for depth type..", + "DepthData": { + "description": "The ``data`` block contains information about the data contained in this object.\nThis class contains metadata for depth type.", "properties": { "alias": { "anyOf": [ @@ -948,11 +948,11 @@ "is_prediction", "depth_reference" ], - "title": "DepthContent", + "title": "DepthData", "type": "object" }, "DiscoveryItem": { - "description": "The ``masterdata.smda.discovery`` block contains a list of\ndiscoveries known to SMDA.", + "description": "The ``masterdata.smda.discovery`` block contains a list of\ndiscoveries known to SMDA. This class represents one such discovery.", "properties": { "short_identifier": { "examples": [ @@ -1094,7 +1094,7 @@ "title": "FMUCaseAttributes", "type": "object" }, - "FaciesThicknessContent": { + "FaciesThicknessData": { "description": "The ``data`` block contains information about the data contained in this object.\nThis class contains metadata for facies thickness.", "properties": { "alias": { @@ -1381,10 +1381,10 @@ "is_observation", "is_prediction" ], - "title": "FaciesThicknessContent", + "title": "FaciesThicknessData", "type": "object" }, - "FaultLinesContent": { + "FaultLinesData": { "description": "The ``data`` block contains information about the data contained in this object.\nThis class contains metadata for fault lines.", "properties": { "alias": { @@ -1671,10 +1671,10 @@ "is_observation", "is_prediction" ], - "title": "FaultLinesContent", + "title": "FaultLinesData", "type": "object" }, - "FaultPropertiesContent": { + "FaultPropertiesData": { "description": "The ``data`` block contains information about the data contained in this object.\nThis class contains metadata for fault properties.", "properties": { "alias": { @@ -1961,7 +1961,7 @@ "is_observation", "is_prediction" ], - "title": "FaultPropertiesContent", + "title": "FaultPropertiesData", "type": "object" }, "FaultRoomSurfaceSpecification": { @@ -2025,7 +2025,7 @@ "type": "object" }, "FieldItem": { - "description": "The ``masterdata.smda.field`` block contains a list of fields\nknown to SMDA.", + "description": "The ``masterdata.smda.field`` block contains a list of fields\nknown to SMDA. This class represents one such field.", "properties": { "identifier": { "examples": [ @@ -2064,7 +2064,7 @@ "title": "FieldOutline", "type": "object" }, - "FieldOutlineContent": { + "FieldOutlineData": { "description": "The ``data`` block contains information about the data contained in this object.\nThis class contains metadata for field outlines.", "properties": { "alias": { @@ -2355,7 +2355,7 @@ "is_prediction", "field_outline" ], - "title": "FieldOutlineContent", + "title": "FieldOutlineData", "type": "object" }, "FieldRegion": { @@ -2373,7 +2373,7 @@ "title": "FieldRegion", "type": "object" }, - "FieldRegionContent": { + "FieldRegionData": { "description": "The ``data`` block contains information about the data contained in this object.\nThis class contains metadata for field regions.", "properties": { "alias": { @@ -2664,7 +2664,7 @@ "is_prediction", "field_region" ], - "title": "FieldRegionContent", + "title": "FieldRegionData", "type": "object" }, "File": { @@ -2779,7 +2779,7 @@ "title": "FluidContact", "type": "object" }, - "FluidContactContent": { + "FluidContactData": { "description": "The ``data`` block contains information about the data contained in this object.\nThis class contains metadata for fluid contacts.", "properties": { "alias": { @@ -3070,7 +3070,7 @@ "is_prediction", "fluid_contact" ], - "title": "FluidContactContent", + "title": "FluidContactData", "type": "object" }, "FmuContext": { @@ -3176,7 +3176,7 @@ "title": "Iteration", "type": "object" }, - "KPProductContent": { + "KPProductData": { "description": "The ``data`` block contains information about the data contained in this object.\nThis class contains metadata for KP products.", "properties": { "alias": { @@ -3463,7 +3463,7 @@ "is_observation", "is_prediction" ], - "title": "KPProductContent", + "title": "KPProductData", "type": "object" }, "Layer": { @@ -3505,7 +3505,7 @@ "title": "Layout", "type": "string" }, - "LiftCurvesContent": { + "LiftCurvesData": { "description": "The ``data`` block contains information about the data contained in this object.\nThis class contains metadata for lift curves.", "properties": { "alias": { @@ -3792,7 +3792,7 @@ "is_observation", "is_prediction" ], - "title": "LiftCurvesContent", + "title": "LiftCurvesData", "type": "object" }, "Masterdata": { @@ -3848,7 +3848,7 @@ "title": "Model", "type": "object" }, - "NamedAreaContent": { + "NamedAreaData": { "description": "The ``data`` block contains information about the data contained in this object.\nThis class contains metadata for named areas.", "properties": { "alias": { @@ -4135,7 +4135,7 @@ "is_observation", "is_prediction" ], - "title": "NamedAreaContent", + "title": "NamedAreaData", "type": "object" }, "ObjectMetadata": { @@ -4160,7 +4160,7 @@ "type": "string" }, "data": { - "$ref": "#/$defs/AnyContent" + "$ref": "#/$defs/AnyData" }, "display": { "$ref": "#/$defs/Display" @@ -4254,7 +4254,7 @@ "title": "OperatingSystem", "type": "object" }, - "PVTContent": { + "PVTData": { "description": "The ``data`` block contains information about the data contained in this object.\nThis class contains metadata for pvt data.", "properties": { "alias": { @@ -4541,7 +4541,7 @@ "is_observation", "is_prediction" ], - "title": "PVTContent", + "title": "PVTData", "type": "object" }, "Parameters": { @@ -4565,7 +4565,7 @@ "title": "Parameters", "type": "object" }, - "ParametersContent": { + "ParametersData": { "description": "The ``data`` block contains information about the data contained in this object.\nThis class contains metadata for parameters.", "properties": { "alias": { @@ -4852,10 +4852,10 @@ "is_observation", "is_prediction" ], - "title": "ParametersContent", + "title": "ParametersData", "type": "object" }, - "PinchoutContent": { + "PinchoutData": { "description": "The ``data`` block contains information about the data contained in this object.\nThis class contains metadata for pinchouts.", "properties": { "alias": { @@ -5142,7 +5142,7 @@ "is_observation", "is_prediction" ], - "title": "PinchoutContent", + "title": "PinchoutData", "type": "object" }, "PointSpecification": { @@ -5195,7 +5195,7 @@ "title": "PolygonsSpecification", "type": "object" }, - "PropertyContent": { + "PropertyData": { "description": "The ``data`` block contains information about the data contained in this object.\nThis class contains metadata for property data.", "properties": { "alias": { @@ -5482,10 +5482,10 @@ "is_observation", "is_prediction" ], - "title": "PropertyContent", + "title": "PropertyData", "type": "object" }, - "RFTContent": { + "RFTData": { "description": "The ``data`` block contains information about the data contained in this object.\nThis class contains metadata for rft data.", "properties": { "alias": { @@ -5772,7 +5772,7 @@ "is_observation", "is_prediction" ], - "title": "RFTContent", + "title": "RFTData", "type": "object" }, "Realization": { @@ -5827,7 +5827,7 @@ "title": "Realization", "type": "object" }, - "RegionsContent": { + "RegionsData": { "description": "The ``data`` block contains information about the data contained in this object.\nThis class contains metadata for regions.", "properties": { "alias": { @@ -6114,10 +6114,10 @@ "is_observation", "is_prediction" ], - "title": "RegionsContent", + "title": "RegionsData", "type": "object" }, - "RelpermContent": { + "RelpermData": { "description": "The ``data`` block contains information about the data contained in this object.\nThis class contains metadata for relperm.", "properties": { "alias": { @@ -6404,7 +6404,7 @@ "is_observation", "is_prediction" ], - "title": "RelpermContent", + "title": "RelpermData", "type": "object" }, "Seismic": { @@ -6495,7 +6495,7 @@ "title": "Seismic", "type": "object" }, - "SeismicContent": { + "SeismicData": { "description": "The ``data`` block contains information about the data contained in this object.\nThis class contains metadata for seismics.", "properties": { "alias": { @@ -6786,7 +6786,7 @@ "is_prediction", "seismic" ], - "title": "SeismicContent", + "title": "SeismicData", "type": "object" }, "Smda": { @@ -6902,7 +6902,7 @@ "title": "StratigraphicColumn", "type": "object" }, - "SubcropContent": { + "SubcropData": { "description": "The ``data`` block contains information about the data contained in this object.\nThis class contains metadata for subcrops.", "properties": { "alias": { @@ -7189,7 +7189,7 @@ "is_observation", "is_prediction" ], - "title": "SubcropContent", + "title": "SubcropData", "type": "object" }, "SurfaceSpecification": { @@ -7332,7 +7332,7 @@ "title": "TableSpecification", "type": "object" }, - "ThicknessContent": { + "ThicknessData": { "description": "The ``data`` block contains information about the data contained in this object.\nThis class contains metadata for thickness.", "properties": { "alias": { @@ -7619,7 +7619,7 @@ "is_observation", "is_prediction" ], - "title": "ThicknessContent", + "title": "ThicknessData", "type": "object" }, "Time": { @@ -7650,7 +7650,7 @@ "title": "Time", "type": "object" }, - "TimeContent": { + "TimeData": { "description": "The ``data`` block contains information about the data contained in this object.\nThis class contains metadata for time.", "properties": { "alias": { @@ -7937,10 +7937,10 @@ "is_observation", "is_prediction" ], - "title": "TimeContent", + "title": "TimeData", "type": "object" }, - "TimeSeriesContent": { + "TimeSeriesData": { "description": "The ``data`` block contains information about the data contained in this object.\nThis class contains metadata for time series.", "properties": { "alias": { @@ -8227,7 +8227,7 @@ "is_observation", "is_prediction" ], - "title": "TimeSeriesContent", + "title": "TimeSeriesData", "type": "object" }, "Timestamp": { @@ -8330,7 +8330,7 @@ "title": "User", "type": "object" }, - "VelocityContent": { + "VelocityData": { "description": "The ``data`` block contains information about the data contained in this object.\nThis class contains metadata for velocities.", "properties": { "alias": { @@ -8617,7 +8617,7 @@ "is_observation", "is_prediction" ], - "title": "VelocityContent", + "title": "VelocityData", "type": "object" }, "Version": { @@ -8634,7 +8634,7 @@ "title": "Version", "type": "object" }, - "VolumesContent": { + "VolumesData": { "description": "The ``data`` block contains information about the data contained in this object.\nThis class contains metadata for volumes.", "properties": { "alias": { @@ -8921,10 +8921,10 @@ "is_observation", "is_prediction" ], - "title": "VolumesContent", + "title": "VolumesData", "type": "object" }, - "WellPicksContent": { + "WellPicksData": { "description": "The ``data`` block contains information about the data contained in this object.\nThis class contains metadata for well picks.", "properties": { "alias": { @@ -9211,7 +9211,7 @@ "is_observation", "is_prediction" ], - "title": "WellPicksContent", + "title": "WellPicksData", "type": "object" }, "Workflow": { diff --git a/src/fmu/dataio/datastructure/_internal/internal.py b/src/fmu/dataio/datastructure/_internal/internal.py index 2e781e9dd..da11946fa 100644 --- a/src/fmu/dataio/datastructure/_internal/internal.py +++ b/src/fmu/dataio/datastructure/_internal/internal.py @@ -117,7 +117,7 @@ class Context(BaseModel, use_enum_values=True): # Remove the two models below when content is required as input. -class UnsetContent(meta.content.Content): +class UnsetContent(meta.content.Data): content: Literal["unset"] # type: ignore @model_validator(mode="after") @@ -133,7 +133,7 @@ def _deprecation_warning(self) -> UnsetContent: return self -class UnsetAnyContent(meta.content.AnyContent): +class UnsetAnyContent(meta.content.AnyData): root: UnsetContent # type: ignore @@ -160,7 +160,7 @@ class DataClassMeta(JsonSchemaMetadata): fmu: Optional[FMUClassMetaData] masterdata: Optional[meta.Masterdata] access: Optional[meta.SsdlAccess] - data: Union[meta.content.AnyContent, UnsetAnyContent] + data: Union[meta.content.AnyData, UnsetAnyContent] file: meta.File display: meta.Display tracklog: List[meta.TracklogEvent] diff --git a/src/fmu/dataio/datastructure/meta/content.py b/src/fmu/dataio/datastructure/meta/content.py index fb6aa2ef6..d426b2fdc 100644 --- a/src/fmu/dataio/datastructure/meta/content.py +++ b/src/fmu/dataio/datastructure/meta/content.py @@ -177,7 +177,7 @@ class BoundingBox3D(BoundingBox2D): ) -class Content(BaseModel): +class Data(BaseModel): """ The ``data`` block contains information about the data contained in this object. This class is derived from for more specific content types that are discriminated @@ -202,7 +202,12 @@ class Content(BaseModel): examples=["ds_extract_geogrid", "ds_post_strucmod"], ) """An identifier for this/these data object(s). Similar to the second part of the - generated filename in disk-oriented FMU data standard.""" + generated filename in disk-oriented FMU data standard. + + You should avoid using tagname as metadata in queries since its value is free-form. + The intention with tagname is mostly backward compatibility with legacy scratch-file + naming rules in FMU. + """ stratigraphic_alias: Optional[List[str]] = Field(default=None) """A list of strings representing stratigraphic aliases for this ``data.name``. E.g. @@ -228,7 +233,8 @@ class Content(BaseModel): grid_model: Optional[GridModel] = Field(default=None) """A block containing information pertaining to grid model content. - See :class:`GridModel`.""" + See :class:`GridModel`. + .. warning:: This has currently no function and is likely to be deprecated.""" is_observation: bool """True if this is an observation.""" @@ -252,8 +258,9 @@ class Content(BaseModel): time: Optional[Time] = Field(default=None) """A block containing lists of objects describing timestamp information for this - data object, if applicable. See :class:`Time`. - .. note:: ``data.time`` items can be repeated to include many time stamps.""" + data object, if applicable, like Flow simulator restart dates, or dates for seismic + 4D surveys. See :class:`Time`. + .. note:: ``data.time`` items can currently hold a maximum of two values.""" undef_is_zero: Optional[bool] = Field(default=None) """Flag if undefined values are to be interpreted as zero""" @@ -285,10 +292,10 @@ class Content(BaseModel): .. note:: ``base`` is required to use with this.""" -class DepthContent(Content): +class DepthData(Data): """ The ``data`` block contains information about the data contained in this object. - This class contains metadata for depth type.. + This class contains metadata for depth type. """ content: Literal[enums.ContentEnum.depth] @@ -298,7 +305,7 @@ class DepthContent(Content): """A reference to a known depth reference.""" -class FaciesThicknessContent(Content): +class FaciesThicknessData(Data): """ The ``data`` block contains information about the data contained in this object. This class contains metadata for facies thickness. @@ -308,7 +315,7 @@ class FaciesThicknessContent(Content): """The type of content these data represent.""" -class FaultLinesContent(Content): +class FaultLinesData(Data): """ The ``data`` block contains information about the data contained in this object. This class contains metadata for fault lines. @@ -318,7 +325,7 @@ class FaultLinesContent(Content): """The type of content these data represent.""" -class FaultPropertiesContent(Content): +class FaultPropertiesData(Data): """ The ``data`` block contains information about the data contained in this object. This class contains metadata for fault properties. @@ -328,7 +335,7 @@ class FaultPropertiesContent(Content): """The type of content these data represent.""" -class FieldOutlineContent(Content): +class FieldOutlineData(Data): """ The ``data`` block contains information about the data contained in this object. This class contains metadata for field outlines. @@ -341,7 +348,7 @@ class FieldOutlineContent(Content): """A block describing a field outline. See :class:`FieldOutline`.""" -class FieldRegionContent(Content): +class FieldRegionData(Data): """ The ``data`` block contains information about the data contained in this object. This class contains metadata for field regions. @@ -354,7 +361,7 @@ class FieldRegionContent(Content): """A block describing a field region. See :class:`FieldRegion`.""" -class FluidContactContent(Content): +class FluidContactData(Data): """ The ``data`` block contains information about the data contained in this object. This class contains metadata for fluid contacts. @@ -367,7 +374,7 @@ class FluidContactContent(Content): """A block describing a fluid contact. See :class:`FluidContact`.""" -class KPProductContent(Content): +class KPProductData(Data): """ The ``data`` block contains information about the data contained in this object. This class contains metadata for KP products. @@ -377,7 +384,7 @@ class KPProductContent(Content): """The type of content these data represent.""" -class LiftCurvesContent(Content): +class LiftCurvesData(Data): """ The ``data`` block contains information about the data contained in this object. This class contains metadata for lift curves. @@ -387,7 +394,7 @@ class LiftCurvesContent(Content): """The type of content these data represent.""" -class NamedAreaContent(Content): +class NamedAreaData(Data): """ The ``data`` block contains information about the data contained in this object. This class contains metadata for named areas. @@ -397,7 +404,7 @@ class NamedAreaContent(Content): """The type of content these data represent.""" -class ParametersContent(Content): +class ParametersData(Data): """ The ``data`` block contains information about the data contained in this object. This class contains metadata for parameters. @@ -407,7 +414,7 @@ class ParametersContent(Content): """The type of content these data represent.""" -class PinchoutContent(Content): +class PinchoutData(Data): """ The ``data`` block contains information about the data contained in this object. This class contains metadata for pinchouts. @@ -417,7 +424,7 @@ class PinchoutContent(Content): """The type of content these data represent.""" -class PropertyContent(Content): +class PropertyData(Data): """ The ``data`` block contains information about the data contained in this object. This class contains metadata for property data. @@ -427,7 +434,7 @@ class PropertyContent(Content): """The type of content these data represent.""" -class PVTContent(Content): +class PVTData(Data): """ The ``data`` block contains information about the data contained in this object. This class contains metadata for pvt data. @@ -437,7 +444,7 @@ class PVTContent(Content): """The type of content these data represent.""" -class RegionsContent(Content): +class RegionsData(Data): """ The ``data`` block contains information about the data contained in this object. This class contains metadata for regions. @@ -447,7 +454,7 @@ class RegionsContent(Content): """The type of content these data represent.""" -class RelpermContent(Content): +class RelpermData(Data): """ The ``data`` block contains information about the data contained in this object. This class contains metadata for relperm. @@ -457,7 +464,7 @@ class RelpermContent(Content): """The type of content these data represent.""" -class RFTContent(Content): +class RFTData(Data): """ The ``data`` block contains information about the data contained in this object. This class contains metadata for rft data. @@ -467,7 +474,7 @@ class RFTContent(Content): """The type of content these data represent.""" -class SeismicContent(Content): +class SeismicData(Data): """ The ``data`` block contains information about the data contained in this object. This class contains metadata for seismics. @@ -480,7 +487,7 @@ class SeismicContent(Content): """A block describing seismic data. See :class:`Seismic`.""" -class SubcropContent(Content): +class SubcropData(Data): """ The ``data`` block contains information about the data contained in this object. This class contains metadata for subcrops. @@ -490,7 +497,7 @@ class SubcropContent(Content): """The type of content these data represent.""" -class ThicknessContent(Content): +class ThicknessData(Data): """ The ``data`` block contains information about the data contained in this object. This class contains metadata for thickness. @@ -500,7 +507,7 @@ class ThicknessContent(Content): """The type of content these data represent.""" -class TimeContent(Content): +class TimeData(Data): """ The ``data`` block contains information about the data contained in this object. This class contains metadata for time. @@ -510,7 +517,7 @@ class TimeContent(Content): """The type of content these data represent.""" -class TimeSeriesContent(Content): +class TimeSeriesData(Data): """ The ``data`` block contains information about the data contained in this object. This class contains metadata for time series. @@ -520,7 +527,7 @@ class TimeSeriesContent(Content): """The type of content these data represent.""" -class TransmissibilitiesContent(Content): +class TransmissibilitiesData(Data): """ The ``data`` block contains information about the data contained in this object. This class contains metadata for transmissibilities. @@ -530,7 +537,7 @@ class TransmissibilitiesContent(Content): """The type of content these data represent.""" -class VelocityContent(Content): +class VelocityData(Data): """ The ``data`` block contains information about the data contained in this object. This class contains metadata for velocities. @@ -540,7 +547,7 @@ class VelocityContent(Content): """The type of content these data represent.""" -class VolumesContent(Content): +class VolumesData(Data): """ The ``data`` block contains information about the data contained in this object. This class contains metadata for volumes. @@ -550,7 +557,7 @@ class VolumesContent(Content): """The type of content these data represent.""" -class WellPicksContent(Content): +class WellPicksData(Data): """ The ``data`` block contains information about the data contained in this object. This class contains metadata for well picks. @@ -560,45 +567,45 @@ class WellPicksContent(Content): """The type of content these data represent.""" -class AnyContent(RootModel): +class AnyData(RootModel): """ The ``data`` block contains information about the data contained in this object. - This class, ``AnyContent``, is a root model that allows for data with more specific + This class, ``AnyData``, is a root model that allows for data with more specific content types to be placed within it. It can contain the metadata for any data object. - See :class:`Content` to get an overview of all of the subfields used in the ``data`` + See :class:`Data` to get an overview of all of the subfields used in the ``data`` block. Between the different content types, only the ``data.content`` field will differ. This field indicates the type of content the data are representing. """ root: Annotated[ Union[ - DepthContent, - FaciesThicknessContent, - FaultLinesContent, - FieldOutlineContent, - FieldRegionContent, - FluidContactContent, - KPProductContent, - LiftCurvesContent, - NamedAreaContent, - ParametersContent, - PinchoutContent, - PropertyContent, - FaultPropertiesContent, - PVTContent, - RegionsContent, - RelpermContent, - RFTContent, - SeismicContent, - SubcropContent, - ThicknessContent, - TimeContent, - TimeSeriesContent, - VelocityContent, - VolumesContent, - WellPicksContent, + DepthData, + FaciesThicknessData, + FaultLinesData, + FieldOutlineData, + FieldRegionData, + FluidContactData, + KPProductData, + LiftCurvesData, + NamedAreaData, + ParametersData, + PinchoutData, + PropertyData, + FaultPropertiesData, + PVTData, + RegionsData, + RelpermData, + RFTData, + SeismicData, + SubcropData, + ThicknessData, + TimeData, + TimeSeriesData, + VelocityData, + VolumesData, + WellPicksData, ], Field(discriminator="content"), ] diff --git a/src/fmu/dataio/datastructure/meta/meta.py b/src/fmu/dataio/datastructure/meta/meta.py index b99919d8d..c36729506 100644 --- a/src/fmu/dataio/datastructure/meta/meta.py +++ b/src/fmu/dataio/datastructure/meta/meta.py @@ -264,7 +264,7 @@ class Realization(BaseModel): class CountryItem(BaseModel): """The ``smda.masterdata.country`` block contains a list of countries known - to SMDA.""" + to SMDA. This class represents one such country.""" identifier: str = Field(examples=["Norway"]) """Identifier known to SMDA.""" @@ -275,7 +275,7 @@ class CountryItem(BaseModel): class DiscoveryItem(BaseModel): """The ``masterdata.smda.discovery`` block contains a list of - discoveries known to SMDA.""" + discoveries known to SMDA. This class represents one such discovery.""" short_identifier: str = Field(examples=["SomeDiscovery"]) """Identifier known to SMDA.""" @@ -286,7 +286,7 @@ class DiscoveryItem(BaseModel): class FieldItem(BaseModel): """The ``masterdata.smda.field`` block contains a list of fields - known to SMDA.""" + known to SMDA. This class represents one such field.""" identifier: str = Field(examples=["OseFax"]) """Identifier known to SMDA.""" @@ -606,9 +606,9 @@ class ObjectMetadata(MetadataBase): """The ``access`` block contains information related to access control for this data object. See :class:`SsdlAccess`.""" - data: content.AnyContent + data: content.AnyData """The ``data`` block contains information about the data contains in this - object. See :class:`content.AnyContent`.""" + object. See :class:`content.AnyData`.""" file: File """ The ``file`` block contains references to this data object as a file on a disk. @@ -669,7 +669,7 @@ def _remove_discriminator_mapping(obj: Dict) -> Dict: failures in applications like `sumo-core`. """ del obj["discriminator"]["mapping"] - del obj["$defs"]["AnyContent"]["discriminator"]["mapping"] + del obj["$defs"]["AnyData"]["discriminator"]["mapping"] return obj diff --git a/src/fmu/dataio/providers/objectdata/_base.py b/src/fmu/dataio/providers/objectdata/_base.py index d9f538335..98259856e 100644 --- a/src/fmu/dataio/providers/objectdata/_base.py +++ b/src/fmu/dataio/providers/objectdata/_base.py @@ -12,7 +12,7 @@ from fmu.dataio._utils import generate_description from fmu.dataio.datastructure._internal.internal import AllowedContent, UnsetAnyContent from fmu.dataio.datastructure.meta.content import ( - AnyContent, + AnyData, Time, Timestamp, ) @@ -65,7 +65,7 @@ class ObjectDataProvider(Provider): # result properties; the most important is metadata which IS the 'data' part in # the resulting metadata. But other variables needed later are also given # as instance properties in addition (for simplicity in other classes/functions) - _metadata: AnyContent | UnsetAnyContent | None = field(default=None) + _metadata: AnyData | UnsetAnyContent | None = field(default=None) name: str = field(default="") time0: datetime | None = field(default=None) time1: datetime | None = field(default=None) @@ -120,7 +120,7 @@ def __post_init__(self) -> None: self._metadata = ( UnsetAnyContent.model_validate(metadata) if metadata["content"] == "unset" - else AnyContent.model_validate(metadata) + else AnyData.model_validate(metadata) ) logger.info("Derive all metadata for data object... DONE") @@ -166,7 +166,7 @@ def get_bbox(self) -> BoundingBox2D | BoundingBox3D | None: def get_spec(self) -> AnySpecification | None: raise NotImplementedError - def get_metadata(self) -> AnyContent | UnsetAnyContent: + def get_metadata(self) -> AnyData | UnsetAnyContent: assert self._metadata is not None return self._metadata