From b555902c5d7de1dc9cb426d5350a9958c454fbe2 Mon Sep 17 00:00:00 2001 From: "Yngve S. Kristiansen" Date: Wed, 20 Nov 2024 08:58:50 +0100 Subject: [PATCH] get_ensemble_responses without get_ensemble_state --- src/ert/dark_storage/endpoints/records.py | 27 ++++++++--------------- 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/src/ert/dark_storage/endpoints/records.py b/src/ert/dark_storage/endpoints/records.py index 365a144c32e..dfccb39c1e3 100644 --- a/src/ert/dark_storage/endpoints/records.py +++ b/src/ert/dark_storage/endpoints/records.py @@ -19,7 +19,6 @@ ) from ert.dark_storage.enkf import get_storage from ert.storage import Storage -from ert.storage.realization_storage_state import RealizationStorageState router = APIRouter(tags=["record"]) @@ -117,7 +116,6 @@ def get_ensemble_responses( response_names_with_observations = set() observations = ensemble.experiment.observations - for ( response_type, response_config, @@ -134,15 +132,7 @@ def get_ensemble_responses( ) response_names_with_observations.update(set(obs_with_responses)) - has_responses = any( - s == RealizationStorageState.HAS_DATA for s in ensemble.get_ensemble_state() - ) - - for name in ( - ensemble.experiment.response_type_to_response_keys.get("summary", []) - if has_responses - else [] - ): + for name in ensemble.experiment.response_type_to_response_keys.get("summary", []): response_map[str(name)] = js.RecordOut( id=UUID(int=0), name=name, @@ -150,13 +140,14 @@ def get_ensemble_responses( has_observations=name in response_names_with_observations, ) - for name in gen_data_display_keys(ensemble) if has_responses else []: - response_map[str(name)] = js.RecordOut( - id=UUID(int=0), - name=name, - userdata={"data_origin": "GEN_DATA"}, - has_observations=name in response_names_with_observations, - ) + if "gen_data" in ensemble.experiment.response_type_to_response_keys: + for name in gen_data_display_keys(ensemble): + response_map[str(name)] = js.RecordOut( + id=UUID(int=0), + name=name, + userdata={"data_origin": "GEN_DATA"}, + has_observations=name in response_names_with_observations, + ) return response_map