Skip to content

Commit

Permalink
Merge branch 'py38_PySide6' into py38
Browse files Browse the repository at this point in the history
  • Loading branch information
arafune committed Oct 13, 2023
2 parents fc30122 + 6daeec0 commit 727c66e
Show file tree
Hide file tree
Showing 27 changed files with 380 additions and 33 deletions.
2 changes: 1 addition & 1 deletion arpes/plotting/basic_tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import xarray as xr
from scipy import interpolate

from PyQt5 import QtWidgets, QtCore
from PySide6 import QtWidgets, QtCore

from arpes import analysis
from arpes.utilities import normalize_to_spectrum
Expand Down
2 changes: 1 addition & 1 deletion arpes/plotting/bz_tool/CoordinateOffsetWidget.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""A widget providing controls for a coordinate offset in the momentum tool."""
from functools import partial

from PyQt5 import QtWidgets
from PySide6 import QtWidgets

__all__ = ("CoordinateOffsetWidget",)

Expand Down
2 changes: 1 addition & 1 deletion arpes/plotting/bz_tool/RangeOrSingleValueWidget.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""A control which can provide a range or a single value (i.e. a half open range with ends equal)."""
from functools import partial

from PyQt5 import QtWidgets
from PySide6 import QtWidgets


__all__ = ["RangeOrSingleValueWidget"]
Expand Down
2 changes: 1 addition & 1 deletion arpes/plotting/bz_tool/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import numpy as np
import xarray as xr

from PyQt5 import QtWidgets
from PySide6 import QtWidgets
from matplotlib.backends.backend_qt5agg import FigureCanvas
from matplotlib.figure import Figure

Expand Down
2 changes: 1 addition & 1 deletion arpes/plotting/dynamic_tool.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Allows for making any function of a spectrum into a dynamic tool."""
import inspect

from PyQt5 import QtWidgets
from PySide6 import QtWidgets

from arpes.utilities import normalize_to_spectrum, group_by
from arpes.typing import DataType
Expand Down
2 changes: 1 addition & 1 deletion arpes/plotting/fit_tool/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Provides a Qt based implementation of a curve fit inspection tool."""
from arpes.plotting.qt_tool.BinningInfoWidget import BinningInfoWidget
from arpes.utilities.qt.utils import PlotOrientation, ReactivePlotRecord
from PyQt5 import QtGui, QtCore, QtWidgets
from PySide6 import QtGui, QtCore, QtWidgets
import pyqtgraph as pg
import numpy as np
import dill
Expand Down
4 changes: 2 additions & 2 deletions arpes/plotting/fit_tool/fit_inspection_plot.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"""Defines a widget which provides a 1D browsable `lmfit.model.ModelResult`."""

from PyQt5 import QtCore, QtWidgets
from PySide6 import QtCore, QtWidgets
from arpes.utilities.qt.data_array_image_view import DataArrayPlot
from typing import Optional
import pyqtgraph as pg
import xarray as xr
import numpy as np
import math
from PyQt5.QtWidgets import QLayout, QGridLayout, QWidget
from PySide6.QtWidgets import QLayout, QGridLayout, QWidget
import lmfit
from weakref import ReferenceType

Expand Down
4 changes: 2 additions & 2 deletions arpes/plotting/qt_ktool/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""A live momentun conversion tool, useful for finding and setting offsets."""
from PyQt5 import QtWidgets
from PySide6 import QtWidgets
import numpy as np

from arpes.utilities import normalize_to_spectrum, group_by
Expand All @@ -22,7 +22,7 @@
class KTool(SimpleApp):
"""Provides a live momentum converting tool.
QtTool is an implementation of Image/Bokeh Tool based on PyQtGraph and PyQt5 for now we retain
QtTool is an implementation of Image/Bokeh Tool based on PyQtGraph and PySIde6 for now we retain
a number of the metaphors from BokehTool, including a "context" that stores the state, and can
be used to programmatically interface with the tool.
"""
Expand Down
2 changes: 1 addition & 1 deletion arpes/plotting/qt_tool/AxisInfoWidget.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""A widget providing rudimentary information about an axis on a DataArray."""
# pylint: disable=import-error

from PyQt5 import QtWidgets
from PySide6 import QtWidgets

__all__ = ("AxisInfoWidget",)

Expand Down
2 changes: 1 addition & 1 deletion arpes/plotting/qt_tool/BinningInfoWidget.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""An axis binning control."""

from PyQt5 import QtWidgets
from PySide6 import QtWidgets

from arpes.utilities.ui import layout

Expand Down
4 changes: 2 additions & 2 deletions arpes/plotting/qt_tool/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# pylint: disable=import-error

from arpes.utilities.qt.utils import PlotOrientation
from PyQt5 import QtGui, QtCore, QtWidgets
from PySide6 import QtGui, QtCore, QtWidgets
import pyqtgraph as pg
import numpy as np
import weakref
Expand Down Expand Up @@ -137,7 +137,7 @@ def scroll(self, event: QtGui.QKeyEvent):


class QtTool(SimpleApp):
"""QtTool is an implementation of Image/Bokeh Tool based on PyQtGraph and PyQt5.
"""QtTool is an implementation of Image/Bokeh Tool based on PyQtGraph and PySide6.
For now we retain a number of the metaphors from BokehTool, including a "context"
that stores the state, and can be used to programmatically interface with the tool.
Expand Down
4 changes: 2 additions & 2 deletions arpes/utilities/qt/app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Application infrastructure for apps/tools which browse a data volume."""
from PyQt5 import QtWidgets
from PySide6 import QtWidgets
import pyqtgraph as pg
import numpy as np
import typing
Expand All @@ -18,7 +18,7 @@


