Skip to content

Commit

Permalink
Fixing mypy errors in optika.transforms.
Browse files Browse the repository at this point in the history
  • Loading branch information
byrdie committed Aug 14, 2023
1 parent 3a4211b commit 1a0fee5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions optika/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ class Translation(AbstractTransform):
A translation-only vector transformation.
"""

displacement: na.Cartesian3dVectorArray = dataclasses.MISSING
displacement: na.Cartesian3dVectorArray = dataclasses.field(
default_factory=na.Cartesian3dVectorArray
)
"""The magnitude of the translation along each axis"""

@property
Expand Down Expand Up @@ -157,7 +159,7 @@ def transforms(self) -> Iterator[AbstractTransform]:
return iter(self)

@property
def matrix(self) -> na.Cartesian3dMatrixArray:
def matrix(self) -> na.AbstractCartesian3dMatrixArray:
rotation = na.Cartesian3dIdentityMatrixArray()

for transform in reversed(list(self.transforms)):
Expand All @@ -169,7 +171,7 @@ def matrix(self) -> na.Cartesian3dMatrixArray:
@property
def vector(self) -> na.Cartesian3dVectorArray:
rotation = na.Cartesian3dIdentityMatrixArray()
translation = 0
translation = na.Cartesian3dVectorArray()

for transform in reversed(list(self.transforms)):
if transform is not None:
Expand Down

0 comments on commit 1a0fee5

Please sign in to comment.