Skip to content

Commit

Permalink
[SymForce] Print type for unsupported compose
Browse files Browse the repository at this point in the history
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
  • Loading branch information
aaron-skydio committed Aug 22, 2023
1 parent 5fcecf6 commit bd0f987
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion symforce/geo/pose2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand Down
2 changes: 1 addition & 1 deletion symforce/geo/pose3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand Down
2 changes: 1 addition & 1 deletion symforce/geo/rot3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand Down

0 comments on commit bd0f987

Please sign in to comment.