-
Notifications
You must be signed in to change notification settings - Fork 108
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
Run ensemble experiment with design matrix #8941
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8941 +/- ##
==========================================
+ Coverage 91.64% 91.84% +0.20%
==========================================
Files 433 433
Lines 26722 26761 +39
==========================================
+ Hits 24489 24579 +90
+ Misses 2233 2182 -51
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
707fd91
to
88537d3
Compare
403b2fa
to
2fe829a
Compare
b97fc39
to
a2f1053
Compare
2d4c2cf
to
b399e41
Compare
494347a
to
ff892b4
Compare
dbf426b
to
04bf908
Compare
dedent( | ||
"""\ | ||
#!/usr/bin/env python | ||
import numpy as np |
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.
Is numpy and sys used in the script?
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.
No, good catch. it will be removed 👍
MIN_REALIZATIONS 10 | ||
ANALYSIS_SET_VAR STD_ENKF ENKF_TRUNCATION 0.8 | ||
DESIGN_MATRIX my_design_matrix.xlsx DESIGN_SHEET:my_sheet DEFAULT_SHEET:my_default_sheet | ||
with suppress(ConfigValidationError): |
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.
What was the reason for this suppress? I can not see how the test actually test anything now, since we do not expect it to reach the assert statement.
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.
The test just compares to configs, wherein the assert in the middle does exactly that. Suppress is to neglect validation error from wrongly formatted design matrix.
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.
Will it not now just exit the with context when you first encounter a validation error, which is before the assert is done?
I tried changing the NUM_REALIZATIONS to -10 in the first dedent block, and the test passed still.
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.
right, I sort of thought when the name of test is test_analysis_config_from_file_is_same_as_from_dict
it only compares the content of the dicts and not go into semantics, but can change it to have a meaningful entries in the matrix and can remove the suppress statement.
"""\ | ||
#!/usr/bin/env python | ||
import numpy as np | ||
import sys |
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.
Same as above, sys and numpy seems to be unused in the script.
@@ -162,6 +159,29 @@ def _seed_sequence(seed: Optional[int]) -> int: | |||
return int_seed | |||
|
|||
|
|||
def save_design_matrix_to_ensemble( |
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.
Should this be a method in the ensemble class? my_ensemble.save_design_matrix(...)
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.
There is already ensemble.save_parameters
, which represents the interface for storing parameters. Not sure if it would bring any value having it there as it is a special "class" of parameters.
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.
Add test for this latest commit?
207d070
to
44db77b
Compare
- Catagorical data is not treated properly yet, wherein the design matrix group that contains catagorical data will automatically store all parameters inside this group to objects; ie, strings. - Prefil active realization box with realizations from design matrix - Use design_matrix parameters in ensemble experiment - add test run cli with design matrix and poly example - add test that save parameters internalize DataFrame parameters in the storage - add merge function to merge design parameters with existing parameters -- Raise Validation error when having multiple overlapping groups - Update writting to parameter.txt with categorical values
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.
Great work! 🚀
Issue
Resolves #8961
Approach
Do design matrix validation on startup
Use design_matrix parameters in ensemble experiment
add merge function to merge design parameters with existing parameters
remove poly_design once done.
add unit and cli tests
(Screenshot of new behavior in GUI if applicable)
When hitting run and overlapping fails:
When loading wrongly formatted design matrix:
git rebase -i main --exec 'pytest tests/ert/unit_tests -n logical -m "not integration_test"'
)When applicable