-
Notifications
You must be signed in to change notification settings - Fork 110
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
Store ert<->everest realization mapping #9767
base: main
Are you sure you want to change the base?
Store ert<->everest realization mapping #9767
Conversation
CodSpeed Performance ReportMerging #9767 will not alter performanceComparing Summary
|
4e70ffd
to
be7341e
Compare
d4d8a92
to
2202375
Compare
2202375
to
3990831
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.
Some comments but basically solid.
|
||
realization_mapping: dict[int, EverestRealizationInfo] = { | ||
idx: EverestRealizationInfo( | ||
geo_realization=self._everest_config.model.realizations[real], |
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.
Can we internally already move from geo
to model
, I think we should encourage that in the long run.
class EverestRealizationInfo(TypedDict): | ||
geo_realization: int | ||
perturbation: int | None # None means it stems from unperturbed controls | ||
# Q: Maybe we also need result ID, or no? Ref if we have multiple evaluations |
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.
Yes, we will probably, let's not worry about it now.
for e in self.ensembles: | ||
ens_parameters = { | ||
group: e.ert_ensemble.load_parameters(group) | ||
.to_dataarray() | ||
.data.reshape((e.ert_ensemble.ensemble_size, -1)) | ||
for group in parameter_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.
you think may need some caching here, or is there already in the storage?
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.
This just points to parameters saved in xr files in ERT storage
else None | ||
), | ||
) | ||
for idx, real in enumerate(evaluator_context.realizations) |
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.
This maps the indices of the control vectors to realizations/perturbations. Is that the intention? Because if the intention is to map simulation ID (= ert realization?) then this will fail if some control vectors are not evaluated due to being cached or being marked as inactive. You would need to do the same as I did in my recent PR to get the simulation ID's for the simulations that actually did run.
)["values"] | ||
|
||
cached_data = ( | ||
objectives.to_numpy() * -1, |
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.
Be careful after rebasing, the -1 is probably not needed anymore.
if constraints is not None: | ||
assert cached_constraints is not None | ||
constraints[control_idx, ...] = cached_constraints | ||
for control_idx, ( |
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.
I think caching is now always assumed to be on? We do have a flag for in in the configuration, maybe we should kill it.
Note: Should not be merged until a consistent realization mapping is received from ROPT, replacing the logic in the second commit of this PR.
Issue
Resolves #9751
Resolves #9674
Approach
Short description of the approach
(Screenshot of new behavior in GUI if applicable)
git rebase -i main --exec 'pytest tests/ert/unit_tests -n logical -m "not integration_test"'
)When applicable