Skip to content

Commit

Permalink
💬 Use CapWards for class
Browse files Browse the repository at this point in the history
  • Loading branch information
arafune committed Mar 14, 2024
1 parent 14a8050 commit 5a01905
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions src/arpes/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/arpes/fits/fit_models/x_model_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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.
Expand All @@ -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:
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions src/arpes/utilities/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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`.
Expand All @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions src/arpes/utilities/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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)

Expand Down
6 changes: 3 additions & 3 deletions src/arpes/utilities/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5a01905

Please sign in to comment.