Skip to content

Commit b3abca6

Browse files
authored
Merge pull request #40 from outofculture/issue-35-framework-integration-tests
feat: add comprehensive framework integration tests (#35)
2 parents 8964c73 + 0e4b197 commit b3abca6

File tree

5 files changed

+418
-4
lines changed

5 files changed

+418
-4
lines changed

coorx/base_transform.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,8 @@ def full_matrix(self) -> np.ndarray:
287287

288288
def as_vispy(self):
289289
"""Return a VisPy transform that is equivalent to this transform, if possible."""
290+
if self.dims != (3, 3):
291+
raise NotImplementedError("as_vispy is only implemented for 3D transforms")
290292
from vispy.visuals.transforms import MatrixTransform
291293

292294
# a functional default if nothing else is implemented

coorx/linear.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,8 @@ def as_affine(self):
418418
return m
419419

420420
def as_vispy(self):
421+
if self.dims != (3, 3):
422+
raise NotImplementedError("as_vispy is only implemented for 3D transforms")
421423
from vispy.visuals.transforms import STTransform as VispySTTransform
422424

423425
return VispySTTransform(scale=self.scale, translate=self.offset)
@@ -854,6 +856,10 @@ def set_offset(self, offset):
854856
"""Set the translation of this transform"""
855857
self.set_params(offset=offset)
856858

859+
@property
860+
def offset(self):
861+
return self._state["offset"].copy()
862+
857863
def scale(self, scale):
858864
"""adjust the scale of this transform"""
859865
## try to prevent accidentally setting 0 scale on z axis

0 commit comments

Comments
 (0)