From 53eea27b8b6c7a004ecf1ce485cb7ef1b5683f64 Mon Sep 17 00:00:00 2001 From: "Yngve S. Kristiansen" Date: Tue, 26 Nov 2024 15:09:27 +0100 Subject: [PATCH] Remove realizations_initialized used in test only --- src/ert/storage/local_ensemble.py | 23 ------------------- .../unit_tests/storage/test_local_storage.py | 11 +++++++-- 2 files changed, 9 insertions(+), 25 deletions(-) diff --git a/src/ert/storage/local_ensemble.py b/src/ert/storage/local_ensemble.py index 57755f0d27c..d8d71a723fc 100644 --- a/src/ert/storage/local_ensemble.py +++ b/src/ert/storage/local_ensemble.py @@ -297,29 +297,6 @@ def has_data(self) -> List[int]: if RealizationStorageState.RESPONSES_LOADED in ensemble_state[i] ] - def realizations_initialized(self, realizations: List[int]) -> bool: - """ - Check if specified realizations are initialized. - - Parameters - ---------- - realizations : list of int - List of realization indices. - - Returns - ------- - initialized : bool - True if all realizations are initialized. - """ - - responses = self.get_realization_mask_with_responses() - parameters = self.get_realization_mask_with_parameters() - - if len(responses) == 0 and len(parameters) == 0: - return False - - return all((responses[real] or parameters[real]) for real in realizations) - def get_realization_list_with_responses(self) -> List[int]: """ List of realization indices with associated responses. diff --git a/tests/ert/unit_tests/storage/test_local_storage.py b/tests/ert/unit_tests/storage/test_local_storage.py index fb77caae178..ac29023e1b0 100644 --- a/tests/ert/unit_tests/storage/test_local_storage.py +++ b/tests/ert/unit_tests/storage/test_local_storage.py @@ -804,7 +804,12 @@ def write_error_in_save_field(self, model_ensemble: Ensemble, field_data): parameters = model_ensemble.parameter_values.values() fields = [p for p in parameters if isinstance(p, Field)] - assume(not storage_ensemble.realizations_initialized([self.iens_to_edit])) + + assume( + not storage_ensemble.get_realization_mask_with_parameters()[ + self.iens_to_edit + ] + ) for f in fields: with ( patch( @@ -824,7 +829,9 @@ def write_error_in_save_field(self, model_ensemble: Ensemble, field_data): ) assert temp_file.entered - assert not storage_ensemble.realizations_initialized([self.iens_to_edit]) + assert not storage_ensemble.get_realization_mask_with_parameters()[ + self.iens_to_edit + ] @rule( model_ensemble=ensembles,