Skip to content

Commit

Permalink
Use PyQt6
Browse files Browse the repository at this point in the history
  • Loading branch information
JHolba committed Jan 23, 2025
1 parent 2cc4097 commit 4633081
Show file tree
Hide file tree
Showing 123 changed files with 328 additions and 301 deletions.
38 changes: 14 additions & 24 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
[build-system]
requires = [
"setuptools",
"setuptools_scm>=8.1",
]
requires = ["setuptools", "setuptools_scm>=8.1"]
build-backend = "setuptools.build_meta"

[project]
name = "ert"
authors = [
{ name = "Equinor ASA", email = "[email protected]" },
]
authors = [{ name = "Equinor ASA", email = "[email protected]" }]
description = "Ensemble based Reservoir Tool (ERT)"
requires-python = ">=3.11"
readme = "README.md"
Expand Down Expand Up @@ -42,7 +37,7 @@ dependencies = [
"matplotlib",
"netCDF4",
"numpy<2",
"openpyxl", # extra dependency for pandas (excel)
"openpyxl", # extra dependency for pandas (excel)
"opentelemetry-api",
"opentelemetry-sdk",
"opentelemetry-instrumentation-fastapi",
Expand All @@ -54,18 +49,18 @@ dependencies = [
"pluggy>=1.3.0",
"polars>=1",
"psutil",
"pyarrow", # extra dependency for pandas (parquet)
"pyarrow", # extra dependency for pandas (parquet)
"pydantic > 2",
"python-dateutil",
"python-multipart", # extra dependency for fastapi
"python-multipart", # extra dependency for fastapi
"pyyaml",
"pyzmq",
"PySide6",
"pyqt6",
"requests",
"resfo",
"scipy >= 1.10.1, < 1.15",
"seaborn",
"tables", # extra dependency for pandas (hdf5)
"tables", # extra dependency for pandas (hdf5)
"tabulate",
"tqdm>=4.62.0",
"typing_extensions>=4.5",
Expand Down Expand Up @@ -121,14 +116,11 @@ dev = [
"sphinx-autoapi",
"sphinx-copybutton",
"sphinxcontrib.datatemplates",
"json-schema-for-humans"
]
style = [
"pre-commit",
"json-schema-for-humans",
]
style = ["pre-commit"]
types = [
"mypy",
"pyside6-stubs",
"types-lxml",
"types-requests",
"types-PyYAML",
Expand All @@ -137,7 +129,7 @@ types = [
"types-docutils",
"types-tqdm",
"types-psutil",
"types-setuptools"
"types-setuptools",
]
everest = [
"progressbar2",
Expand All @@ -152,7 +144,7 @@ everest = [
]

[tool.setuptools]
package-dir = {"" = "src"}
package-dir = { "" = "src" }
platforms = ["all"]

[tool.setuptools.package-data]
Expand Down Expand Up @@ -239,9 +231,7 @@ allow-dunder-method-names = [
]

[tool.ruff.lint.flake8-bugbear]
extend-immutable-calls = [
"fastapi.Depends",
]
extend-immutable-calls = ["fastapi.Depends"]

[tool.pyright]
include = ["src"]
Expand All @@ -251,7 +241,7 @@ typeCheckingMode = "standard"
pythonVersion = "3.11"

[tool.pyright.defineConstant]
PYSIDE6 = true
PYSIDE6 = false
PYQT5 = false
PYSIDE2 = false
PYQT6 = false
PYQT6 = true
2 changes: 1 addition & 1 deletion src/ert/ensemble_evaluator/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from datetime import datetime
from typing import Any, TypeVar, cast, get_args

from PySide6.QtGui import QColor
from PyQt6.QtGui import QColor
from typing_extensions import TypedDict

from _ert.events import (
Expand Down
6 changes: 3 additions & 3 deletions src/ert/gui/about_dialog.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from PySide6.QtCore import QSize, Qt
from PySide6.QtGui import QFont
from PySide6.QtWidgets import (
from PyQt6.QtCore import QSize, Qt
from PyQt6.QtGui import QFont
from PyQt6.QtWidgets import (
QDialog,
QHBoxLayout,
QLabel,
Expand Down
4 changes: 3 additions & 1 deletion src/ert/gui/ertnotifier.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from PySide6.QtCore import QObject, Signal, Slot
from PyQt6.QtCore import QObject
from PyQt6.QtCore import pyqtSignal as Signal
from PyQt6.QtCore import pyqtSlot as Slot

from ert.storage import Ensemble, Storage

Expand Down
6 changes: 3 additions & 3 deletions src/ert/gui/ertwidgets/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# isort: skip_file
from PySide6.QtCore import Qt
from PySide6.QtGui import QCursor
from PySide6.QtWidgets import QApplication
from PyQt6.QtCore import Qt
from PyQt6.QtGui import QCursor
from PyQt6.QtWidgets import QApplication
from typing import Any
from collections.abc import Callable

Expand Down
6 changes: 3 additions & 3 deletions src/ert/gui/ertwidgets/analysismoduleedit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

from typing import TYPE_CHECKING

from PySide6.QtCore import QMargins, Qt
from PySide6.QtGui import QIcon
from PySide6.QtWidgets import QHBoxLayout, QToolButton, QWidget
from PyQt6.QtCore import QMargins, Qt
from PyQt6.QtGui import QIcon
from PyQt6.QtWidgets import QHBoxLayout, QToolButton, QWidget

from ert.gui.ertwidgets import ClosableDialog
from ert.gui.ertwidgets.analysismodulevariablespanel import AnalysisModuleVariablesPanel
Expand Down
7 changes: 4 additions & 3 deletions src/ert/gui/ertwidgets/analysismodulevariablespanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@
from typing import cast, get_args

from annotated_types import Ge, Gt, Le
from PySide6.QtCore import Qt
from PySide6.QtWidgets import (
from PyQt6.QtCore import Qt
from PyQt6.QtWidgets import (
QCheckBox,
QComboBox,
QDoubleSpinBox,
QFormLayout,
QFrame,
QHBoxLayout,
QLabel,
QLayout,
QWidget,
)

Expand Down Expand Up @@ -74,7 +75,7 @@ def __init__(self, analysis_module: AnalysisModule, ensemble_size: int):
local_checkbox.setObjectName("localization")
local_checkbox.clicked.connect(
partial(
self.valueChanged,
self.valueChangedCheckBox,
"localization",
local_checkbox,
)
Expand Down
6 changes: 3 additions & 3 deletions src/ert/gui/ertwidgets/checklist.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

from typing import TYPE_CHECKING

from PySide6.QtCore import QPoint, QSize, Qt
from PySide6.QtGui import QIcon
from PySide6.QtWidgets import (
from PyQt6.QtCore import QPoint, QSize, Qt
from PyQt6.QtGui import QIcon
from PyQt6.QtWidgets import (
QAbstractItemView,
QHBoxLayout,
QLabel,
Expand Down
6 changes: 3 additions & 3 deletions src/ert/gui/ertwidgets/closabledialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
from collections.abc import Callable
from typing import TYPE_CHECKING, cast

from PySide6.QtCore import Qt
from PySide6.QtWidgets import QDialog, QHBoxLayout, QPushButton, QVBoxLayout, QWidget
from PyQt6.QtCore import Qt
from PyQt6.QtWidgets import QDialog, QHBoxLayout, QPushButton, QVBoxLayout, QWidget

if TYPE_CHECKING:
from PySide6.QtGui import QKeyEvent
from PyQt6.QtGui import QKeyEvent


class ClosableDialog(QDialog):
Expand Down
6 changes: 3 additions & 3 deletions src/ert/gui/ertwidgets/copy_button.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from abc import abstractmethod

from PySide6.QtCore import QTimer
from PySide6.QtGui import QIcon
from PySide6.QtWidgets import QApplication, QMessageBox, QPushButton, QSizePolicy
from PyQt6.QtCore import QTimer
from PyQt6.QtGui import QIcon
from PyQt6.QtWidgets import QApplication, QMessageBox, QPushButton, QSizePolicy


class CopyButton(QPushButton):
Expand Down
4 changes: 2 additions & 2 deletions src/ert/gui/ertwidgets/copyablelabel.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from os import path

from PySide6.QtCore import Qt
from PySide6.QtWidgets import QHBoxLayout, QLabel
from PyQt6.QtCore import Qt
from PyQt6.QtWidgets import QHBoxLayout, QLabel

from .copy_button import CopyButton

Expand Down
8 changes: 3 additions & 5 deletions src/ert/gui/ertwidgets/create_experiment_dialog.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from PySide6.QtCore import (
Qt,
Signal,
)
from PySide6.QtWidgets import (
from PyQt6.QtCore import Qt
from PyQt6.QtCore import pyqtSignal as Signal
from PyQt6.QtWidgets import (
QDialog,
QDialogButtonBox,
QGridLayout,
Expand Down
6 changes: 3 additions & 3 deletions src/ert/gui/ertwidgets/customdialog.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import Any

from PySide6.QtCore import QSize, Qt
from PySide6.QtGui import QColor
from PySide6.QtWidgets import (
from PyQt6.QtCore import QSize, Qt
from PyQt6.QtGui import QColor
from PyQt6.QtWidgets import (
QDialog,
QDialogButtonBox,
QFormLayout,
Expand Down
5 changes: 3 additions & 2 deletions src/ert/gui/ertwidgets/ensembleselector.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
from collections.abc import Iterable
from typing import TYPE_CHECKING

from PySide6.QtCore import Qt, Signal
from PySide6.QtWidgets import QComboBox
from PyQt6.QtCore import Qt
from PyQt6.QtCore import pyqtSignal as Signal
from PyQt6.QtWidgets import QComboBox

from ert.gui.ertnotifier import ErtNotifier
from ert.storage.realization_storage_state import RealizationStorageState
Expand Down
6 changes: 3 additions & 3 deletions src/ert/gui/ertwidgets/listeditbox.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from collections.abc import Sequence
from uuid import UUID

from PySide6.QtCore import QSize, Qt
from PySide6.QtGui import QIcon, QKeyEvent
from PySide6.QtWidgets import (
from PyQt6.QtCore import QSize, Qt
from PyQt6.QtGui import QIcon, QKeyEvent
from PyQt6.QtWidgets import (
QCompleter,
QHBoxLayout,
QInputDialog,
Expand Down
2 changes: 1 addition & 1 deletion src/ert/gui/ertwidgets/message_box.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from PySide6.QtWidgets import (
from PyQt6.QtWidgets import (
QDialog,
QDialogButtonBox,
QGridLayout,
Expand Down
3 changes: 2 additions & 1 deletion src/ert/gui/ertwidgets/models/selectable_list_model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from PySide6.QtCore import QObject, Signal
from PyQt6.QtCore import QObject
from PyQt6.QtCore import pyqtSignal as Signal


class SelectableListModel(QObject):
Expand Down
4 changes: 3 additions & 1 deletion src/ert/gui/ertwidgets/models/valuemodel.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from PySide6.QtCore import QObject, Signal, Slot
from PyQt6.QtCore import QObject
from PyQt6.QtCore import pyqtSignal as Signal
from PyQt6.QtCore import pyqtSlot as Slot


class ValueModel(QObject):
Expand Down
6 changes: 3 additions & 3 deletions src/ert/gui/ertwidgets/pathchooser.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import re
from typing import TYPE_CHECKING

from PySide6.QtCore import QSize
from PySide6.QtGui import QIcon
from PySide6.QtWidgets import QFileDialog, QHBoxLayout, QLineEdit, QToolButton, QWidget
from PyQt6.QtCore import QSize
from PyQt6.QtGui import QIcon
from PyQt6.QtWidgets import QFileDialog, QHBoxLayout, QLineEdit, QToolButton, QWidget

from .validationsupport import ValidationSupport

Expand Down
7 changes: 4 additions & 3 deletions src/ert/gui/ertwidgets/searchbox.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from typing import Any

from PySide6.QtCore import Qt, Signal
from PySide6.QtGui import QColor, QFocusEvent, QKeyEvent
from PySide6.QtWidgets import QLineEdit
from PyQt6.QtCore import Qt
from PyQt6.QtCore import pyqtSignal as Signal
from PyQt6.QtGui import QColor, QFocusEvent, QKeyEvent
from PyQt6.QtWidgets import QLineEdit


class SearchBox(QLineEdit):
Expand Down
4 changes: 2 additions & 2 deletions src/ert/gui/ertwidgets/stringbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from typing import TYPE_CHECKING, Any

from PySide6.QtGui import QPalette
from PySide6.QtWidgets import QLineEdit
from PyQt6.QtGui import QPalette
from PyQt6.QtWidgets import QLineEdit

from .validationsupport import ValidationSupport

Expand Down
4 changes: 2 additions & 2 deletions src/ert/gui/ertwidgets/textbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from typing import TYPE_CHECKING, Any

from PySide6.QtGui import QPalette
from PySide6.QtWidgets import QTextEdit
from PyQt6.QtGui import QPalette
from PyQt6.QtWidgets import QTextEdit

from .validationsupport import ValidationSupport

Expand Down
16 changes: 6 additions & 10 deletions src/ert/gui/ertwidgets/validationsupport.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,14 @@
import html
from typing import TYPE_CHECKING

from PySide6.QtCore import (
QObject,
QPoint,
Qt,
Signal,
)
from PySide6.QtGui import QColor, QEnterEvent
from PySide6.QtWidgets import QFrame, QLabel, QSizePolicy, QVBoxLayout, QWidget
from PyQt6.QtCore import QObject, QPoint, Qt
from PyQt6.QtCore import pyqtSignal as Signal
from PyQt6.QtGui import QColor, QEnterEvent
from PyQt6.QtWidgets import QFrame, QLabel, QSizePolicy, QVBoxLayout, QWidget

if TYPE_CHECKING:
from PySide6.QtCore import QEvent
from PySide6.QtGui import QHideEvent
from PyQt6.QtCore import QEvent
from PyQt6.QtGui import QHideEvent


class ErrorPopup(QWidget):
Expand Down
6 changes: 3 additions & 3 deletions src/ert/gui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from importlib.resources import files
from signal import SIG_DFL, SIGINT, signal

from PySide6.QtCore import QDir
from PySide6.QtGui import QIcon
from PySide6.QtWidgets import QApplication, QWidget
from PyQt6.QtCore import QDir
from PyQt6.QtGui import QIcon
from PyQt6.QtWidgets import QApplication, QWidget

from ert.config import (
ErrorInfo,
Expand Down
Loading

0 comments on commit 4633081

Please sign in to comment.