Skip to content

Commit

Permalink
Fix test attempt. (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
myeatman-bdai authored Nov 14, 2023
1 parent 256232d commit dbef460
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 43 deletions.
21 changes: 20 additions & 1 deletion tests/base/test_transforms3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,26 @@ def test_tr2angvec(self):
nt.assert_array_almost_equal(theta, 90)
nt.assert_array_almost_equal(v, np.r_[0, 1, 0])

true_ang = 1.51
true_vec = np.array([0., 1., 0.])
eps = 1e-08

# show that tr2angvec works on true rotation matrix
R = SO3.Ry(true_ang)
ang, vec = t3d.tr2angvec(R.A, check=True)
nt.assert_equal(ang, true_ang)
nt.assert_equal(vec, true_vec)

# check a rotation matrix that should fail
badR = SO3.Ry(true_ang).A[:, :] + eps
with self.assertRaises(ValueError):
t3d.tr2angvec(badR, check=True)

# run without check
ang, vec = t3d.tr2angvec(badR, check=False)
nt.assert_almost_equal(ang, true_ang)
nt.assert_equal(vec, true_vec)

def test_print(self):
R = rotx(0.3) @ roty(0.4)
s = trprint(R, file=None)
Expand Down Expand Up @@ -779,7 +799,6 @@ def test_x2tr(self):
x2tr(x, representation="exp"), transl(t) @ r2t(trexp(gamma))
)


# ---------------------------------------------------------------------------------------#
if __name__ == "__main__":
unittest.main()
42 changes: 0 additions & 42 deletions tests/test_transforms3d.py

This file was deleted.

0 comments on commit dbef460

Please sign in to comment.