-
Notifications
You must be signed in to change notification settings - Fork 110
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
Refactor BatchSimulator #8899
Refactor BatchSimulator #8899
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #8899 +/- ##
==========================================
+ Coverage 91.63% 91.66% +0.02%
==========================================
Files 343 343
Lines 21162 21149 -13
==========================================
- Hits 19392 19386 -6
+ Misses 1770 1763 -7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
8c46732
to
50125a9
Compare
447a387
to
5168146
Compare
} | ||
|
||
|
||
def _extract_results(ever_config: EverestConfig, ert_config): |
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 a good change and makes sense, and it does not touch the ERT config code either.
I think overall it makes sense, the |
I agree, I was also not completely comfortable with it. I have now pushed a commit that undoes the changes to |
@@ -35,6 +35,51 @@ def batch_sim_example(setup_case): | |||
return setup_case("batch_sim", "batch_sim.ert") | |||
|
|||
|
|||
# TODO: The batch simulator was recently refactored. It now requires an 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.
Should probably remove the TODO:
but leave the rest of the comment in place
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.
LGTM, nice change. I think that adding the ExtParamConfig manually into the config dict makes more sense than doing it when initializing the Simulator
instance
e232292
to
3f5465a
Compare
Issue
Resolves #8753
We probably will replace the
BatchSimulator
in the future with other ERT functionality, so this PR might not be entirely necessary. Nevertheless, I think the refactored code is clearer which may be useful when we do the work to replaceBatchSimulator
.Approach
GEN_DATA
keys to the generated ert configExtParamConfig
parameter configsNote
I handle
ExtParamConfig
by parsing them inensemble_config.py
. Currently it seems thatExtParamConfig
does not have a corresponding keyword, which would make sense if we assume this is only used in the ert configs generated by everest. For this reason I just drop the data to be added in the generated ert config and generate the correspondingExtParamConfig
objects inExtParamConfig.from_dict
. We should discuss if that is an acceptable solution.One consequence of this PR is that a lot of tests break that assume that the
BatchSimulator
can be initialized from an ERT config file. That is not possible anymore, presumably theGEN_DATA
could be added to ERT config files, but theExtParamConfig
data cannot. Rather than changing the tests, I chose to patch the BatchSimulator class in the file to recover the old behavior, so that the batch simulator itself can still be tested.git rebase -i main --exec 'pytest tests/ert/unit_tests -n logical -m "not integration_test"'
)When applicable