Skip to content

Commit

Permalink
Test that measured data work with failed reals
Browse files Browse the repository at this point in the history
This caused the misfit preprocessor to fail when run
on cases that have failed realizations.

(cherry picked from commit b756eba)
  • Loading branch information
dafeda committed Sep 27, 2023
1 parent 1aa0069 commit e3e6551
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/ert/data/_measured_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,11 @@ def _get_data(
response = ensemble.load_response(
group, tuple(ensemble.realization_list(RealizationState.HAS_DATA))
)
except KeyError:
raise ResponseError(f"No response loaded for observation key: {key}")
_msg = f"No response loaded for observation key: {key}"
if not response:
raise ResponseError(_msg)
except KeyError as e:
raise ResponseError(_msg) from e
ds = obs.merge(
response,
join="left",
Expand Down
4 changes: 4 additions & 0 deletions tests/unit_tests/gui/test_full_manual_update_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from qtpy.QtCore import Qt, QTimer
from qtpy.QtWidgets import QApplication, QComboBox, QMessageBox, QPushButton, QWidget

from ert.data import MeasuredData
from ert.gui.ertwidgets.caselist import CaseList
from ert.gui.simulation.ensemble_experiment_panel import EnsembleExperimentPanel
from ert.gui.simulation.run_dialog import RunDialog
Expand Down Expand Up @@ -129,6 +130,9 @@ def handle_dialog():
df_prior = facade.load_all_gen_kw_data(storage.get_ensemble_by_name("iter-0"))
df_posterior = facade.load_all_gen_kw_data(storage.get_ensemble_by_name("iter-1"))

# Making sure measured data works with failed realizations
MeasuredData(facade, storage.get_ensemble_by_name("iter-0"), ["POLY_OBS"])

# We expect that ERT's update step lowers the
# generalized variance for the parameters.
assert (
Expand Down

0 comments on commit e3e6551

Please sign in to comment.