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

CLN: Move fmu_context validation for non-fmu runs to ExportData #533

Merged
merged 1 commit into from
Mar 18, 2024

Conversation

tnatt
Copy link
Collaborator

@tnatt tnatt commented Mar 18, 2024

Resolves #529 and adds a ExportData._fmurun attribute to eliminate the need for initializing a FmuProvider to detect the run environment.

@tnatt tnatt self-assigned this Mar 18, 2024
Comment on lines -295 to -308
if not fmudata.get_provider(): # e.g. run from RMS not in a FMU run
actual_context = (
FmuContext.PREPROCESSED
if self.dataio.fmu_context == FmuContext.PREPROCESSED
else FmuContext.get("non_fmu")
)
if self.dataio.fmu_context != actual_context:
logger.warning(
"Requested fmu_context is <%s> but since this is detected as a non "
"FMU run, the actual context is force set to <%s>",
self.dataio.fmu_context,
actual_context,
)
self.dataio.fmu_context = actual_context
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️ 🍰

@tnatt tnatt merged commit d87cd04 into equinor:main Mar 18, 2024
13 checks passed
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.

Move FMUContext check to ExportData post_init
2 participants