Skip to content
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

Inconsistency between as_quat_array and as_float_array for single quaternions #44

Closed
javidcf opened this issue Mar 30, 2017 · 1 comment

Comments

@javidcf
Copy link

javidcf commented Mar 30, 2017

quaternion.as_quat_array returns a single scalar quaternion when a one-dimensional array is given, while quaternion.as_float_array returns a two-dimensional array when a single quaternion is given.

import numpy as np
import quaternion

print (quaternion.as_quat_array([1., 2., 3., 4.]))
print (quaternion.as_float_array(np.quaternion(1., 2., 3., 4.)))

Output:

quaternion(1, 2, 3, 4)
[[ 1.  2.  3.  4.]]

I don't know if that's on purpose but it seems to me that quaternion.as_float_array(quaternion.as_quat_array(array)) should always equal array.

Version: numpy-quaternion-0.0.0.dev2017.03.30.16.33.31

@moble moble closed this as completed in f9a9785 Apr 5, 2017
@moble
Copy link
Owner

moble commented Apr 5, 2017

Thanks for pointing that out. Those functions have to deal with a lot of edge cases, and I wasn't doing that one right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants