-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: Add Ert experiment id to FMU metadata block #755
ENH: Add Ert experiment id to FMU metadata block #755
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of the group review: This field should be moved from FMUBase
(which is used only in the the case metadata) to the FMU
class, which is used in object metadata. Will need adjustment in the internal model too. But otherwise, looks good!
src/fmu/dataio/_model/fields.py
Outdated
ert: Optional[Ert] = Field(default=None) | ||
"""The ``fmu.ert`` block contains information about the current ert run | ||
object was exported. See :class:`Ert`.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just move this 👍
6a50273
to
164517e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is good to go. @tnatt or @jcrivenaes should confirm before merging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is aligned with what we agreed upon 🚀 and LGTM 🙂
src/fmu/dataio/providers/_fmu.py
Outdated
ert=fields.Ert( | ||
experiment=fields.Experiment( | ||
id=uuid.UUID(FmuEnv.EXPERIMENT_ID.value) | ||
if FmuEnv.EXPERIMENT_ID.value | ||
else None | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could pack this into a method self._get_ert_meta()
since it is used two places? Then it will be more aligned with the rest 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes absolutely, good point!
Ref PR description
I think it is correct to say it will be added to the fmu metadata block |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
I was a bit worried that taking a uuid.UUID(x)
, where x
already is a uuid is needed or could give something else, but it seems to give the same.
Resolves #670
Include _ERT_EXPERIMENT_ID from the enviroment variables in the FMU block of the exported metadata.
If the environment variable _ERT_EXPERIMENT_ID is present, it will be appended to the FMU block in the exported metadata. For this, a new "ert" field has been added to the metadata file under the FMU block, in addition to a child field "experiment", which will contain the _ERT_EXPERIMENT_ID of type UUID:
Two new tests have been added to test if the _ERT_EXPERIMENT_ID is part of the FMU metadata when it is present in the environment variables.