Skip to content

Commit

Permalink
Handle empty ensemble edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
yngve-sk committed Dec 16, 2024
1 parent ebe548e commit 1336f40
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/ert/gui/tools/manage_experiments/storage_info_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,17 @@ def _filter_on_observation_label(df: polars.DataFrame) -> polars.DataFrame:
obs = _filter_on_observation_label(obs)

response_key = obs["response_key"].unique().to_list()[0]
response_ds = self._ensemble.load_responses(
response_key,
tuple(self._ensemble.get_realization_list_with_responses()),
reals_with_responses = tuple(
self._ensemble.get_realization_list_with_responses()
)

response_ds = (
self._ensemble.load_responses(
response_key,
reals_with_responses,
)
if reals_with_responses
else None
)

scaling_df = self._ensemble.load_observation_scaling_factors()
Expand Down Expand Up @@ -260,7 +268,7 @@ def _try_render_scaled_obs() -> None:
color="black",
)

if not response_ds.is_empty():
if response_ds is not None and not response_ds.is_empty():
response_ds_for_label = _filter_on_observation_label(response_ds).rename(
{"values": "Responses"}
)[["response_key", "Responses"]]
Expand Down

0 comments on commit 1336f40

Please sign in to comment.