From 25ac827f6c4c054ed60a7dde70ff8ae68994599f Mon Sep 17 00:00:00 2001 From: "Yngve S. Kristiansen" Date: Tue, 26 Nov 2024 14:54:29 +0100 Subject: [PATCH] Remove unnecessary argument --- src/ert/dark_storage/common.py | 4 ++-- src/ert/data/_measured_data.py | 4 +--- .../jobs/internal-gui/scripts/gen_data_rft_export.py | 4 +--- src/ert/storage/local_ensemble.py | 10 +++------- tests/ert/unit_tests/storage/test_storage_migration.py | 2 +- 5 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/ert/dark_storage/common.py b/src/ert/dark_storage/common.py index a1c10ef4fd6..6385a09bf1a 100644 --- a/src/ert/dark_storage/common.py +++ b/src/ert/dark_storage/common.py @@ -125,7 +125,7 @@ def data_for_key( if response_type == "summary": summary_data = ensemble.load_responses( response_key, - tuple(ensemble.get_realization_list_with_responses(response_key)), + tuple(ensemble.get_realization_list_with_responses()), ) if summary_data.is_empty(): return pd.DataFrame() @@ -153,7 +153,7 @@ def data_for_key( response_key, report_step = displayed_key_to_response_key["gen_data"]( key ) - mask = ensemble.get_realization_mask_with_responses(response_key) + mask = ensemble.get_realization_mask_with_responses() realizations = np.where(mask)[0] data = ensemble.load_responses(response_key, tuple(realizations)) except ValueError as err: diff --git a/src/ert/data/_measured_data.py b/src/ert/data/_measured_data.py index de619af2ca3..beec3282446 100644 --- a/src/ert/data/_measured_data.py +++ b/src/ert/data/_measured_data.py @@ -110,9 +110,7 @@ def _get_data( ) responses_for_type = ensemble.load_responses( response_type, - realizations=tuple( - ensemble.get_realization_list_with_responses(response_type) - ), + realizations=tuple(ensemble.get_realization_list_with_responses()), ) if responses_for_type.is_empty(): diff --git a/src/ert/resources/workflows/jobs/internal-gui/scripts/gen_data_rft_export.py b/src/ert/resources/workflows/jobs/internal-gui/scripts/gen_data_rft_export.py index 6ad132d8a9f..5a847c6bc02 100644 --- a/src/ert/resources/workflows/jobs/internal-gui/scripts/gen_data_rft_export.py +++ b/src/ert/resources/workflows/jobs/internal-gui/scripts/gen_data_rft_export.py @@ -133,9 +133,7 @@ def run( "active for exactly one report step" ) - realizations = ensemble.get_realization_list_with_responses( - response_key - ) + realizations = ensemble.get_realization_list_with_responses() responses = ensemble.load_responses(response_key, tuple(realizations)) joined = obs_df.join( responses, diff --git a/src/ert/storage/local_ensemble.py b/src/ert/storage/local_ensemble.py index 125c31a7a5b..57755f0d27c 100644 --- a/src/ert/storage/local_ensemble.py +++ b/src/ert/storage/local_ensemble.py @@ -233,9 +233,7 @@ def get_realization_mask_with_parameters(self) -> npt.NDArray[np.bool_]: ] ) - def get_realization_mask_with_responses( - self, key: Optional[str] = None - ) -> npt.NDArray[np.bool_]: + def get_realization_mask_with_responses(self) -> npt.NDArray[np.bool_]: """ Mask array indicating realizations with associated responses. @@ -322,9 +320,7 @@ def realizations_initialized(self, realizations: List[int]) -> bool: return all((responses[real] or parameters[real]) for real in realizations) - def get_realization_list_with_responses( - self, key: Optional[str] = None - ) -> List[int]: + def get_realization_list_with_responses(self) -> List[int]: """ List of realization indices with associated responses. @@ -339,7 +335,7 @@ def get_realization_list_with_responses( List of realization indices with associated responses. """ - mask = self.get_realization_mask_with_responses(key) + mask = self.get_realization_mask_with_responses() return np.where(mask)[0].tolist() def set_failure( diff --git a/tests/ert/unit_tests/storage/test_storage_migration.py b/tests/ert/unit_tests/storage/test_storage_migration.py index 6a627107f5a..40a2fbb3229 100644 --- a/tests/ert/unit_tests/storage/test_storage_migration.py +++ b/tests/ert/unit_tests/storage/test_storage_migration.py @@ -166,7 +166,7 @@ def test_that_storage_matches( summary_data = ensemble.load_responses( "summary", - tuple(ensemble.get_realization_list_with_responses("summary")), + tuple(ensemble.get_realization_list_with_responses()), ) snapshot.assert_match( summary_data.sort("time", "response_key", "realization")