Skip to content

Commit

Permalink
Merge pull request #367 from toolsforexperiments/dependabot/pip/mypy-…
Browse files Browse the repository at this point in the history
…1.0.0

Bump mypy from 0.991 to 1.0.0
jenshnielsen authored Feb 7, 2023
2 parents bde3338 + 8ae7675 commit c35ecc1
Showing 5 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions plottr/apps/monitr.py
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@
from functools import partial
from itertools import cycle

from watchdog.events import FileSystemEvent # type: ignore[import] # Open PR for mypy in watchdog: https://github.com/gorakhargosh/watchdog/pull/908
from watchdog.events import FileSystemEvent, FileSystemMovedEvent

from .. import log as plottrlog
from .. import QtCore, QtWidgets, Signal, Slot, QtGui, plottrPath
@@ -619,7 +619,7 @@ def _delete_all_children_from_main_dictionary(self, item: Item) -> None:
del self.main_dictionary[child_item.path]

@Slot(FileSystemEvent)
def on_file_moved(self, event: FileSystemEvent) -> None:
def on_file_moved(self, event: FileSystemMovedEvent) -> None:
"""
Gets triggered every time a file is moved or the name of a file (including type) changes.
"""
4 changes: 2 additions & 2 deletions plottr/apps/watchdog_classes.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from logging import getLogger
from pathlib import Path

from watchdog.observers import Observer # type: ignore[import] # Open PR for mypy in watchdog: https://github.com/gorakhargosh/watchdog/pull/908
from watchdog.events import FileSystemEventHandler, FileSystemEvent # type: ignore[import] # Open PR for mypy in watchdog: https://github.com/gorakhargosh/watchdog/pull/908
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler, FileSystemEvent
from plottr import QtCore, Signal


9 changes: 6 additions & 3 deletions plottr/utils/num.py
Original file line number Diff line number Diff line change
@@ -398,9 +398,12 @@ def interp_meshgrid_2d(xx: np.ndarray,
if xx = [[0, 0], [1, nan]], yy = [[0, 1], [0, nan]]
this will return [[0, 0], [1, 1]], [[0, 1], [0, 1]].
"""
xx2 = pd.DataFrame(xx).interpolate(axis=1).values
yy2 = pd.DataFrame(yy).interpolate(axis=0).values
return xx2, yy2
xx2 = pd.DataFrame(xx).interpolate(axis=1)
# interpolate would return None if inplace=True
assert xx2 is not None
yy2 = pd.DataFrame(yy).interpolate(axis=0)
assert yy2 is not None
return xx2.values, yy2.values


def centers2edges_1d(arr: np.ndarray) -> np.ndarray:
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -33,6 +33,7 @@ module = [
"matplotlib.*",
"pyqtgraph.*",
"xhistogram.*",
"ruamel.*"
]
ignore_missing_imports = true

2 changes: 1 addition & 1 deletion test_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
qcodes
pytest
pytest-qt
mypy==0.991
mypy==1.0.0
PyQt5-stubs==5.15.6.0
pandas-stubs
watchdog

0 comments on commit c35ecc1

Please sign in to comment.