Skip to content

Commit a2a4749

Browse files
authored
Merge branch 'master' into drop-python-3.11
2 parents 1f74f8f + 561d9f2 commit a2a4749

10 files changed

Lines changed: 29 additions & 27 deletions

File tree

.github/workflows/python-app.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ jobs:
2222
run: |
2323
sudo apt install libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 x11-utils
2424
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX
25-
- uses: actions/checkout@v4
25+
- uses: actions/checkout@v6
2626
- name: Set up Python ${{ matrix.python-version }}
27-
uses: actions/setup-python@v5.3.0
27+
uses: actions/setup-python@v6.2.0
2828
with:
2929
python-version: ${{ matrix.python-version }}
3030
- uses: ./.github/actions/install-dependencies-and-plottr

.github/workflows/python-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v6
1515
- name: Set up Python
16-
uses: actions/setup-python@v5.3.0
16+
uses: actions/setup-python@v6.2.0
1717
with:
1818
python-version: '3.12'
1919
- uses: ./.github/actions/install-dependencies-and-plottr

doc/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
sphinx==8.1.3
2-
sphinx-autodoc-typehints>=1.10.3
3-
PyQt5>=5.9.0
2+
sphinx-autodoc-typehints>=3.0.1
3+
PyQt5>=5.15.11

plottr/apps/inspectr.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,15 @@ def showContextMenu(self, position: QtCore.QPoint) -> None:
158158
copy_action = menu.addAction(copy_icon, "Copy")
159159

160160
window = cast(QCodesDBInspector, self.window())
161-
starAction: QtWidgets.QAction = window.starAction # type: ignore[has-type]
161+
starAction: QtWidgets.QAction = window.starAction
162162

163163
starAction.setText('Star' if current_tag_char != self.tag_dict['star'] else 'Unstar')
164164
menu.addAction(starAction)
165165

166-
crossAction: QtWidgets.QAction = window.crossAction # type: ignore[has-type]
167-
crossAction.setText('Cross' if current_tag_char != self.tag_dict['cross'] else 'Uncross')
166+
crossAction: QtWidgets.QAction = window.crossAction
167+
crossAction.setText(
168+
"Cross" if current_tag_char != self.tag_dict["cross"] else "Uncross"
169+
)
168170
menu.addAction(crossAction)
169171

170172
action = menu.exec_(self.mapToGlobal(position))

plottr/data/datadict.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,23 +1409,23 @@ def combine_datadicts(*dicts: DataDict) -> Union[DataDictBase, DataDict]:
14091409
# axes in the return can be separated even if they match (caused
14101410
# by earlier mismatches)
14111411

1412-
ret = None
1413-
rettype = None
1412+
ret: Union[DataDictBase, None] = None
1413+
rettype: Union[type[DataDictBase], None] = None
14141414

14151415
for d in dicts:
14161416
if ret is None:
14171417
ret = d.copy()
14181418
rettype = type(d)
14191419

14201420
else:
1421-
14221421
# if we don't have a well defined number of records anymore,
14231422
# need to revert the type to DataDictBase
1424-
if hasattr(d, 'nrecords') and hasattr(ret, 'nrecords'):
1423+
if hasattr(d, "nrecords") and hasattr(ret, "nrecords"):
14251424
if d.nrecords() != ret.nrecords():
14261425
rettype = DataDictBase
14271426
else:
14281427
rettype = DataDictBase
1428+
assert rettype is not None
14291429
ret = rettype(**ret)
14301430

14311431
# First, parse the axes in the to-be-added ddict.

plottr/node/autonode.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,26 @@ def connectFloatSpinbox(
4444

4545

4646
class AutoNodeGui(AutoNodeGuiTemplate):
47-
4847
widgetConnection = {
4948
int: connectIntegerSpinbox,
5049
float: connectFloatSpinbox,
5150
}
5251

53-
def __init__(self, parent: Optional[QtWidgets.QWidget] = None,
54-
node: Optional[Node] = None):
52+
def __init__(
53+
self, parent: Optional[QtWidgets.QWidget] = None, node: Optional[Node] = None
54+
):
5555
super().__init__(parent)
5656
layout = QtWidgets.QFormLayout()
5757
self.setLayout(layout)
5858

5959
def addOption(self, name: str, specs: Dict[str, Any], confirm: bool) -> None:
60-
optionType = specs.get('type', None)
60+
optionType: type | None = specs.get("type", None)
6161
widget = None
62-
func = self.widgetConnection.get(optionType, None)
62+
func = (
63+
self.widgetConnection[optionType]
64+
if optionType in self.widgetConnection.keys()
65+
else None
66+
)
6367
if func is not None:
6468
widget = func(self, name, specs, confirm)
6569
layout = cast(QtWidgets.QFormLayout, self.layout())

plottr/node/scaleunits.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
from enum import Enum, unique
2-
from typing import Optional, Dict
2+
from typing import Dict, Optional
33

4-
try:
5-
from qcodes.utils.plotting import find_scale_and_prefix
6-
except ImportError:
7-
# fallback for qcodes < 0.21
8-
from plottr.utils.find_scale_and_prefix import find_scale_and_prefix
4+
from qcodes.plotting import find_scale_and_prefix
95

106
from plottr import QtWidgets, Signal, Slot
11-
from plottr.node import Node, NodeWidget, updateOption
127
from plottr.data.datadict import DataDictBase
8+
from plottr.node import Node, NodeWidget, updateOption
139

1410

1511
@unique

plottr/plot/mpl/autoplot.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ def plotLine(self, plotItem: PlotItem) -> Optional[List[ScalarMappable]]:
122122
assert len(plotItem.data) == 2
123123
lbl = plotItem.labels[-1] if isinstance(plotItem.labels, list) and len(plotItem.labels) > 0 else ''
124124
x, y = plotItem.data
125+
assert plotItem.plotOptions is not None
125126
return axes[0].plot(x, y, label=lbl, **plotItem.plotOptions)
126127

127128
def plotImage(self, plotItem: PlotItem) -> Optional[ScalarMappable]:

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ warn_unused_configs = true
8282
warn_redundant_casts = true
8383
no_implicit_optional = true
8484
disallow_untyped_defs = true
85-
plugins = "numpy.typing.mypy_plugin"
8685
show_error_codes = true
8786
enable_error_code = "ignore-without-code"
8887

test_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
qcodes
22
pytest
33
pytest-qt
4-
mypy==1.13.0
4+
mypy==1.20.2
55
PyQt5-stubs==5.15.6.0
66
pandas-stubs
77
watchdog

0 commit comments

Comments
 (0)