Remove unused group parameter from load_scalars - #13966
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13966 +/- ##
==========================================
+ Coverage 91.34% 91.38% +0.03%
==========================================
Files 478 482 +4
Lines 34067 34198 +131
==========================================
+ Hits 31120 31252 +132
+ Misses 2947 2946 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
| @pytest.mark.filterwarnings("ignore:.*Use load_responses.*:DeprecationWarning") | ||
| @pytest.mark.filterwarnings("ignore:Config contains a SUMMARY key") | ||
| def test_data_fetching_missing_key(snake_oil_case): | ||
| def test_that_load_scalars_returns_empty_dataframe_when_no_scalars_exist( |
There was a problem hiding this comment.
this changes semantics of the test slightly. Maybe we do have a test for it though; ie. empty dataframe for load_scalars.
There was a problem hiding this comment.
could you change it to use load_scalar_keys instead? Then the previous test name is ok
There was a problem hiding this comment.
This a test for load_scalars() . load_scalar_keys() is tested elsewhere
There was a problem hiding this comment.
Pull request overview
This PR updates the storage LocalEnsemble.load_scalars API by removing the unused group parameter and adjusts unit tests/snapshots to reflect the new call pattern. This fits into ERT’s local storage layer by simplifying the scalar-loading interface and keeping tests aligned with the intended API surface.
Changes:
- Remove the
groupparameter fromLocalEnsemble.load_scalars. - Update unit tests to use the new
load_scalars()/load_scalars(realizations=...)signature and rename tests to behavior-style names. - Refresh snapshot outputs to match the updated test expectations.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/ert/unit_tests/storage/test_save_and_load_responses.py | Renames/updates test to validate empty DataFrame behavior using the new load_scalars() signature. |
| tests/ert/unit_tests/storage/test_save_and_load_parameters.py | Updates scalar-loading tests to the new API and refreshes snapshot naming/expectations. |
| tests/ert/unit_tests/storage/snapshots/test_save_and_load_parameters/test_that_load_scalars_returns_correct_data/0/data.csv | New snapshot for full load_scalars() output. |
| tests/ert/unit_tests/storage/snapshots/test_save_and_load_parameters/test_that_load_scalars_returns_correct_data/0/data_1.csv | New snapshot for load_scalars(realizations=[...]) output. |
| tests/ert/unit_tests/storage/snapshots/test_save_and_load_parameters/test_gen_kw_collector/0/gen_kw_collector_3.csv | Removes obsolete snapshot tied to the old test/API usage. |
| tests/ert/unit_tests/storage/snapshots/test_save_and_load_parameters/test_gen_kw_collector/0/gen_kw_collector_2.csv | Removes obsolete snapshot tied to the old test/API usage. |
| src/ert/storage/local_ensemble.py | Removes group filtering from load_scalars and simplifies the implementation accordingly. |
xjules
left a comment
There was a problem hiding this comment.
Remember to squash the commits.
Needed for #12784
Approach
Short description of the approach
(Screenshot of new behavior in GUI if applicable)
git rebase -i main --exec 'just rapid-tests')When applicable