-
Notifications
You must be signed in to change notification settings - Fork 104
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
Merge ForwardModel with ExtJob #6489
Conversation
73c8903
to
a3c5f75
Compare
The ForwardModel class in ensemble_evaluator is removed, and ExtJob is renamed to ForwardModel. The ForwardModel aka ExtJob is then used directly in the Realization object in ensemble_evaluator.
a3c5f75
to
e2be21f
Compare
Codecov Report
@@ Coverage Diff @@
## main #6489 +/- ##
==========================================
- Coverage 83.49% 83.48% -0.01%
==========================================
Files 341 341
Lines 20716 20710 -6
Branches 938 938
==========================================
- Hits 17296 17289 -7
Misses 3130 3130
- Partials 290 291 +1
... and 1 file with indirect coverage changes 📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today! |
@@ -10,7 +10,7 @@ class StrEnum(str, Enum): | |||
from enum import StrEnum | |||
|
|||
|
|||
class ExtJobKeys(StrEnum): | |||
class ForwardModelKeys(StrEnum): | |||
NAME = "NAME" |
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.
Would it be more "python-way" to use auto() instead of hardcoding "NAME" and "EXECUTABLE"? That seems like one of the benefits of inheriting from StrEnum
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 just realized there were way more enums than those two. We should probably replace all the hardcoded values with auto to be DRY "compliant"
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.
Yes, should be its own issue.
for forward_model in real.forward_models: | ||
reals[str(real.iens)].jobs[str(forward_model.id_)] = Job( | ||
for index, forward_model in enumerate(real.forward_models): | ||
reals[str(real.iens)].jobs[str(index)] = Job( |
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.
Could there be a situation where forward_model.id_ would be different than its index in the list?
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.
Maybe there were situations like that earlier, but I haven't found such situations now. Tests do not uncover any issues with this simplification at least. I think not relying on this integer index is an ert3 pattern.
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!
Issue
Part of #6218
Approach
Short description of the approach
(Screenshot of new behavior in GUI if applicable)
Pre review checklist
Ground Rules),
and changes to existing code have good test coverage.
Pre merge checklist