added broadcasting test for composite rotations
This commit is contained in:
parent
fb2d49741a
commit
0393bdb214
|
@ -975,6 +975,13 @@ class TestRotation:
|
||||||
assert np.allclose(rot_broadcast.quaternion[...,i,:], rot.quaternion)
|
assert np.allclose(rot_broadcast.quaternion[...,i,:], rot.quaternion)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize('shape',[(3,2),(4,6)])
|
||||||
|
def test_broadcastcomposition(self,shape):
|
||||||
|
a = Rotation.from_random(shape[0])
|
||||||
|
b = Rotation.from_random(shape[1])
|
||||||
|
assert (a[:,np.newaxis]*b[np.newaxis,:]).allclose(a.broadcast_to(shape)*b.broadcast_to(shape))
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize('function,invalid',[(Rotation.from_quaternion, np.array([-1,0,0,0])),
|
@pytest.mark.parametrize('function,invalid',[(Rotation.from_quaternion, np.array([-1,0,0,0])),
|
||||||
(Rotation.from_quaternion, np.array([1,1,1,0])),
|
(Rotation.from_quaternion, np.array([1,1,1,0])),
|
||||||
(Rotation.from_Euler_angles, np.array([1,4,0])),
|
(Rotation.from_Euler_angles, np.array([1,4,0])),
|
||||||
|
|
Loading…
Reference in New Issue