Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jul 1, 2024
1 parent 0720465 commit c0f3d9c
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 38 deletions.
8 changes: 4 additions & 4 deletions vanilla_roll/anatomy_orientation.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ class Axial(Enum):

@classmethod
def of(cls, s: Literal["Superior"] | Literal["Inferior"]) -> Axial:
"""construct from string.
"""Construct from string.
>>> Axial.of("Superior")
<Axial.SUPERIOR: 'Superior'>
"""
return cls(s)

def inverse(self) -> Axial:
"""get inverse.
"""Get inverse.
>>> Axial.SUPERIOR.inverse()
<Axial.INFERIOR: 'Inferior'>
Expand All @@ -36,7 +36,7 @@ class Sagittal(Enum):

@classmethod
def of(cls, s: Literal["Anterior"] | Literal["Posterior"]) -> Sagittal:
"""construct from string.
"""Construct from string.
>>> Sagittal.of("Anterior")
<Sagittal.ANTERIOR: 'Anterior'>
Expand All @@ -57,7 +57,7 @@ class Coronal(Enum):

@classmethod
def of(cls, s: Literal["Right"] | Literal["Left"]) -> Coronal:
"""construct from string.
"""Construct from string.
>>> Coronal.of("Right")
<Coronal.RIGHT: 'Right'>
Expand Down
39 changes: 13 additions & 26 deletions vanilla_roll/geometry/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,20 @@

class Conversion(Protocol):
@overload
def __call__(self, target: Vector) -> Vector:
...
def __call__(self, target: Vector) -> Vector: ...

@overload
def __call__(self, target: Orientation) -> Orientation:
...
def __call__(self, target: Orientation) -> Orientation: ...

@overload
def __call__(self, target: Frame) -> Frame:
...
def __call__(self, target: Frame) -> Frame: ...

@overload
def __call__(self, target: xp.Array) -> xp.Array:
...
def __call__(self, target: xp.Array) -> xp.Array: ...

def __call__(
self, target: Vector | Orientation | Frame | xp.Array
) -> Vector | Orientation | Frame | xp.Array:
...
) -> Vector | Orientation | Frame | xp.Array: ...


def _transform_vector(
Expand Down Expand Up @@ -115,20 +110,16 @@ def __init__(self, src: Frame, dst: Frame) -> None:
self._dst_frame_mat = as_array(dst)

@overload
def __call__(self, target: Vector) -> Vector:
...
def __call__(self, target: Vector) -> Vector: ...

@overload
def __call__(self, target: Orientation) -> Orientation:
...
def __call__(self, target: Orientation) -> Orientation: ...

@overload
def __call__(self, target: Frame) -> Frame:
...
def __call__(self, target: Frame) -> Frame: ...

@overload
def __call__(self, target: xp.Array) -> xp.Array:
...
def __call__(self, target: xp.Array) -> xp.Array: ...

def __call__(self, target: Vector | Orientation | Frame | xp.Array):
match target:
Expand Down Expand Up @@ -203,20 +194,16 @@ def __init__(self, order: tuple[int, int, int]) -> None:
self._order = order

@overload
def __call__(self, target: Vector) -> Vector:
...
def __call__(self, target: Vector) -> Vector: ...

@overload
def __call__(self, target: Orientation) -> Orientation:
...
def __call__(self, target: Orientation) -> Orientation: ...

@overload
def __call__(self, target: Frame) -> Frame:
...
def __call__(self, target: Frame) -> Frame: ...

@overload
def __call__(self, target: xp.Array) -> xp.Array:
...
def __call__(self, target: xp.Array) -> xp.Array: ...

def __call__(self, target: Vector | Orientation | Frame | xp.Array):
match target:
Expand Down
6 changes: 2 additions & 4 deletions vanilla_roll/rendering/composition.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ def add(
*,
mask: xp.Array | None = None,
slice: Slice2d | None = None,
) -> None:
...
) -> None: ...

def compose(self) -> Image:
...
def compose(self) -> Image: ...


class AccMax(Composer):
Expand Down
3 changes: 1 addition & 2 deletions vanilla_roll/rendering/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,4 @@ def __call__(
self,
camera: Camera,
spacing: float | None = ...,
) -> RenderingResult:
...
) -> RenderingResult: ...
3 changes: 1 addition & 2 deletions vanilla_roll/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
class ValidationRule(Protocol):
"""ValidationRule is a protocol that defines a validation rule."""

def __call__(self, name: str, other: Any) -> ValueError | None:
...
def __call__(self, name: str, other: Any) -> ValueError | None: ...


class IsGreaterThan:
Expand Down

0 comments on commit c0f3d9c

Please sign in to comment.