diff --git a/pyproject.toml b/pyproject.toml index 6330a63f..ca2b8d9a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,7 +44,7 @@ test = [ "ipywidgets", # needed by ipywidgets >= 8.0.6 "ipykernel", - "PyQt6", + "PySide6", "joblib", "jacobi", "matplotlib", diff --git a/src/iminuit/minuit.py b/src/iminuit/minuit.py index ee63b064..ff98bd4b 100644 --- a/src/iminuit/minuit.py +++ b/src/iminuit/minuit.py @@ -2343,7 +2343,7 @@ def interactive( """ Interactive GUI for fitting. - Starts a fitting application (requires PyQt6, matplotlib) in which the + Starts a fitting application (requires PySide6, matplotlib) in which the fit is visualized and the parameters can be manipulated to find good starting parameters and to debug the fit. diff --git a/src/iminuit/qtwidget.py b/src/iminuit/qtwidget.py index f54e0207..ee8639af 100644 --- a/src/iminuit/qtwidget.py +++ b/src/iminuit/qtwidget.py @@ -1,4 +1,4 @@ -"""Interactive fitting widget using PyQt6.""" +"""Interactive fitting widget using PySide6.""" from .util import _widget_guess_initial_step, _make_finite import warnings @@ -7,12 +7,12 @@ from contextlib import contextmanager try: - from PyQt6 import QtCore, QtGui, QtWidgets + from PySide6 import QtCore, QtGui, QtWidgets from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg from matplotlib import pyplot as plt except ModuleNotFoundError as e: e.msg += ( - "\n\nPlease install PyQt6, and matplotlib to enable interactive " + "\n\nPlease install PySide6, and matplotlib to enable interactive " "outside of Jupyter notebooks." ) raise diff --git a/tests/test_qtwidget.py b/tests/test_qtwidget.py index 0e3e16aa..b5bd3677 100644 --- a/tests/test_qtwidget.py +++ b/tests/test_qtwidget.py @@ -5,7 +5,7 @@ mpl = pytest.importorskip("matplotlib") plt = pytest.importorskip("matplotlib.pyplot") -PyQt6 = pytest.importorskip("PyQt6") +PySide6 = pytest.importorskip("PySide6") mpl.use("Agg") @@ -17,7 +17,7 @@ def qtinteractive(m, plot=None, raise_on_exception=False, **kwargs): @pytest.mark.filterwarnings("ignore::DeprecationWarning") -def test_interactive_pyqt6(qtbot): +def test_interactive_pyside6(qtbot): def cost(a, b): return a**2 + b**2 @@ -44,7 +44,7 @@ def assert_call(self): with plot.assert_call(): mw1 = qtinteractive(m, plot) qtbot.addWidget(mw1) - assert isinstance(mw1, PyQt6.QtWidgets.QWidget) + assert isinstance(mw1, PySide6.QtWidgets.QWidget) # manipulate state to also check this code with plot.assert_call(): @@ -119,7 +119,7 @@ def __call__(self, a, b): @pytest.mark.filterwarnings("ignore::DeprecationWarning") -def test_interactive_pyqt6_raises(qtbot): +def test_interactive_pyside6_raises(qtbot): def raiser(args): raise ValueError @@ -133,7 +133,7 @@ def raiser(args): @pytest.mark.filterwarnings("ignore::DeprecationWarning") -def test_interactive_pyqt6_with_array_func(qtbot): +def test_interactive_pyside6_with_array_func(qtbot): def cost(par): return par[0] ** 2 + (par[1] / 2) ** 2 diff --git a/tests/test_without_pyqt6.py b/tests/test_without_pyside6.py similarity index 69% rename from tests/test_without_pyqt6.py rename to tests/test_without_pyside6.py index 49345770..db048811 100644 --- a/tests/test_without_pyqt6.py +++ b/tests/test_without_pyside6.py @@ -5,22 +5,22 @@ pytest.importorskip("matplotlib") -def test_pyqt6_interactive_with_ipython(): +def test_pyside6_interactive_with_ipython(): pytest.importorskip("IPython") import iminuit cost = LeastSquares([1.1, 2.2], [3.3, 4.4], 1, lambda x, a: a * x) - with hide_modules("PyQt6", reload="iminuit.qtwidget"): - with pytest.raises(ModuleNotFoundError, match="Please install PyQt6"): + with hide_modules("PySide6", reload="iminuit.qtwidget"): + with pytest.raises(ModuleNotFoundError, match="Please install PySide6"): iminuit.Minuit(cost, 1).interactive() -def test_pyqt6_interactive_without_ipython(): +def test_pyside6_interactive_without_ipython(): import iminuit cost = LeastSquares([1.1, 2.2], [3.3, 4.4], 1, lambda x, a: a * x) - with hide_modules("PyQt6", "IPython", reload="iminuit.qtwidget"): - with pytest.raises(ModuleNotFoundError, match="Please install PyQt6"): + with hide_modules("PySide6", "IPython", reload="iminuit.qtwidget"): + with pytest.raises(ModuleNotFoundError, match="Please install PySide6"): iminuit.Minuit(cost, 1).interactive()