diff --git a/src/arpes/plotting/dynamic_tool.py b/src/arpes/plotting/dynamic_tool.py index 08b49353..17aada75 100644 --- a/src/arpes/plotting/dynamic_tool.py +++ b/src/arpes/plotting/dynamic_tool.py @@ -29,7 +29,7 @@ from _typeshed import Incomplete from PySide6.QtWidgets import QGridLayout, QWidget - from arpes._typing import DataType + from arpes._typing import XrTypes LOGLEVELS = (DEBUG, INFO) LOGLEVEL = LOGLEVELS[1] @@ -63,7 +63,7 @@ class DynamicTool(SimpleApp): def __init__( self, - function: Callable[..., DataType], + function: Callable[..., XrTypes], meta: dict[str, float] | None = None, ) -> None: self._function = function @@ -190,7 +190,7 @@ def set_data(self, data: xr.DataArray) -> None: self.data = data if isinstance(data, xr.DataArray) else normalize_to_spectrum(data) -def make_dynamic(fn: Callable[..., Any], data: DataType) -> None: +def make_dynamic(fn: Callable[..., Any], data: XrTypes) -> None: """Starts a tool which makes any analysis function dynamic.""" tool = DynamicTool(fn) tool.set_data(data) diff --git a/src/arpes/plotting/utils.py b/src/arpes/plotting/utils.py index be76abde..9992111e 100644 --- a/src/arpes/plotting/utils.py +++ b/src/arpes/plotting/utils.py @@ -637,7 +637,7 @@ def plot_arr( arr: XrTypes, ax: Axes | None = None, over: AxesImage | None = None, - mask: DataType | None = None, + mask: XrTypes | None = None, **kwargs: Incomplete, ) -> Axes | None: """Convenience method to plot an array with a mask over some other data.""" @@ -1323,7 +1323,7 @@ def savefig( "name": "savefig", } - def extract(for_data: DataType) -> dict[str, Any]: + def extract(for_data: XrTypes) -> dict[str, Any]: return for_data.attrs.get("provenance", {}) if data is not None: diff --git a/src/arpes/utilities/widgets.py b/src/arpes/utilities/widgets.py index a3a67f64..c8cd7f07 100644 --- a/src/arpes/utilities/widgets.py +++ b/src/arpes/utilities/widgets.py @@ -22,7 +22,7 @@ from rx.subject import BehaviorSubject, Subject if TYPE_CHECKING: - from PySide6.QtCore.Qt import CheckState, Orientation, WindowType + from PySide6.QtCore import Qt from PySide6.QtGui import QIcon, QPixmap from arpes._typing import QPushButtonARGS, QSliderARGS @@ -98,7 +98,7 @@ class SubjectiveSlider(QSlider): def __init__( self, - *args: Orientation | QWidget | None, + *args: Qt.Orientation | QWidget | None, **kwargs: Unpack[QSliderARGS], ) -> None: """Wrap signals in ``rx.BehaviorSubject``s.""" @@ -148,7 +148,7 @@ class SubjectiveFileDialog(QWidget): def __init__( self, - *args: QWidget | WindowType | None, + *args: QWidget | Qt.WindowType | None, single: bool = True, dialog_root: Path | None = None, ) -> None: @@ -218,6 +218,6 @@ def __init__(self, *args: QWidget, **kwargs: QWidget) -> None: self.stateChanged.connect(self.subject.on_next) self.subject.subscribe(self.update_ui) - def update_ui(self, value: CheckState) -> None: + def update_ui(self, value: Qt.CheckState) -> None: """Forwards value change to the UI.""" self.setCheckState(value)