From bd0f98776bf847bb7646b6f61f2d065afa387c5c Mon Sep 17 00:00:00 2001 From: Aaron Date: Wed, 9 Aug 2023 02:45:45 +0000 Subject: [PATCH] [SymForce] Print type for unsupported compose Instead of printing the value, the expressions are both large (don't ever print expressions in error messages!) and unhelpful Topic: sf-print-type GitOrigin-RevId: 23544d6aa6ec29288a999fea60465a76474fd7fa --- symforce/geo/pose2.py | 2 +- symforce/geo/pose3.py | 2 +- symforce/geo/rot3.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/symforce/geo/pose2.py b/symforce/geo/pose2.py index 3c05b97ea..2363b4aef 100644 --- a/symforce/geo/pose2.py +++ b/symforce/geo/pose2.py @@ -211,7 +211,7 @@ def __mul__(self, right: T.Union[Pose2, Vector2]) -> T.Union[Pose2, Vector2]: elif isinstance(right, self.__class__): return self.compose(right) else: - raise NotImplementedError(f'Unsupported type: "{right}"') + raise NotImplementedError(f'Unsupported type: "{type(right)}"') def to_homogenous_matrix(self) -> Matrix: """ diff --git a/symforce/geo/pose3.py b/symforce/geo/pose3.py index 5ee262b7e..50b888413 100644 --- a/symforce/geo/pose3.py +++ b/symforce/geo/pose3.py @@ -221,7 +221,7 @@ def __mul__(self: Pose3T, right: T.Union[Pose3T, Vector3]) -> T.Union[Pose3T, Ve elif isinstance(right, Pose3): return self.compose(right) else: - raise NotImplementedError(f'Unsupported type: "{right}"') + raise NotImplementedError(f'Unsupported type: "{type(right)}"') def to_homogenous_matrix(self) -> Matrix: """ diff --git a/symforce/geo/rot3.py b/symforce/geo/rot3.py index abb2a64c2..be59e096b 100644 --- a/symforce/geo/rot3.py +++ b/symforce/geo/rot3.py @@ -147,7 +147,7 @@ def __mul__(self, right: T.Union[Vector3, Rot3]) -> T.Union[Vector3, Rot3]: elif isinstance(right, Rot3): return self.compose(right) else: - raise NotImplementedError(f'Unsupported type: "{right}"') + raise NotImplementedError(f'Unsupported type: "{type(right)}"') def to_rotation_matrix(self) -> Matrix33: """