Skip to content

Commit a817bc9

Browse files
author
Adrian Peter Krone
committed
PyQt6 -> PySide6
1 parent b2f370b commit a817bc9

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ test = [
4444
"ipywidgets",
4545
# needed by ipywidgets >= 8.0.6
4646
"ipykernel",
47-
"PyQt6",
47+
"PySide6",
4848
"joblib",
4949
"jacobi",
5050
"matplotlib",

src/iminuit/minuit.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2343,7 +2343,7 @@ def interactive(
23432343
"""
23442344
Interactive GUI for fitting.
23452345
2346-
Starts a fitting application (requires PyQt6, matplotlib) in which the
2346+
Starts a fitting application (requires PySide6, matplotlib) in which the
23472347
fit is visualized and the parameters can be manipulated to find good
23482348
starting parameters and to debug the fit.
23492349

src/iminuit/qtwidget.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Interactive fitting widget using PyQt6."""
1+
"""Interactive fitting widget using PySide6."""
22

33
from .util import _widget_guess_initial_step, _make_finite
44
import warnings
@@ -7,12 +7,12 @@
77
from contextlib import contextmanager
88

99
try:
10-
from PyQt6 import QtCore, QtGui, QtWidgets
10+
from PySide6 import QtCore, QtGui, QtWidgets
1111
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg
1212
from matplotlib import pyplot as plt
1313
except ModuleNotFoundError as e:
1414
e.msg += (
15-
"\n\nPlease install PyQt6, and matplotlib to enable interactive "
15+
"\n\nPlease install PySide6, and matplotlib to enable interactive "
1616
"outside of Jupyter notebooks."
1717
)
1818
raise

tests/test_qtwidget.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
mpl = pytest.importorskip("matplotlib")
77
plt = pytest.importorskip("matplotlib.pyplot")
8-
PyQt6 = pytest.importorskip("PyQt6")
8+
PySide6 = pytest.importorskip("PySide6")
99

1010
mpl.use("Agg")
1111

@@ -17,7 +17,7 @@ def qtinteractive(m, plot=None, raise_on_exception=False, **kwargs):
1717

1818

1919
@pytest.mark.filterwarnings("ignore::DeprecationWarning")
20-
def test_interactive_pyqt6(qtbot):
20+
def test_interactive_pyside6(qtbot):
2121
def cost(a, b):
2222
return a**2 + b**2
2323

@@ -44,7 +44,7 @@ def assert_call(self):
4444
with plot.assert_call():
4545
mw1 = qtinteractive(m, plot)
4646
qtbot.addWidget(mw1)
47-
assert isinstance(mw1, PyQt6.QtWidgets.QWidget)
47+
assert isinstance(mw1, PySide6.QtWidgets.QWidget)
4848

4949
# manipulate state to also check this code
5050
with plot.assert_call():
@@ -119,7 +119,7 @@ def __call__(self, a, b):
119119

120120

121121
@pytest.mark.filterwarnings("ignore::DeprecationWarning")
122-
def test_interactive_pyqt6_raises(qtbot):
122+
def test_interactive_pyside6_raises(qtbot):
123123
def raiser(args):
124124
raise ValueError
125125

@@ -133,7 +133,7 @@ def raiser(args):
133133

134134

135135
@pytest.mark.filterwarnings("ignore::DeprecationWarning")
136-
def test_interactive_pyqt6_with_array_func(qtbot):
136+
def test_interactive_pyside6_with_array_func(qtbot):
137137
def cost(par):
138138
return par[0] ** 2 + (par[1] / 2) ** 2
139139

tests/test_without_pyqt6.py tests/test_without_pyside6.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@
55
pytest.importorskip("matplotlib")
66

77

8-
def test_pyqt6_interactive_with_ipython():
8+
def test_pyside6_interactive_with_ipython():
99
pytest.importorskip("IPython")
1010
import iminuit
1111

1212
cost = LeastSquares([1.1, 2.2], [3.3, 4.4], 1, lambda x, a: a * x)
1313

14-
with hide_modules("PyQt6", reload="iminuit.qtwidget"):
15-
with pytest.raises(ModuleNotFoundError, match="Please install PyQt6"):
14+
with hide_modules("PySide6", reload="iminuit.qtwidget"):
15+
with pytest.raises(ModuleNotFoundError, match="Please install PySide6"):
1616
iminuit.Minuit(cost, 1).interactive()
1717

1818

19-
def test_pyqt6_interactive_without_ipython():
19+
def test_pyside6_interactive_without_ipython():
2020
import iminuit
2121

2222
cost = LeastSquares([1.1, 2.2], [3.3, 4.4], 1, lambda x, a: a * x)
2323

24-
with hide_modules("PyQt6", "IPython", reload="iminuit.qtwidget"):
25-
with pytest.raises(ModuleNotFoundError, match="Please install PyQt6"):
24+
with hide_modules("PySide6", "IPython", reload="iminuit.qtwidget"):
25+
with pytest.raises(ModuleNotFoundError, match="Please install PySide6"):
2626
iminuit.Minuit(cost, 1).interactive()

0 commit comments

Comments
 (0)