Skip to content

Commit

Permalink
Replacing progress view with progress widget
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-el committed Jun 14, 2024
1 parent 77fa511 commit 7660539
Show file tree
Hide file tree
Showing 9 changed files with 211 additions and 345 deletions.
5 changes: 4 additions & 1 deletion src/ert/ensemble_evaluator/event.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from dataclasses import dataclass
from typing import Optional
from typing import Dict, Optional

from .snapshot import PartialSnapshot, Snapshot

Expand All @@ -10,6 +10,9 @@ class _UpdateEvent:
current_phase: int
total_phases: int
progress: float
done_realizations: int
realization_count: int
status_count: Dict[str, int]
iteration: int


Expand Down
145 changes: 0 additions & 145 deletions src/ert/gui/model/progress_proxy.py

This file was deleted.

24 changes: 9 additions & 15 deletions src/ert/gui/simulation/run_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
from ert.gui.ertnotifier import ErtNotifier
from ert.gui.ertwidgets.message_box import ErtMessageBox
from ert.gui.model.job_list import JobListProxyModel
from ert.gui.model.progress_proxy import ProgressProxyModel
from ert.gui.model.snapshot import COLUMNS, FileRole, IterNum, RealIens, SnapshotModel
from ert.gui.tools.file import FileDialog
from ert.gui.tools.plot.plot_tool import PlotTool
Expand All @@ -52,7 +51,7 @@
from ..find_ert_info import find_ert_info
from ..model.node import NodeType
from .queue_emitter import QueueEmitter
from .view import LegendView, ProgressView, RealizationWidget, UpdateWidget
from .view import ProgressWidget, RealizationWidget, UpdateWidget

_TOTAL_PROGRESS_TEMPLATE = "Total progress {total_progress}% — {phase_name}"

Expand Down Expand Up @@ -89,8 +88,6 @@ def __init__(
self._ticker = QTimer(self)
self._ticker.timeout.connect(self._on_ticker)

progress_proxy_model = ProgressProxyModel(self._snapshot_model, parent=self)

self._total_progress_label = QLabel(
_TOTAL_PROGRESS_TEMPLATE.format(
total_progress=0, phase_name=run_model.getPhaseName()
Expand All @@ -103,13 +100,7 @@ def __init__(
self._total_progress_bar.setTextVisible(False)

self._iteration_progress_label = QLabel(self)

self._progress_view = ProgressView(self)
self._progress_view.setModel(progress_proxy_model)
self._progress_view.set_active_progress(False)

legend_view = LegendView(self)
legend_view.setModel(progress_proxy_model)
self._progress_widget = ProgressWidget()

self._tab_widget = QTabWidget(self)
self._tab_widget.currentChanged.connect(self._current_tab_changed)
Expand Down Expand Up @@ -177,8 +168,7 @@ def __init__(
layout.addWidget(self._total_progress_label)
layout.addWidget(self._total_progress_bar)
layout.addWidget(self._iteration_progress_label)
layout.addWidget(self._progress_view)
layout.addWidget(legend_view)
layout.addWidget(self._progress_widget)
layout.addWidget(self._tab_widget)
layout.addWidget(self._job_label)
layout.addWidget(self._job_view)
Expand Down Expand Up @@ -382,14 +372,18 @@ def _on_event(self, event: object):
elif isinstance(event, FullSnapshotEvent):
if event.snapshot is not None:
self._snapshot_model._add_snapshot(event.snapshot, event.iteration)
self._progress_view.set_active_progress()
self.update_total_progress(event.progress, event.phase_name)
self._progress_widget.update_progress(
event.status_count, event.realization_count
)
elif isinstance(event, SnapshotUpdateEvent):
if event.partial_snapshot is not None:
self._snapshot_model._add_partial_snapshot(
event.partial_snapshot, event.iteration
)
self._progress_view.set_active_progress()
self._progress_widget.update_progress(
event.status_count, event.realization_count
)
self.update_total_progress(event.progress, event.phase_name)
elif isinstance(event, RunModelUpdateBeginEvent):
iteration = event.iteration
Expand Down
5 changes: 2 additions & 3 deletions src/ert/gui/simulation/view/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from .legend import LegendView
from .progress import ProgressView
from .progress_widget import ProgressWidget
from .realization import RealizationWidget
from .update import UpdateWidget

__all__ = ["LegendView", "ProgressView", "RealizationWidget", "UpdateWidget"]
__all__ = ["ProgressWidget", "RealizationWidget", "UpdateWidget"]
58 changes: 0 additions & 58 deletions src/ert/gui/simulation/view/legend.py

This file was deleted.

89 changes: 0 additions & 89 deletions src/ert/gui/simulation/view/progress.py

This file was deleted.

Loading

0 comments on commit 7660539

Please sign in to comment.