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

Refactor RunDialog to depend less on RunModel #3108

Merged
merged 1 commit into from
Mar 28, 2022

Conversation

xjules
Copy link
Contributor

@xjules xjules commented Mar 16, 2022

Issue
Resolves #3024

Approach

  • Refactor RunDialog by migrating simulation running info into BaseRunModel
  • Move more processing logic into RunModel
    - [ ] Make EvaluatorTracker as a proxy for BaseRunModel this might be affected by Experiment server #2132 so left it for now

Pre review checklist

  • Added appropriate labels

Adding labels helps the maintainers when writing release notes, see sections and the
corresponding labels here: https://github.com/equinor/ert/blob/main/.github/release.yml

@xjules xjules self-assigned this Mar 16, 2022
@xjules xjules force-pushed the run_model_reb branch 2 times, most recently from 344c2ec to 191d143 Compare March 22, 2022 15:36
Copy link
Contributor

@jondequinor jondequinor left a comment

Choose a reason for hiding this comment

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

Did you figure out the segfault?

@xjules xjules changed the title Refactor RunDialog by utilizing EvaluatorTracker and BaseRunModel Add support for GUI monitor in ert3 evaluation Mar 25, 2022
@xjules xjules marked this pull request as ready for review March 25, 2022 08:54
@xjules
Copy link
Contributor Author

xjules commented Mar 25, 2022

Did you figure out the segfault?

Yes, I did. Rebasing commits one by one did the trick 😄

@xjules xjules changed the title Add support for GUI monitor in ert3 evaluation Refactor RunDialog to depend less on RunModel Mar 25, 2022
@codecov-commenter
Copy link

codecov-commenter commented Mar 25, 2022

Codecov Report

Merging #3108 (6a4992a) into main (c1ab94a) will increase coverage by 0.00%.
The diff coverage is 77.55%.

@@           Coverage Diff           @@
##             main    #3108   +/-   ##
=======================================
  Coverage   65.29%   65.30%           
=======================================
  Files         612      612           
  Lines       49298    49304    +6     
  Branches     4445     4445           
=======================================
+ Hits        32189    32196    +7     
- Misses      15618    15619    +1     
+ Partials     1491     1489    -2     
Impacted Files Coverage Δ
ert_gui/simulation/simulation_panel.py 88.88% <ø> (ø)
ert_shared/models/base_run_model.py 80.21% <50.00%> (-8.21%) ⬇️
ert_gui/simulation/run_dialog.py 81.81% <80.00%> (+5.49%) ⬆️
ert_shared/cli/model_factory.py 90.58% <87.50%> (ø)
ert_shared/models/multiple_data_assimilation.py 90.51% <91.66%> (ø)
ert_shared/cli/main.py 86.95% <100.00%> (ø)
ert_shared/models/ensemble_experiment.py 100.00% <100.00%> (ø)
ert_shared/models/ensemble_smoother.py 94.87% <100.00%> (+0.06%) ⬆️
ert_shared/models/iterated_ensemble_smoother.py 88.34% <100.00%> (ø)
ert_shared/models/single_test_run.py 83.33% <100.00%> (ø)
... and 4 more

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

return True
return False

def create_mask_from_failed_realizations(self) -> BoolVector:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
def create_mask_from_failed_realizations(self) -> BoolVector:
def _create_mask_from_failed_realizations(self) -> BoolVector:

inverted_mask[index] = initial[index] and not successful
return inverted_mask

def count_successful_realizations(self) -> int:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
def count_successful_realizations(self) -> int:
def _count_successful_realizations(self) -> int:

@@ -56,6 +64,7 @@ def __init__(self, ert: EnKFMain, queue_config: QueueConfig, phase_count: int =
self._last_run_iteration: int = -1
self._ert = ert
self.facade = LibresFacade(ert)
self._simulation_arguments = simulation_arguments
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe check if members initial_realizations_mask completed_realizations_mask can now be made private?

Copy link
Contributor

@jondequinor jondequinor left a comment

Choose a reason for hiding this comment

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

This is solid stuff. Really good refactor. Had some minor comments to rein in the BRM API.

Tested out all run models in the GUI, seems to work well! Also tried restart on a failed mda run.

👏 👏

@sondreso
Copy link
Collaborator

Could you shorten the commit message to be < 50 characters 🙂

This include updating some of the attributes and functions to become private in RunModel and making simulation arguments implicit attribute to RunModel.
@xjules xjules merged commit 20e968d into equinor:main Mar 28, 2022
@xjules xjules deleted the run_model_reb branch March 28, 2022 14:34
@sondreso sondreso added the release-notes:maintenance Automatically categorise as maintenance change in release notes label Apr 27, 2022
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
None yet
Development

Successfully merging this pull request may close these issues.

Make GUI independent of RunModel
4 participants