-
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
Add designmatrix for design2params #8715
base: main
Are you sure you want to change the base?
Conversation
619acb5
to
ce827c6
Compare
Some remaining questions/issues from this pr:
|
ce827c6
to
b2f859e
Compare
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.
Looks like a good start! Have some comments that might be good to take into account before merging.
return design_matrix_sheet | ||
|
||
|
||
def initialize_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.
Suggest moving this code around a bit, so it is more in line with the sample_prior
function.
@pytest.mark.usefixtures("copy_poly_case") | ||
def test_design_matrix(copy_poly_case): | ||
config_text = """ | ||
QUEUE_SYSTEM LOCAL |
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.
Suggest just appending DESIGN_MATRIX design_matrix.xlsx
to the regular poly.ert
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.
Done.
test-data/poly_example/poly.ert
Outdated
@@ -6,6 +6,7 @@ RUNPATH poly_out/realization-<IENS>/iter-<ITER> | |||
OBS_CONFIG observations | |||
REALIZATION_MEMORY 50mb | |||
|
|||
DESIGN_MATRIX design_matrix.xlsx |
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.
Suggest removing
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.
Done.
fhandle.write(config_text) | ||
ert_config = ErtConfig.from_file("my_config.ert") | ||
with open_storage(ert_config.ens_path, mode="w") as ert_storage: | ||
design_frame = read_design_matrix(ert_config, "design_matrix.xlsx") |
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.
Suggest creating a small dataframe here with test data, and exporting that to xlsx
, which will make creating asserts easier
DESIGN_MATRIX_GROUP = "DESIGN_MATRIX" | ||
|
||
|
||
def read_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.
Could probably have some unit tests for this.
if designsheetname == defaultssheetname: | ||
raise ValueError("Design-sheet and defaults-sheet can not be the same") | ||
|
||
# This should probably handle/(fill in) missing values in design_matrix_sheet as well |
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.
When merging suggest adding this as an issue instead (which is fine, dont have to fix it in this PR). Same goes for the other comments
@@ -142,3 +197,69 @@ def eventFilter(self, a0: Optional[QObject], a1: Optional[QEvent]) -> bool: | |||
if a1 is not None and a1.type() == QEvent.Type.Close: | |||
self.notifier.emitErtChange() | |||
return super().eventFilter(a0, a1) | |||
|
|||
def _add_initialize_from_design_matrix_tab(self) -> None: |
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.
We were talking about doing this with Ensemble experiment
instead, did you check how much work that would take?
bd9e22e
to
9fdf08b
Compare
@larsevj as discussed yesterday, let's split this PR into smaller ones; ie. I'd start by introducing |
9fdf08b
to
d6a78a0
Compare
Issue
Resolves
Approach
Short description of the approach
(Screenshot of new behavior in GUI if applicable)
git rebase -i main --exec 'pytest tests/unit_tests -n logical -m "not integration_test"'
)When applicable