type annotation updates

This commit is contained in:
Jan Petykiewicz 2024-07-28 19:44:04 -07:00
commit 9d5b1ef5e6
15 changed files with 28 additions and 28 deletions

View file

@ -63,7 +63,7 @@ class LayerableImpl(Layerable, metaclass=ABCMeta):
return self._layer
@layer.setter
def layer(self, val: layer_t):
def layer(self, val: layer_t) -> None:
self._layer = val
#

View file

@ -44,7 +44,7 @@ class Mirrorable(metaclass=ABCMeta):
# """
# __slots__ = ()
#
# _mirrored: numpy.ndarray # ndarray[bool]
# _mirrored: NDArray[numpy.bool]
# """ Whether to mirror the instance across the x and/or y axes. """
#
# #
@ -52,12 +52,12 @@ class Mirrorable(metaclass=ABCMeta):
# #
# # Mirrored property
# @property
# def mirrored(self) -> numpy.ndarray: # ndarray[bool]
# def mirrored(self) -> NDArray[numpy.bool]:
# """ Whether to mirror across the [x, y] axes, respectively """
# return self._mirrored
#
# @mirrored.setter
# def mirrored(self, val: Sequence[bool]):
# def mirrored(self, val: Sequence[bool]) -> None:
# if is_scalar(val):
# raise MasqueError('Mirrored must be a 2-element list of booleans')
# self._mirrored = numpy.array(val, dtype=bool, copy=True)

View file

@ -34,7 +34,7 @@ class Repeatable(metaclass=ABCMeta):
# @repetition.setter
# @abstractmethod
# def repetition(self, repetition: 'Repetition | None'):
# def repetition(self, repetition: 'Repetition | None') -> None:
# pass
#
@ -75,7 +75,7 @@ class RepeatableImpl(Repeatable, Bounded, metaclass=ABCMeta):
return self._repetition
@repetition.setter
def repetition(self, repetition: 'Repetition | None'):
def repetition(self, repetition: 'Repetition | None') -> None:
from ..repetition import Repetition
if repetition is not None and not isinstance(repetition, Repetition):
raise MasqueError(f'{repetition} is not a valid Repetition object!')

View file

@ -54,7 +54,7 @@ class RotatableImpl(Rotatable, metaclass=ABCMeta):
return self._rotation
@rotation.setter
def rotation(self, val: float):
def rotation(self, val: float) -> None:
if not numpy.size(val) == 1:
raise MasqueError('Rotation must be a scalar')
self._rotation = val % (2 * pi)

View file

@ -48,7 +48,7 @@ class ScalableImpl(Scalable, metaclass=ABCMeta):
return self._scale
@scale.setter
def scale(self, val: float):
def scale(self, val: float) -> None:
if not is_scalar(val):
raise MasqueError('Scale must be a scalar')
if not val > 0: