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

Add more validation to design matrix #9915

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

jonathan-eq
Copy link
Contributor

@jonathan-eq jonathan-eq commented Jan 30, 2025

Issue
Resolves #8686

Approach
The commits in this PR add more validation to design matrix

(Screenshot of new behavior in GUI if applicable)

  • 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 'just rapid-tests')

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

@jonathan-eq jonathan-eq force-pushed the validate-design-matrix branch from ef743e9 to 09a6a89 Compare January 30, 2025 11:13
@jonathan-eq jonathan-eq added the release-notes:improvement Automatically categorise as improvement in release notes label Jan 30, 2025
@jonathan-eq jonathan-eq force-pushed the validate-design-matrix branch from 09a6a89 to dc7757f Compare January 30, 2025 11:17
Copy link

codspeed-hq bot commented Jan 30, 2025

CodSpeed Performance Report

Merging #9915 will improve performances by 12.16%

Comparing jonathan-eq:validate-design-matrix (6f3fb02) with main (15f6077)

Summary

⚡ 1 improvements
✅ 24 untouched benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
test_direct_dark_performance_with_storage[gen_x: 20, sum_x: 20 reals: 10-summary-get_record_observations] 1.5 ms 1.3 ms +12.16%

@@ -88,6 +88,9 @@ def __init__(
self._active_realizations_field.setText(
ActiveRange(design_matrix.active_realizations).rangestring
)
self._active_realizations_field.setValidator(
RangeStringArgument(design_matrix.get_num_realizations())
Copy link
Contributor

Choose a reason for hiding this comment

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

What does this do?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This would not work if the user is missing realizations in their designmatrix. Example: User only has real 0,1,5,6,9 in design matrix. This range string would not be validated correctly in this case.

Copy link
Contributor

Choose a reason for hiding this comment

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

Then if we don't have such a custom validator, I'd say let's just check on the actual run whether the active realization mask matches the active realizations in the field box?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we can validate it on the actual run; then it should be a small task to have it validated before enabling the run button.
Initial count:
image
Validator that counts incorrectly:
image

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, but active_mask=[0,5,9] and you set it to 0-9?

@jonathan-eq jonathan-eq force-pushed the validate-design-matrix branch 3 times, most recently from b60441e to e003f77 Compare February 6, 2025 11:38
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.

Very nice PR @jonathan-eq ! Could you update the commit message that includes all the new items that it adds?

@jonathan-eq jonathan-eq force-pushed the validate-design-matrix branch 2 times, most recently from 8a97a57 to cdffdb1 Compare February 6, 2025 12:16
This commit adds some validation to design matrix, and also makes the active_realizations_field
in the gui only accept realizations actually found in design matrix.
The designmatrix validation added in this commit:
* parameter names cannot contain multiple words
* parameter names cannot be numerical
@jonathan-eq jonathan-eq force-pushed the validate-design-matrix branch from cdffdb1 to 6f3fb02 Compare February 6, 2025 12:19
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.

😍 🚀

@jonathan-eq jonathan-eq merged commit 912dbc8 into equinor:main Feb 6, 2025
27 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.

Validate that DESIGN_MATRIX is correct upon initialization
2 participants