-
Notifications
You must be signed in to change notification settings - Fork 20
DEP: Deprecate warning for ExportData.fmu-context #1784
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -358,6 +358,13 @@ def _resolve_fmu_context( | |||||||||||||||||||||||
| ) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| effective_context = _determine_effective_fmu_context(fmu_context_input, env_context) | ||||||||||||||||||||||||
| if ( | ||||||||||||||||||||||||
| preprocessed | ||||||||||||||||||||||||
| and fmu_context_input is None | ||||||||||||||||||||||||
| and effective_context == FMUContext.realization | ||||||||||||||||||||||||
| ): | ||||||||||||||||||||||||
| effective_context = FMUContext.case | ||||||||||||||||||||||||
|
Comment on lines
+361
to
+366
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should not need to the
Suggested change
Another note, the change here would essentially allow all realizations running in parallell to export to the same file, so might cause problems.. I know we have an error saying Could we make an issue to deprecate |
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| _validate_fmu_context_combination(effective_context, preprocessed) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| return effective_context, preprocessed | ||||||||||||||||||||||||
|
|
@@ -389,6 +396,13 @@ def _handle_fmu_context_deprecations( | |||||||||||||||||||||||
| Returns: | ||||||||||||||||||||||||
| Tuple of (transformed_fmu_context, transformed_preprocessed). | ||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||
| if fmu_context_input is not None and fmu_context_input != "preprocessed": | ||||||||||||||||||||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove |
||||||||||||||||||||||||
| warnings.warn( | ||||||||||||||||||||||||
| "The 'fmu_context' argument is deprecated and will be removed in the " | ||||||||||||||||||||||||
| "future. fmu-dataio now infers the FMU context from the environment.", | ||||||||||||||||||||||||
| FutureWarning, | ||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| if fmu_context_input == "preprocessed": | ||||||||||||||||||||||||
| warnings.warn( | ||||||||||||||||||||||||
| "Using the 'fmu_context' argument with value 'preprocessed' is " | ||||||||||||||||||||||||
|
|
@@ -468,9 +482,8 @@ def _validate_fmu_context_combination( | |||||||||||||||||||||||
| if preprocessed and context == FMUContext.realization: | ||||||||||||||||||||||||
| raise ValueError( | ||||||||||||||||||||||||
| "Can't export preprocessed data in a fmu_context='realization'. " | ||||||||||||||||||||||||
| "Preprocessed data should be exported with fmu_context='case' or " | ||||||||||||||||||||||||
| "outside of FMU entirely, and then re-exported using " | ||||||||||||||||||||||||
| "ExportPreprocessedData." | ||||||||||||||||||||||||
| "Preprocessed data should be exported in case context or outside of " | ||||||||||||||||||||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||
| "FMU entirely, and then re-exported using ExportPreprocessedData." | ||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
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.
While in here, you could remove the config from this example