class SimpleApp:
"""Has all of the layout information and business logic for an interactive data browsing utility using PyQt5."""
"""Has all of the layout information and business logic for an interactive data browsing utility using PySide6."""

WINDOW_CLS = None
WINDOW_SIZE = (4, 4)
Expand Down
2 changes: 1 addition & 1 deletion arpes/utilities/qt/help_dialogs.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""A help dialog showing keyboard shortcuts for Qt application."""
# pylint: disable=import-error

from PyQt5 import QtCore, QtWidgets
from PySide6 import QtCore, QtWidgets

from arpes.utilities.ui import PRETTY_KEYS, label, vertical

Expand Down
2 changes: 1 addition & 1 deletion arpes/utilities/qt/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import enum
from dataclasses import dataclass
from typing import List
from PyQt5 import QtWidgets
from PySide6 import QtWidgets

__all__ = ["PlotOrientation", "ReactivePlotRecord"]

Expand Down
2 changes: 1 addition & 1 deletion arpes/utilities/qt/windows.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Infrastructure code for Qt application windows."""
import sys

from PyQt5 import QtGui, QtCore, QtWidgets
from PySide6 import QtGui, QtCore, QtWidgets

import arpes.config
from arpes.utilities.excepthook import patched_excepthook
Expand Down
10 changes: 5 additions & 5 deletions arpes/utilities/ui.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Easily composable and reactive UI utilities using RxPy and PyQt5.
"""Easily composable and reactive UI utilities using RxPy and PySide6.
This makes UI prototyping *MUCH* faster. In order to log IDs so that you can
attach subscriptions after the fact, you will need to use the CollectUI
Expand Down Expand Up @@ -35,7 +35,7 @@
With the line above, whenever the button with id='submit' is pressed, we will log a dictionary
with the most recent values of the inputs {'check','slider','file'} as a dictionary with these
keys. This allows building PyQt5 "forms" without effort.
keys. This allows building PySide6 "forms" without effort.
"""
from enum import Enum
from typing import Type
Expand All @@ -51,7 +51,7 @@
from collections import namedtuple

import functools
from PyQt5.QtWidgets import (
from PySide6.QtWidgets import (
QGridLayout,
QWidget,
QVBoxLayout,
Expand All @@ -62,8 +62,8 @@
QLabel,
)

from PyQt5 import QtCore, QtGui
from PyQt5.QtCore import Qt
from PySide6 import QtCore, QtGui
from PySide6.QtCore import Qt

from .widgets import *

Expand Down
2 changes: 1 addition & 1 deletion arpes/utilities/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
from rx.subject import BehaviorSubject, Subject

from PyQt5.QtWidgets import (
from PySide6.QtWidgets import (
QPushButton,
QCheckBox,
QComboBox,
Expand Down
2 changes: 1 addition & 1 deletion docs/source/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Fixed

1. Circular references have been removed from tools which use Qt which
previously lead to crashes due to objects being freed in C++/Qt5 but
retained in Python/PyQt5.
retained in Python/PySide6.

Additionally, some diagnostics have been added to help deal with
similar problems in the future.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/notebooks/basic-data-exploration.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,7 @@
"source": [
"## Interactive Data Browsing\n",
"\n",
"Facilities are included for doing interactive data exploration and analysis both directly in Jupyter, via Bokeh. And in a separate standalone window using PyQt5. To learn more about interactive analysis, please read the interactive analysis section of the documentation."
"Facilities are included for doing interactive data exploration and analysis both directly in Jupyter, via Bokeh. And in a separate standalone window using PySide6. To learn more about interactive analysis, please read the interactive analysis section of the documentation."
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/source/writing-interactive-tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ step we will add only as much as is needed to spawn a window.

.. code:: python
from PyQt5 import QtWidgets
from PySide6 import QtWidgets
from arpes.utilities.qt import qt_info, SimpleApp, SimpleWindow, BasicHelpDialog
Expand Down
122 changes: 122 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@
},
"devDependencies": {
"@arkweid/lefthook": "^0.7.6"
},
"dependencies": {
"gyp": "^0.3.0"
}
}
2 changes: 1 addition & 1 deletion pytest-config/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ norecursedirs =
filterwarnings =
ignore::DeprecationWarning

qt_api=pyqt5
qt_api=pyside6

env=
QT_QPA_PLATFORM=offscreen
Loading

0 comments on commit 727c66e

Please sign in to comment.