Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DOC: Add more docstrings with some renaming
Browse files Browse the repository at this point in the history
mferrera committed Jun 28, 2024
1 parent fede792 commit 81f321a
Showing 8 changed files with 429 additions and 346 deletions.
4 changes: 2 additions & 2 deletions docs/src/datamodel/index.rst
Original file line number Diff line number Diff line change
@@ -32,8 +32,8 @@ documentation of these two models can be inspected from here.
.. toctree::
:maxdepth: -1

fmu.dataio.datastructure.meta.meta.FMUDataClassMeta
fmu.dataio.datastructure.meta.meta.FMUCaseClassMeta
~fmu.dataio.datastructure.meta.meta.ObjectMetadata
~fmu.dataio.datastructure.meta.meta.CaseMetadata


About the data model
454 changes: 226 additions & 228 deletions schema/definitions/0.8.0/schema/fmu_meta.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/fmu/dataio/case.py
Original file line number Diff line number Diff line change
@@ -121,10 +121,10 @@ def generate_metadata(self) -> dict:
masterdata=meta.Masterdata.model_validate(self.config["masterdata"]),
access=meta.Access.model_validate(self.config["access"]),
fmu=internal.FMUModelCase(
model=meta.FMUModel.model_validate(
model=meta.Model.model_validate(
self.config["model"],
),
case=meta.FMUCase(
case=meta.Case(
name=self.casename,
uuid=self._case_uuid(),
user=meta.User(id=self.caseuser),
6 changes: 3 additions & 3 deletions src/fmu/dataio/datastructure/_internal/internal.py
Original file line number Diff line number Diff line change
@@ -108,8 +108,8 @@ class JsonSchemaMetadata(BaseModel, populate_by_name=True):


class FMUModelCase(BaseModel):
model: meta.FMUModel
case: meta.FMUCase
model: meta.Model
case: meta.Case


class Context(BaseModel, use_enum_values=True):
@@ -137,7 +137,7 @@ class UnsetAnyContent(meta.content.AnyContent):
root: UnsetContent # type: ignore


class FMUClassMetaData(meta.FMUClassMetaData):
class FMUClassMetaData(meta.FMUAttributes):
# This class is identical to the one used in the schema
# exept for more fmu context values beeing allowed internally
context: Context # type: ignore
Original file line number Diff line number Diff line change
@@ -122,7 +122,7 @@ class GlobalConfiguration(BaseModel):

access: Access
masterdata: meta.Masterdata
model: meta.FMUModel
model: meta.Model
stratigraphy: Optional[Stratigraphy] = Field(
default=None,
)
299 changes: 192 additions & 107 deletions src/fmu/dataio/datastructure/meta/meta.py

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/fmu/dataio/providers/_fmu.py
Original file line number Diff line number Diff line change
@@ -302,8 +302,8 @@ def _get_iteration_meta(self, iter_uuid: UUID) -> meta.Iteration:
def _get_fmucontext_meta(self) -> internal.Context:
return internal.Context(stage=self.fmu_context)

def _get_fmumodel_meta(self) -> meta.FMUModel:
return meta.FMUModel.model_validate(self.model)
def _get_fmumodel_meta(self) -> meta.Model:
return meta.Model.model_validate(self.model)

def _get_workflow_meta(self) -> meta.Workflow:
assert self.workflow is not None
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -300,7 +300,7 @@ def fixture_globalconfig1():
ssdl=global_configuration.Ssdl(rep_include=False),
classification=global_configuration.enums.Classification.internal,
),
model=global_configuration.meta.FMUModel(
model=global_configuration.meta.Model(
name="Test",
revision="AUTO",
),

0 comments on commit 81f321a

Please sign in to comment.