-
Notifications
You must be signed in to change notification settings - Fork 123
Make EverestControl use pl.DataFrame for storing #12617
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
base: main
Are you sure you want to change the base?
Make EverestControl use pl.DataFrame for storing #12617
Conversation
e87d8ac to
f18c59d
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12617 +/- ##
==========================================
+ Coverage 90.54% 90.64% +0.10%
==========================================
Files 435 429 -6
Lines 30014 29823 -191
==========================================
- Hits 27175 27034 -141
+ Misses 2839 2789 -50
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
Should not need migration since the only thing Everviz uses from LocalStorage (ert-storage)) is summary data |
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.
Pull request overview
This PR refactors the EverestControl class to use Polars DataFrames instead of xarray Datasets for storing parameters, aligning it with the storage approach used by other parameter configurations.
Changes:
- Modified
EverestControl.create_storage_datasets()to return Polars DataFrames instead of xarray Datasets - Updated parameter loading/writing logic in
EverestControlto work with DataFrames - Added special handling in
LocalEnsemblefor everest_parameters type during save/load operations
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ert/config/everest_control.py | Refactored to use pl.DataFrame instead of xr.Dataset for storage and simplified write_to_runpath logic |
| src/ert/storage/local_ensemble.py | Added special handling for everest_parameters type with DataFrame merging/updating logic |
| src/ert/config/parameter_config.py | Updated return type signature to include config type |
| src/ert/config/gen_kw_config.py | Updated return type and added config type to yield statement |
| src/ert/config/field.py | Updated return type signature to include None for config type |
| src/ert/config/surface_config.py | Updated return type signature to include None for config type |
cb6a4ff to
45c0f07
Compare
45c0f07 to
06104bb
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
353b2ae to
17203ca
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
17203ca to
95c2133
Compare
|
@frode-aarstad you need to make a storage migration. xr.datasets -> pl.Dataframe |
| df_lazy = self._load_parameters_lazy(SCALAR_FILENAME) | ||
| df_lazy = df_lazy.select(["realization", *keys]) | ||
| names = df_lazy.collect_schema().names() | ||
| matches = [key for key in keys if any(key in item for item in names)] |
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.
not sure about this one. Shall we check if it is present in self.experiment.parameter_keys too?
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 this is covered. I added some tests and test_that_load_scalar_keys_raises_key_error_for_unregistered_parameters should cover this, or ?
I think we concluded that this does not require a storage migration |
We are testing it now:
|
Looks good. Works as intended |
jonathan-eq
left a comment
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 tiny questions, then we are ready for main!
76e4a27 to
5a82077
Compare
Issue
Resolves #12005
Approach
Short description of the approach
(Screenshot of new behavior in GUI if applicable)
git rebase -i main --exec 'just rapid-tests')When applicable