From 6ba4b4903da1c73f3d1a82154df50a727388b540 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Therese=20Natter=C3=B8y?= <61694854+tnatt@users.noreply.github.com> Date: Thu, 11 Apr 2024 12:04:50 +0200 Subject: [PATCH] CLN: Use FMUCase model from schema in CaseSchema (#594) --- src/fmu/dataio/case.py | 5 +++-- src/fmu/dataio/datastructure/_internal/internal.py | 8 +------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/fmu/dataio/case.py b/src/fmu/dataio/case.py index c621fb73b..988fb9c6d 100644 --- a/src/fmu/dataio/case.py +++ b/src/fmu/dataio/case.py @@ -124,10 +124,11 @@ def generate_metadata(self) -> dict: model=global_configuration.Model.model_validate( self.config["model"], ), - case=internal.CaseMetadata( + case=meta.FMUCase( name=self.casename, - uuid=str(self._case_uuid()), + uuid=self._case_uuid(), user=meta.User(id=self.caseuser), + description=None, ), ), tracklog=_metadata.generate_meta_tracklog(), diff --git a/src/fmu/dataio/datastructure/_internal/internal.py b/src/fmu/dataio/datastructure/_internal/internal.py index 761f66610..06216b249 100644 --- a/src/fmu/dataio/datastructure/_internal/internal.py +++ b/src/fmu/dataio/datastructure/_internal/internal.py @@ -152,15 +152,9 @@ class JsonSchemaMetadata(BaseModel, populate_by_name=True): source: str = Field(default=SOURCE) -class CaseMetadata(BaseModel): - name: str - uuid: str - user: meta.User - - class FMUModel(BaseModel): model: GlobalConfigurationModel - case: CaseMetadata + case: meta.FMUCase class PreprocessedInfo(BaseModel):