From 24053fec7af57e44033daa84283aabd670e67acb Mon Sep 17 00:00:00 2001 From: brentyi Date: Wed, 11 Dec 2024 17:11:38 +0000 Subject: [PATCH] type errors --- src/viser/_viser.py | 4 +++- tests/utils.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/viser/_viser.py b/src/viser/_viser.py index e20d95d3..7025b7ee 100644 --- a/src/viser/_viser.py +++ b/src/viser/_viser.py @@ -183,7 +183,9 @@ def _update_wxyz(self) -> None: y = y - np.dot(z, y) * z y /= np.linalg.norm(y) x = np.cross(y, z) - self._state.wxyz = tf.SO3.from_matrix(np.stack([x, y, z], axis=1)).wxyz + self._state.wxyz = tf.SO3.from_matrix(np.stack([x, y, z], axis=1)).wxyz.astype( + np.float64 + ) @property def fov(self) -> float: diff --git a/tests/utils.py b/tests/utils.py index 9177d294..fafa2eec 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -121,7 +121,7 @@ def assert_transforms_close(a: vtf.MatrixLieGroup, b: vtf.MatrixLieGroup): assert_arrays_close(p1, p2) -def assert_arrays_close(*arrays: Union[npt.NDArray[np.float64], float]): +def assert_arrays_close(*arrays: Union[npt.NDArray[np.floating], float]): """Make sure two arrays are close. (and not NaN)""" for array1, array2 in zip(arrays[:-1], arrays[1:]): assert np.asarray(array1).dtype == np.asarray(array2).dtype