Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix not being able to select other realizations than 0 in run dialog #9391

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/ert/gui/simulation/run_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ def on_snapshot_new_iteration(

widget = RealizationWidget(iter_row)
widget.setSnapshotModel(self._snapshot_model)
widget.itemClicked.connect(self._select_real)
self._select_real(widget._real_list_model.index(0, 0))
tab_index = self._tab_widget.addTab(
widget, f"Realizations for iteration {index.internalPointer().id_}"
Expand Down
18 changes: 17 additions & 1 deletion tests/ert/ui_tests/gui/test_restart_ensemble_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import Set

from qtpy.QtCore import Qt, QTimer
from qtpy.QtWidgets import QComboBox, QMessageBox, QWidget
from qtpy.QtWidgets import QComboBox, QLabel, QMessageBox, QWidget

from ert.gui.simulation.experiment_panel import ExperimentPanel
from ert.gui.simulation.run_dialog import RunDialog
Expand Down Expand Up @@ -77,6 +77,22 @@ def _evaluate(coeffs, x):
qtbot.waitUntil(lambda: run_dialog.is_simulation_done() == True, timeout=60000)
qtbot.waitUntil(lambda: run_dialog._tab_widget.currentWidget() is not None)

realization_box = run_dialog._tab_widget.widget(0)
assert type(realization_box) == RealizationWidget
# Click the second realization box
qtbot.mouseClick(
realization_box._real_view.viewport(),
Qt.LeftButton,
pos=realization_box._real_view.visualRect(
realization_box._real_list_model.index(1, 0)
).center(),
)
fm_step_model = run_dialog._fm_step_overview.model()
assert fm_step_model._real == 1

fm_step_label = run_dialog.findChild(QLabel, name="fm_step_label")
assert "Realization id 1 in iteration 0" in fm_step_label.text()

# Assert that the number of boxes in the detailed view is
# equal to the number of realizations
realization_widget = run_dialog._tab_widget.currentWidget()
Expand Down