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

Improve validation for unintialized ensembles in manual update and evaluate ensemble #8980

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

jonathan-eq
Copy link
Contributor

@jonathan-eq jonathan-eq commented Oct 16, 2024

Issue
Resolves #8691

Approach
Short description of the approach

(Screenshot of new behavior in GUI if applicable)

image

When specifying failed realizations:
image

  • PR title captures the intent of the changes, and is fitting for release notes.
  • Added appropriate release note label
  • Commit history is consistent and clean, in line with the contribution guidelines.
  • Make sure unit tests pass locally after every commit (git rebase -i main --exec 'pytest tests/ert/unit_tests -n logical -m "not integration_test"')

When applicable

  • When there are user facing changes: Updated documentation
  • New behavior or changes to existing untested code: Ensured that unit tests are added (See Ground Rules).
  • Large PR: Prepare changes in small commits for more convenient review
  • Bug fix: Add regression test for the bug
  • Bug fix: Create Backport PR to latest release

@codecov-commenter
Copy link

codecov-commenter commented Oct 16, 2024

Codecov Report

Attention: Patch coverage is 87.80488% with 5 lines in your changes missing coverage. Please review.

Project coverage is 91.53%. Comparing base (74e401e) to head (79e6917).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...c/ert/validation/ensemble_realizations_argument.py 82.75% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8980      +/-   ##
==========================================
- Coverage   91.54%   91.53%   -0.01%     
==========================================
  Files         347      348       +1     
  Lines       21397    21433      +36     
==========================================
+ Hits        19588    19619      +31     
- Misses       1809     1814       +5     
Flag Coverage Δ
cli-tests 39.57% <24.39%> (-0.04%) ⬇️
gui-tests 73.56% <87.80%> (-0.02%) ⬇️
performance-tests 50.15% <29.26%> (-0.06%) ⬇️
unit-tests 80.11% <85.36%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jonathan-eq jonathan-eq self-assigned this Oct 17, 2024
@jonathan-eq jonathan-eq added the release-notes:improvement Automatically categorise as improvement in release notes label Oct 17, 2024
@jonathan-eq jonathan-eq changed the title Quickfix no validation for unintialized ensembles Improve validation for unintialized ensembles in manual update and evaluate ensemble Oct 17, 2024
@jonathan-eq jonathan-eq force-pushed the fix-bugs3 branch 2 times, most recently from 134593d to ca70d8f Compare October 17, 2024 10:24
@jonathan-eq jonathan-eq marked this pull request as ready for review October 17, 2024 10:24

class RealizationsInEnsembleArgument(RangeStringArgument):
UNINITIALIZED_REALIZATIONS_SPECIFIED = (
"The specified realization(s) %s are not found in selected ensemble."
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we append the ensemble.name?; ie. "The specified realization(s) %s are not found in selected ensemble %s."?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ignore :)

validation_status.setValue(token)
return validation_status

def _validate_selected_realization_exist(self, realization: int) -> bool:
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't understand this one. Why we need to have responses when we are about to run evaluate experiment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

^I meant to do parameters, not responses :)

attempted_realizations = rangestring_to_list(token)

invalid_realizations = []
initialized_realization_ids = self.__ensemble.is_initalized()
Copy link
Contributor

Choose a reason for hiding this comment

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

now it makes sense :)

@xjules
Copy link
Contributor

xjules commented Oct 18, 2024

Can you squash the commits?

experiment

This commit adds validation for the realizations specified by the user
when trying to run `manual_update` or `evaluate_experiment`. The
validator checks the selected ensemble if the specified realization(s)
exists. If not, the field becomes red and a warning is displayed.
The commit also disables the realization field until an ensemble is
selected.
Copy link
Contributor

@xjules xjules left a comment

Choose a reason for hiding this comment

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

Nice PR @jonathan-eq ! 🚀

@jonathan-eq jonathan-eq merged commit 2a0fc2c into equinor:main Oct 18, 2024
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes:improvement Automatically categorise as improvement in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No validation for uninitialized ensembles in manual update/evaluate experiment
3 participants