Skip to content
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: Set fmu_context from env variables if not explicitly given #586

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

tnatt
Copy link
Collaborator

@tnatt tnatt commented Apr 9, 2024

PR to change from having relization as default fmu_context, to using environment variables from ERT to set the fmu_context value if not explicitly given.

Closes #585

assert edata._fmurun is False
assert edata.fmu_context == FmuContext.NON_FMU


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly just OCD, but missing one combination in this pattern?

e.g.

assert FmuEnv.RUNPATH.value is not None
assert FmuEnv.EXPERIMENT_ID.value is None

(Probably just OCD)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be useful if we at some point use the presence of one of these as a condition to check for the presence of the next.

Copy link
Member

@perolavsvendsen perolavsvendsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR itself is good I think 👍
The whole topic is a bit sketchy, however. I.e. the whole concept/definition of the context (called "stage" in the code) is in need of some sort of refinement. (But that's not the point nor topic of this PR!)

One comment on the tests, which may or may not be relevant. But if the definition of one (in the future) is a condition for testing the definition of the next, it might be smart to have a test like the one suggested. Possibly...

Copy link
Collaborator

@mferrera mferrera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good change. I think we should also test this in a future integration test (not in this PR).

@tnatt tnatt merged commit a51370c into equinor:main Apr 10, 2024
13 checks passed
@tnatt tnatt deleted the fmu_context_from_env branch April 10, 2024 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use fmu_context fetched from environment as default if not explicitly provided
3 participants