-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
rotation._compute_euler_from_matrix() creates an array with negative stride (-8) #13584
Labels
Milestone
Comments
Mhm I guess this is not a bug, but quite expected due to the reversing array operation. So downstream projects should deal with this, right? |
Let's check with @nmayorov |
To be honest I have never thought about array strides and especially negative strides. It looks like having negative strides is strange and unnecessary. Adding copy operation easily fixes that:
Can you send a fix PR for that? |
Sure can do, thanks for looking into this!
|
marscher
added a commit
to marscher/scipy
that referenced
this issue
Feb 22, 2021
…ut for output array The output array (or memoryview) used to have a negative stride, which may cause problems later on when trying to wrap it in an ndarray again. Fixes scipy#13584
marscher
added a commit
to marscher/scipy
that referenced
this issue
Feb 22, 2021
The output array (or memoryview) used to have a negative stride, which may cause problems later on when trying to wrap it in an ndarray again. This is only the case for extrinsic rotations. Closes scipy#13584
tylerjereddy
pushed a commit
to tylerjereddy/scipy
that referenced
this issue
Mar 20, 2021
The output array (or memoryview) used to have a negative stride, which may cause problems later on when trying to wrap it in an ndarray again. This is only the case for extrinsic rotations. Closes scipy#13584
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The scipy.spatial.transform.Rotation class generates a "weird" output array when calling the method as_euler. The stride of this array is negative (-8). This does not seem like a problem, but causes issues in downstream software, e.g. when serializing the array.
Taking a copy "fixes" the stride again, e.g. makes it positive again. I assume that this is caused by the extrensic broadcasting/reversing done here:
scipy/scipy/spatial/transform/rotation.pyx
Line 221 in f6762e4
Downstream code using Rotation.from_euler worked prior version 1.6, in which the Rotation class is a cythonized class.
xref: asdf-format/asdf#916
xref: BAMWelDX/weldx#226
Reproducing code example:
Error message:
Scipy/Numpy/Python version information:
1.6.0 1.20.1 sys.version_info(major=3, minor=7, micro=9, releaselevel='final', serial=0)
The text was updated successfully, but these errors were encountered: