Various type-checking improvements

This commit is contained in:
Jan Petykiewicz 2025-10-26 18:45:09 -07:00
commit 0c04bf8ea3
13 changed files with 27 additions and 26 deletions

View file

@ -73,7 +73,7 @@ class PositionableImpl(Positionable, metaclass=ABCMeta):
#
# offset property
@property
def offset(self) -> Any: # mypy#3004 NDArray[numpy.float64]:
def offset(self) -> NDArray[numpy.float64]:
"""
[x, y] offset
"""
@ -95,7 +95,7 @@ class PositionableImpl(Positionable, metaclass=ABCMeta):
return self
def translate(self, offset: ArrayLike) -> Self:
self._offset += offset # type: ignore # NDArray += ArrayLike should be fine??
self._offset += numpy.asarray(offset)
return self

View file

@ -116,7 +116,7 @@ class PivotableImpl(Pivotable, metaclass=ABCMeta):
pivot = numpy.asarray(pivot, dtype=float)
cast('Positionable', self).translate(-pivot)
cast('Rotatable', self).rotate(rotation)
self.offset = numpy.dot(rotation_matrix_2d(rotation), self.offset) # type: ignore # mypy#3004
self.offset = numpy.dot(rotation_matrix_2d(rotation), self.offset)
cast('Positionable', self).translate(+pivot)
return self