Skip to content

Commit

Permalink
Merge branch 'daredevil' of github.com:arafune/arpes into daredevil
Browse files Browse the repository at this point in the history
  • Loading branch information
arafune committed Oct 18, 2023
2 parents c84a395 + ffe9c01 commit ea228be
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions arpes/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand Down
7 changes: 4 additions & 3 deletions arpes/utilities/qt/help_dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__()

Expand Down Expand Up @@ -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()
2 changes: 1 addition & 1 deletion arpes/utilities/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
2 changes: 1 addition & 1 deletion arpes/xarray_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down

0 comments on commit ea228be

Please sign in to comment.