diff --git a/arpes/config.py b/arpes/config.py index b4befd3f..ce649ab9 100644 --- a/arpes/config.py +++ b/arpes/config.py @@ -26,7 +26,7 @@ import pint if TYPE_CHECKING: - from arpes._typing import CONFIGTYPE, ConfigSettings + from arpes._typing import CONFIGTYPE, WORKSPACETYPE, ConfigSettings # pylint: disable=global-statement @@ -124,8 +124,8 @@ def __init__(self, workspace: str | None = None) -> None: Args: workspace: The name of the workspace to enter temporarily. Defaults to None. """ - self._cached_workspace: CONFIGTYPE = {} - self._workspace = workspace + self._cached_workspace: WORKSPACETYPE = {} + self._workspace: str | None = workspace def __enter__(self) -> None: """Caches the current workspace and enters a new one. diff --git a/arpes/utilities/qt/help_dialogs.py b/arpes/utilities/qt/help_dialogs.py index f8e14d2b..537545c9 100644 --- a/arpes/utilities/qt/help_dialogs.py +++ b/arpes/utilities/qt/help_dialogs.py @@ -9,15 +9,16 @@ from arpes.utilities.ui import PRETTY_KEYS, label, vertical if TYPE_CHECKING: - from _typeshed import Incomplete from PySide6.QtGui import QKeyEvent + + from arpes.utilities.ui import KeyBinding __all__ = ("BasicHelpDialog",) class BasicHelpDialog(QtWidgets.QDialog): """A help dialog showing keyboard shortcuts for Qt application.""" - def __init__(self, shortcuts: Incomplete | None = None) -> None: + def __init__(self, shortcuts: list[KeyBinding] | None = None) -> None: """Initialize the help window and build widgets for the registered shortcuts.""" super().__init__() @@ -65,6 +66,6 @@ def __init__(self, shortcuts: Incomplete | None = None) -> None: def keyPressEvent(self, event: QKeyEvent) -> None: """If the user preset H we should toggle the dialog, or close it if they pressed Esc.""" - if event.key() == QtCore.Qt.Key_H or event.key() == QtCore.Qt.Key_Escape: + if event.key() == QtCore.Qt.Key.Key_H or event.key() == QtCore.Qt.Key.Key_Escape: self._main_window._help_dialog = None # pylint: disable=protected-access self.close() diff --git a/arpes/utilities/ui.py b/arpes/utilities/ui.py index 67d99ac9..13deb4ba 100644 --- a/arpes/utilities/ui.py +++ b/arpes/utilities/ui.py @@ -147,7 +147,7 @@ class CursorMode(NamedTuple): PRETTY_KEYS = {} -for key, value in vars(QtCore.Qt).items(): +for key, value in vars(QtCore.Qt.Key).items(): if isinstance(value, QtCore.Qt.Key): PRETTY_KEYS[value] = key.partition("_")[2] diff --git a/arpes/xarray_extensions.py b/arpes/xarray_extensions.py index 39b87901..06a25307 100644 --- a/arpes/xarray_extensions.py +++ b/arpes/xarray_extensions.py @@ -706,7 +706,7 @@ def iter_symmetry_points(self) -> Generator[tuple[str, float], None, None]: yield from self.iter_projected_symmetry_points @property - def history(self): + def history(self) -> dict: provenance_recorded = self._obj.attrs.get("provenance", None) def unlayer(prov: dict[str, Incomplete] | None) -> tuple[list[Incomplete], Incomplete]: