Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
slava committed Nov 21, 2017
1 parent a680ae2 commit 17a258f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/test_quaternions.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ def test_from_matrix(self, arr):
def test_basis(self, arr):
assume(GeneralQuaternion(*arr).norm() > DEFAULT_TOLERANCE)
q = Quaternion(*arr)
assert np.array_equal([*q.basis], q.matrix)
b1, b2, b3 = q.basis
assert np.array_equal([b1, b2, b3], q.matrix)

@given(ANY_ROTATION_VECTOR)
def test_from_ra_dec_roll(self, arr):
Expand All @@ -143,9 +144,11 @@ def test_from_ra_dec_roll(self, arr):

@given(ANY_QUATERNION)
def test_ra_dec_roll(self, arr):
assume(np.linalg.norm(arr) > DEFAULT_TOLERANCE)
assume(np.linalg.norm(arr) > 3 * DEFAULT_TOLERANCE)
q = Quaternion(*arr)
assert Quaternion.from_ra_dec_roll(*q.ra_dec_roll) == q
ra, dec, roll = q.ra_dec_roll
assume(abs(abs(dec) - 90) > 1e-3) # avoid singularity at dec==+_90
assert Quaternion.from_ra_dec_roll(ra, dec, roll) == q

def test_qmethod(self):
v1, v2 = [2 / 3, 2 / 3, 1 / 3], [2 / 3, -1 / 3, -2 / 3]
Expand Down

0 comments on commit 17a258f

Please sign in to comment.