Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
JHolba committed Jan 23, 2025
1 parent 9ab46fe commit 2cc4097
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 22 deletions.
5 changes: 2 additions & 3 deletions src/ert/gui/simulation/ensemble_experiment_panel.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from dataclasses import dataclass

from PySide6 import QtCore
from PySide6.QtCore import Slot
from PySide6.QtCore import Qt, Slot
from PySide6.QtWidgets import QFormLayout, QHBoxLayout, QLabel, QPushButton

from ert.config import AnalysisConfig, DesignMatrix
Expand Down Expand Up @@ -44,7 +43,7 @@ def __init__(
layout = QFormLayout()
lab = QLabel(" ".join(EnsembleExperiment.__doc__.split())) # type: ignore
lab.setWordWrap(True)
lab.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeft)
lab.setAlignment(Qt.AlignmentFlag.AlignLeft)
layout.addRow(lab)

self._experiment_name_field = StringBox(
Expand Down
4 changes: 2 additions & 2 deletions src/ert/gui/simulation/evaluate_ensemble_panel.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from dataclasses import dataclass

import numpy as np
from PySide6 import QtCore
from PySide6.QtCore import Qt
from PySide6.QtWidgets import QFormLayout, QLabel

from ert.gui.ertnotifier import ErtNotifier
Expand Down Expand Up @@ -33,7 +33,7 @@ def __init__(self, ensemble_size: int, run_path: str, notifier: ErtNotifier):
layout = QFormLayout()
lab = QLabel(" ".join(EvaluateEnsemble.__doc__.split())) # type: ignore
lab.setWordWrap(True)
lab.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeft)
lab.setAlignment(Qt.AlignmentFlag.AlignLeft)
layout.addRow(lab)
self._ensemble_selector = EnsembleSelector(notifier, show_only_no_children=True)
layout.addRow("Ensemble:", self._ensemble_selector)
Expand Down
4 changes: 2 additions & 2 deletions src/ert/gui/simulation/manual_update_panel.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from dataclasses import dataclass

import numpy as np
from PySide6 import QtCore
from PySide6.QtCore import Qt
from PySide6.QtWidgets import QFormLayout, QLabel

from ert.config import AnalysisConfig
Expand Down Expand Up @@ -43,7 +43,7 @@ def __init__(
layout = QFormLayout()
lab = QLabel(" ".join(ManualUpdate.__doc__.split())) # type: ignore
lab.setWordWrap(True)
lab.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeft)
lab.setAlignment(Qt.AlignmentFlag.AlignLeft)
layout.addRow(lab)
self._ensemble_selector = EnsembleSelector(notifier)
layout.addRow("Ensemble:", self._ensemble_selector)
Expand Down
4 changes: 2 additions & 2 deletions src/ert/gui/simulation/single_test_run_panel.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from dataclasses import dataclass

from PySide6 import QtCore
from PySide6.QtCore import Qt
from PySide6.QtWidgets import QFormLayout, QLabel

from ert.gui.ertnotifier import ErtNotifier
Expand All @@ -27,7 +27,7 @@ def __init__(self, run_path: str, notifier: ErtNotifier):
layout = QFormLayout()
lab = QLabel(" ".join(SingleTestRun.__doc__.split())) # type: ignore
lab.setWordWrap(True)
lab.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeft)
lab.setAlignment(Qt.AlignmentFlag.AlignLeft)
layout.addRow(lab)

runpath_label = CopyableLabel(text=run_path)
Expand Down
7 changes: 3 additions & 4 deletions src/ert/gui/tools/event_viewer/panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
from collections.abc import Iterator
from contextlib import contextmanager

from PySide6 import QtCore
from PySide6.QtCore import QObject
from PySide6.QtCore import QObject, Signal, Slot
from PySide6.QtWidgets import QPlainTextEdit, QVBoxLayout

from ert.gui.tools.search_bar import SearchBar
Expand All @@ -14,7 +13,7 @@


class _Signaler(QObject):
append_log_statement = QtCore.Signal(str)
append_log_statement = Signal(str)


class _GUILogHandler(logging.Handler):
Expand Down Expand Up @@ -70,7 +69,7 @@ def __init__(self, log_handler: GUILogHandler):
self.setLayout(layout)
log_handler.append_log_statement.connect(self.val_changed)

@QtCore.Slot(str)
@Slot(str)
def val_changed(self, value: str) -> None:
self.text_box.appendPlainText(value)

Expand Down
4 changes: 2 additions & 2 deletions src/ert/gui/tools/search_bar/search_bar.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from PySide6 import QtCore
from PySide6.QtCore import Slot
from PySide6.QtGui import QBrush, QColor, QTextCharFormat, QTextCursor
from PySide6.QtWidgets import QBoxLayout, QHBoxLayout, QLabel, QLineEdit, QPlainTextEdit

Expand All @@ -11,7 +11,7 @@ def __init__(self, text_box: QPlainTextEdit, label: str = "Find"):
self.textChanged.connect(self.search_bar_changed)
self._cursor = self._text_box.textCursor()

@QtCore.Slot(str)
@Slot(str)
def search_bar_changed(self, value: str) -> None:
self.clear_selection()
if not value:
Expand Down
8 changes: 4 additions & 4 deletions tests/ert/unit_tests/gui/simulation/test_run_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@

import pandas as pd
import pytest
from PySide6 import QtWidgets
from PySide6.QtCore import Qt, QTimer
from PySide6.QtWidgets import (
QApplication,
QComboBox,
QDialogButtonBox,
QLabel,
QMessageBox,
QPushButton,
QToolButton,
QWidget,
Expand Down Expand Up @@ -83,10 +84,9 @@ def test_terminating_experiment_shows_a_confirmation_dialog(qtbot: QtBot, run_di
with qtbot.waitSignal(run_dialog.simulation_done, timeout=10000):

def handle_dialog():
terminate_dialog = wait_for_child(run_dialog, qtbot, QtWidgets.QMessageBox)
terminate_dialog = wait_for_child(run_dialog, qtbot, QMessageBox)
dialog_buttons = cast(
QtWidgets.QDialogButtonBox,
terminate_dialog.findChild(QtWidgets.QDialogButtonBox),
QDialogButtonBox, terminate_dialog.findChild(QDialogButtonBox)
).buttons()
yes_button = next(b for b in dialog_buttons if "Yes" in b.text())
qtbot.mouseClick(yes_button, Qt.MouseButton.LeftButton)
Expand Down
5 changes: 2 additions & 3 deletions tests/ert/unit_tests/gui/simulation/view/test_realization.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from datetime import datetime as dt

import pytest
from PySide6 import QtCore
from PySide6.QtCore import QModelIndex, QPersistentModelIndex, QSize
from PySide6.QtCore import QModelIndex, QPersistentModelIndex, QSize, Qt
from PySide6.QtWidgets import QStyledItemDelegate, QStyleOptionViewItem

from ert.ensemble_evaluator.snapshot import (
Expand Down Expand Up @@ -118,6 +117,6 @@ def check_selection_cb(index):
):
qtbot.mouseClick(
widget._real_view.viewport(),
QtCore.Qt.MouseButton.LeftButton,
Qt.MouseButton.LeftButton,
pos=selection_rect.center(),
)

0 comments on commit 2cc4097

Please sign in to comment.