-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
948 add support to create coordinate systems from homogeneous transformation matrices #949
948 add support to create coordinate systems from homogeneous transformation matrices #949
Conversation
Will update |
It looks good to me but is still missing tests obviously. |
…ms-from-homogeneous-transformation-matrices
the pytest actions are running again @mbwinkler , you can add some testcases 👍 |
…eneous-transformation-matrices' of https://github.com/BAMWelDX/weldx into 948-add-support-to-create-coordinate-systems-from-homogeneous-transformation-matrices
Don't bother with mypy for now @mbwinkler , it can be quite a hassle |
@CagtayFabry https://stackoverflow.com/a/76271691 I could change the type to just use |
I think very good find on the SO post 👍 |
weldx/transformations/local_cs.py
Outdated
translation = np.resize( | ||
self.coordinates.data.to(translation_unit).m, (time_dim, 3) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently this expression raises a mypy error, because using self.coordinates
could return a TimeSeries
, which in turn would return pint.Quantity | MathematicalExpression
when .data
is accessed and the latter one does not support unit transformations. Not sure how to fix this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can leave out supporting TimeSeries
for now (throwing an error).
We could add
if isinstance(self.coordinates, TimeSeries):
raise NotImplementedError("Cannot convert LCS with `TimeSeries` coordinates to homogeneous matrix")
at the beginning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for adding the test cases!
I think this can be set as "ready for review"? :)
weldx/transformations/local_cs.py
Outdated
translation = np.resize( | ||
self.coordinates.data.to(translation_unit).m, (time_dim, 3) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can leave out supporting TimeSeries
for now (throwing an error).
We could add
if isinstance(self.coordinates, TimeSeries):
raise NotImplementedError("Cannot convert LCS with `TimeSeries` coordinates to homogeneous matrix")
at the beginning
pytest windows failures unrelated |
Changes
Added support for homogeneous transformation matrices.
Related Issues
Closes #948
Checks
CHANGELOG.md
tests/
doc/