DEP: Deprecate warning for ExportData.fmu-context - #1784
Conversation
28a29ed to
0c77671
Compare
| if ( | ||
| preprocessed | ||
| and fmu_context_input is None | ||
| and effective_context == FMUContext.realization | ||
| ): | ||
| effective_context = FMUContext.case |
There was a problem hiding this comment.
You should not need to the fmu_context_input here, if fmu_context_input was None the effective_context was set from environment. So this should be enough
| if ( | |
| preprocessed | |
| and fmu_context_input is None | |
| and effective_context == FMUContext.realization | |
| ): | |
| effective_context = FMUContext.case | |
| if ( | |
| preprocessed | |
| and effective_context == FMUContext.realization | |
| ): | |
| effective_context = FMUContext.case |
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 preprocessed should be run outside of ERT or with context case... but this seems wrong to me, preprocessed is only intended to be run outside of an ERT run, and then to be included into the run by the COPY_PREPROCESSED ERT workflow. Hence I struggle to see the use case for supporting case context here.
Could we make an issue to deprecate preprocessed in case context? 🙂
| Returns: | ||
| Tuple of (transformed_fmu_context, transformed_preprocessed). | ||
| """ | ||
| if fmu_context_input is not None and fmu_context_input != "preprocessed": |
There was a problem hiding this comment.
remove fmu_context_input != "preprocessed":
| "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 " |
There was a problem hiding this comment.
| "Preprocessed data should be exported in case context or outside of " | |
| "Preprocessed data should be exported outside of " |
| """Export a preprocessed surface with metadata.""" | ||
|
|
||
| export_data = ExportData( | ||
| config=CFG, |
There was a problem hiding this comment.
While in here, you could remove the config from this example
Resolves #1513
Checklist
--cov=src/ --cov-report term-missing)