Various type-checking improvements
This commit is contained in:
parent
e5f0c85560
commit
0c04bf8ea3
13 changed files with 27 additions and 26 deletions
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue