Skip to content

Commit

Permalink
simple test for integrate_from_velocity_vectors
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasg committed Jan 2, 2018
1 parent 1ca11f1 commit f90b648
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test_quaternion.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,13 @@ def test_repr(self):
assert repr(unit_quat).startswith('Quaternion(')
assert eval(repr(unit_quat)) == unit_quat

@given(strategies.integers(min_value=1, max_value=5))
def test_integrate(self, number_of_vectors):
vectors = [np.array([0, 0, i / 10]) for i in range(1, number_of_vectors + 1)]
v = Quaternion.integrate_from_velocity_vectors(vectors)
expected = [0, 0, number_of_vectors * (number_of_vectors + 1) / 20]
np.testing.assert_allclose(expected, v)


class QuaternionStdDevTests(unittest.TestCase):
# tolerance is this big because average_and_std_naive gives slightly different results than matlab implementation
Expand Down

0 comments on commit f90b648

Please sign in to comment.