various fixes and cleanup

mainly involving ports_to_data and data_to_ports
This commit is contained in:
Jan Petykiewicz 2023-01-25 23:57:02 -08:00 committed by jan
commit 963918d1d9
13 changed files with 62 additions and 54 deletions

View file

@ -1,4 +1,4 @@
from typing import TypeVar, cast
from typing import TypeVar, cast, Any
from abc import ABCMeta, abstractmethod
import numpy
@ -114,6 +114,9 @@ class PivotableImpl(Pivotable, metaclass=ABCMeta):
"""
__slots__ = ()
offset: Any # TODO see if we can get around defining `offset` in PivotableImpl
""" `[x_offset, y_offset]` """
def rotate_around(self: J, pivot: ArrayLike, rotation: float) -> J:
pivot = numpy.array(pivot, dtype=float)
cast(Positionable, self).translate(-pivot)