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

Merge ForwardModel with ExtJob #6489

Merged
merged 2 commits into from
Nov 7, 2023

Conversation

berland
Copy link
Contributor

@berland berland commented Nov 3, 2023

Issue
Part of #6218

Approach
Short description of the approach

(Screenshot of new behavior in GUI if applicable)

Pre review checklist

  • Read through the code changes carefully after finishing work
  • Make sure tests pass locally (after every commit!)
  • Prepare changes in small commits for more convenient review (optional)
  • PR title captures the intent of the changes, and is fitting for release notes.
  • Updated documentation
  • Ensured that unit tests are added for all new behavior (See
    Ground Rules),
    and changes to existing code have good test coverage.

Pre merge checklist

  • Added appropriate release note label
  • Commit history is consistent and clean, in line with the contribution guidelines.

@berland berland changed the title Merge forwardmodel extjob Merge (move) ForwardModel with (to) ExtJob Nov 3, 2023
@berland berland changed the title Merge (move) ForwardModel with (to) ExtJob Merge ForwardModel with ExtJob Nov 6, 2023
@berland berland self-assigned this Nov 6, 2023
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.
@berland berland added the release-notes:maintenance Automatically categorise as maintenance change in release notes label Nov 6, 2023
@berland berland marked this pull request as ready for review November 6, 2023 14:13
@jonathan-eq jonathan-eq self-requested a review November 7, 2023 06:46
@codecov-commenter
Copy link

Codecov Report

Merging #6489 (e2be21f) into main (af7842c) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@            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     
Files Coverage Δ
src/ert/config/__init__.py 100.00% <100.00%> (ø)
src/ert/config/ert_config.py 94.90% <100.00%> (ø)
src/ert/config/forward_model.py 100.00% <100.00%> (ø)
src/ert/config/parsing/__init__.py 100.00% <100.00%> (ø)
src/ert/config/parsing/forward_model_keywords.py 88.46% <100.00%> (ø)
src/ert/config/parsing/forward_model_schema.py 100.00% <100.00%> (ø)
src/ert/ensemble_evaluator/_builder/_ensemble.py 91.91% <100.00%> (ø)
...rc/ert/ensemble_evaluator/_builder/_realization.py 100.00% <100.00%> (ø)
src/ert/run_models/base_run_model.py 94.71% <100.00%> (ø)

... 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"
Copy link
Contributor

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

Copy link
Contributor

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"

Copy link
Contributor Author

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(
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

@jonathan-eq jonathan-eq left a comment

Choose a reason for hiding this comment

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

LGTM!

@berland berland merged commit 15c4ae4 into equinor:main Nov 7, 2023
43 of 44 checks passed
@berland berland deleted the merge_forwardmodel_extjob branch November 8, 2023 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes:maintenance Automatically categorise as maintenance change in release notes
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants