We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When creating G3VectorQuat from numpy array, it seems to check for shape (-1, 4) but does not handle non-trivial strides.
Consider test program:
from spt3g import core import numpy as np quats = np.array([[1., 2., 3., 4., 5.], # a [0., 0., 0., 0., 0.], # b [0., 0., 0., 0., 0.], # c [0., 0., 0., 0., 0.]]) # d for test in [ quats, # bad shape quats[:,:4], # ok shape, non-trivial strides quats.T, # ok shape, non-trivial strides quats.T.copy(), # ok shape, trivial strides ]: try: print(repr(core.G3VectorQuat(test))) except TypeError: print('(TypeError)')
Produces output (on version 0.3-71-g613d0d4):
(TypeError) (TypeError) spt3g.core.G3VectorQuat([(1,2,3,4), (5,0,0,0), (0,0,0,0), (0,0,0,0), (0,0,0,0)]) spt3g.core.G3VectorQuat([(1,0,0,0), (2,0,0,0), (3,0,0,0), (4,0,0,0), (5,0,0,0)])
But expected output is:
(TypeError) spt3g.core.G3VectorQuat([(1,2,3,4), (0,0,0,0), (0,0,0,0), (0,0,0,0)]) spt3g.core.G3VectorQuat([(1,0,0,0), (2,0,0,0), (3,0,0,0), (4,0,0,0), (5,0,0,0)]) spt3g.core.G3VectorQuat([(1,0,0,0), (2,0,0,0), (3,0,0,0), (4,0,0,0), (5,0,0,0)])
OR
(TypeError) (TypeError) (TypeError) spt3g.core.G3VectorQuat([(1,0,0,0), (2,0,0,0), (3,0,0,0), (4,0,0,0), (5,0,0,0)])
(In the latter case, the code would simply rejecting anything that doesn't have simple C ordering.)
The text was updated successfully, but these errors were encountered:
Is this fixed with acf0337?
Sorry, something went wrong.
Nope. That commit fixes all scalar types. This one still requires some more work, though. Will take care of it today.
3479e65
nwhitehorn
No branches or pull requests
When creating G3VectorQuat from numpy array, it seems to check for shape (-1, 4) but does not handle non-trivial strides.
Consider test program:
Produces output (on version 0.3-71-g613d0d4):
But expected output is:
OR
(In the latter case, the code would simply rejecting anything that doesn't have simple C ordering.)
The text was updated successfully, but these errors were encountered: