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

Replacing progress view with progress widget #8152

Merged
merged 3 commits into from
Jun 18, 2024
Merged
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
4 changes: 3 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,8 @@ class _UpdateEvent:
current_phase: int
total_phases: int
progress: float
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