diff --git a/src/arpes/_typing.py b/src/arpes/_typing.py index 515f4554..22462e32 100644 --- a/src/arpes/_typing.py +++ b/src/arpes/_typing.py @@ -357,17 +357,17 @@ class ARPESAttrs(Spectrometer, LightSourceInfo, SampleInfo, total=False): # TypedDict for Qt -class QSliderARGS(TypedDict, total=False): +class QSliderArgs(TypedDict, total=False): orientation: QtCore.Qt.Orientation parent: QWidget | None -class QWidgetARGS(TypedDict, total=False): +class QWidgetArgs(TypedDict, total=False): parent: QWidget | None f: QtCore.Qt.WindowType -class QPushButtonARGS(TypedDict, total=False): +class QPushButtonArgs(TypedDict, total=False): icon: QIcon | QPixmap text: str parent: QWidget | None diff --git a/src/arpes/fits/fit_models/x_model_mixin.py b/src/arpes/fits/fit_models/x_model_mixin.py index b299acbb..cad7b9e0 100644 --- a/src/arpes/fits/fit_models/x_model_mixin.py +++ b/src/arpes/fits/fit_models/x_model_mixin.py @@ -36,7 +36,7 @@ logger.propagate = False -class ParametersARGS(TypedDict, total=False): +class ParametersArgs(TypedDict, total=False): value: float # initial value vary: bool # Whether the parameter is varied during the fit min: float # Lower bound for value (default, -np.inf) @@ -45,7 +45,7 @@ class ParametersARGS(TypedDict, total=False): brunte_step: float # step size for grid points in the brute method. -class ParametersARGSFull(ParametersARGS): +class ParametersArgsFull(ParametersArgs): """Class for Full arguments for Parameters class. See the manual of lmfit. @@ -55,12 +55,12 @@ class ParametersARGSFull(ParametersARGS): def _prep_parameters( - dict_of_parameters: dict[str, ParametersARGS] | lf.Parameters | None, + dict_of_parameters: dict[str, ParametersArgs] | lf.Parameters | None, ) -> lf.Parameters: """[TODO:summary]. Args: - dict_of_parameters(dict[str, ParametersARGS] | lf.Parameters): pass to lf.Parameters + dict_of_parameters(dict[str, ParametersArgs] | lf.Parameters): pass to lf.Parameters If lf.Parameters, this function returns as is. Returns: @@ -114,7 +114,7 @@ class XModelMixin(lf.Model): def guess_fit( # noqa: PLR0913 self, data: xr.DataArray | NDArray[np.float_], - params: lf.Parameters | dict[str, ParametersARGS] | None = None, + params: lf.Parameters | dict[str, ParametersArgs] | None = None, weights: xr.DataArray | NDArray[np.float_] | None = None, *, guess: bool = True, diff --git a/src/arpes/utilities/math.py b/src/arpes/utilities/math.py index 27540a43..e7ba5d46 100644 --- a/src/arpes/utilities/math.py +++ b/src/arpes/utilities/math.py @@ -14,7 +14,7 @@ from numpy.typing import NDArray -class SHIFTPARAM(TypedDict, total=False): +class ShiftParam(TypedDict, total=False): """Keyword parameter for scipy.ndimage.shift.""" order: int @@ -42,7 +42,7 @@ def shift_by( value: NDArray[np.float_], axis: int = 0, by_axis: int = 0, - **kwargs: Unpack[SHIFTPARAM], + **kwargs: Unpack[ShiftParam], ) -> NDArray[np.float_]: """Shifts slices of `arr` perpendicular to `by_axis` by `value`. @@ -51,7 +51,7 @@ def shift_by( value ([TODO:type]): [TODO:description] axis (int): Axis number of np.ndarray for shift by_axis (int): Axis number of np.ndarray for non-shift - **kwargs(SHIFTPARAM): pass to scipy.ndimage.shift + **kwargs(ShiftParam): pass to scipy.ndimage.shift """ assert axis != by_axis arr_copy = arr.copy() diff --git a/src/arpes/utilities/ui.py b/src/arpes/utilities/ui.py index 95e53d92..d41d638f 100644 --- a/src/arpes/utilities/ui.py +++ b/src/arpes/utilities/ui.py @@ -81,7 +81,7 @@ from _typeshed import Incomplete from PySide6.QtGui import QKeyEvent - from arpes._typing import QWidgetARGS + from arpes._typing import QWidgetArgs __all__ = ( "CollectUI", @@ -315,7 +315,7 @@ def group( @ui_builder -def label(text: str, *args: QWidget | Qt.WindowType, **kwargs: Unpack[QWidgetARGS]) -> QLabel: +def label(text: str, *args: QWidget | Qt.WindowType, **kwargs: Unpack[QWidgetArgs]) -> QLabel: """A convenience method for making a text label.""" return QLabel(text, *args, **kwargs) diff --git a/src/arpes/utilities/widgets.py b/src/arpes/utilities/widgets.py index c8cd7f07..04b0c2cc 100644 --- a/src/arpes/utilities/widgets.py +++ b/src/arpes/utilities/widgets.py @@ -25,7 +25,7 @@ from PySide6.QtCore import Qt from PySide6.QtGui import QIcon, QPixmap - from arpes._typing import QPushButtonARGS, QSliderARGS + from arpes._typing import QPushButtonArgs, QSliderArgs __all__ = ( "SubjectivePushButton", @@ -99,7 +99,7 @@ class SubjectiveSlider(QSlider): def __init__( self, *args: Qt.Orientation | QWidget | None, - **kwargs: Unpack[QSliderARGS], + **kwargs: Unpack[QSliderArgs], ) -> None: """Wrap signals in ``rx.BehaviorSubject``s.""" super().__init__(*args, **kwargs) @@ -199,7 +199,7 @@ class SubjectivePushButton(QPushButton): def __init__( self, *args: QIcon | QPixmap | str | QWidget, - **kwargs: Unpack[QPushButtonARGS], + **kwargs: Unpack[QPushButtonArgs], ) -> None: """Wrap signals in ``rx.BehaviorSubject``s.""" super().__init__(*args, **kwargs) diff --git a/tests/conftest.py b/tests/conftest.py index 11cb06db..e11922ed 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -19,13 +19,13 @@ from arpes._typing import ScanInfo, WorkSpaceType -class EXPECTEDD(TypedDict, total=False): +class Expected(TypedDict, total=False): """TypedDict for expected.""" scan_info: ScanInfo -class SCENARIO(TypedDict, total=False): +class Scenario(TypedDict, total=False): """TypedDict for SCENARIO.""" file: str