Skip to content

Commit

Permalink
Update restart experiment by updating shapshot only when restarting e…
Browse files Browse the repository at this point in the history
…xperiment
  • Loading branch information
xjules committed Sep 13, 2024
1 parent d8b17e4 commit 3c4947f
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/ert/gui/simulation/run_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ def __init__(

self.on_run_model_event.connect(self._on_event)

self._restart = False

def _current_tab_changed(self, index: int) -> None:
widget = self._tab_widget.widget(index)
self.fm_step_frame.setHidden(isinstance(widget, UpdateWidget))
Expand Down Expand Up @@ -348,8 +350,10 @@ def closeEvent(self, a0: Optional[QCloseEvent]) -> None:
a0.ignore()

def run_experiment(self, restart: bool = False) -> None:
self._snapshot_model.reset()
self._tab_widget.clear()
self._restart = restart
if restart is False:
self._snapshot_model.reset()
self._tab_widget.clear()

port_range = None
if self._run_model.queue_system == QueueSystem.LOCAL:
Expand Down Expand Up @@ -431,7 +435,14 @@ def _on_event(self, event: object) -> None:
self.done_button.setHidden(False)
elif isinstance(event, FullSnapshotEvent):
if event.snapshot is not None:
self._snapshot_model._add_snapshot(event.snapshot, str(event.iteration))
if self._restart:
self._snapshot_model._update_snapshot(
event.snapshot, str(event.iteration)
)
else:
self._snapshot_model._add_snapshot(
event.snapshot, str(event.iteration)
)
self.update_total_progress(event.progress, event.iteration_label)
self._progress_widget.update_progress(
event.status_count, event.realization_count
Expand Down

0 comments on commit 3c4947f

Please sign in to comment.