Skip to content

Commit

Permalink
fix windows test numerical precision error, now round all to 6 decima…
Browse files Browse the repository at this point in the history
…l places
  • Loading branch information
knaidoo29 committed Nov 28, 2024
1 parent 4370d81 commit 3ba24d2
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions mistree/tests/test_coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def test_celestial_2_cartesian():
assert round(z, 6) == 1.
phi, theta, x, y, z = mist.celestial_2_cartesian(1., 0., 0.)
assert phi == 0.
assert theta == round(np.pi/2., 6)
assert round(theta, 6) == round(np.pi/2., 6)
assert round(x, 6) == 1.
assert round(y, 6) == 0.
assert round(z, 6) == 0.
Expand All @@ -64,7 +64,7 @@ def test_celestial_2_cartesian():
assert round(z, 6) == 0.
phi, theta, x, y, z = mist.celestial_2_cartesian(1., 0., 45.)
assert phi == 0.
assert theta == round(np.pi/4., 6)
assert round(theta, 6) == round(np.pi/4., 6)
assert round(x, 6) == round(np.sqrt(2.)/2., 6)
assert round(y, 6) == 0.
assert round(z, 6) == round(np.sqrt(2.)/2., 6)
Expand All @@ -74,7 +74,7 @@ def test_celestial_2_cartesian():
assert round(z, 6) == round(np.sqrt(2.)/2., 6)
phi, theta, x, y, z = mist.celestial_2_cartesian(1., 0., np.pi/2., units='radians')
assert phi == 0.
assert theta == 0.
assert round(theta, 6) == 0.
assert round(x, 6) == 0.
assert round(y, 6) == 0.
assert round(z, 6) == 1.
Expand All @@ -84,7 +84,7 @@ def test_celestial_2_cartesian():
assert round(z, 6) == 1.
phi, theta, x, y, z = mist.celestial_2_cartesian(1., 0., 0., units='radians')
assert phi == 0.
assert theta == round(np.pi/2., 6)
assert round(theta, 6) == round(np.pi/2., 6)
assert round(x, 6) == 1.
assert round(y, 6) == 0.
assert round(z, 6) == 0.
Expand All @@ -94,7 +94,7 @@ def test_celestial_2_cartesian():
assert round(z, 6) == 0.
phi, theta, x, y, z = mist.celestial_2_cartesian(1., 0., np.pi/4., units='radians')
assert phi == 0.
assert theta == round(np.pi/4., 6)
assert round(theta, 6) == round(np.pi/4., 6)
assert round(x, 6) == round(np.sqrt(2.)/2., 6)
assert round(y, 6) == 0.
assert round(z, 6) == round(np.sqrt(2.)/2., 6)
Expand Down Expand Up @@ -167,7 +167,7 @@ def test_celestial_2_unit_sphere():
assert round(z, 6) == 1.
phi, theta, x, y, z = mist.celestial_2_unit_sphere(0., 0.)
assert phi == 0.
assert theta == round(np.pi/2., 6)
assert round(theta, 6) == round(np.pi/2., 6)
assert round(x, 6) == 1.
assert round(y, 6) == 0.
assert round(z, 6) == 0.
Expand All @@ -177,7 +177,7 @@ def test_celestial_2_unit_sphere():
assert round(z, 6) == 0.
phi, theta, x, y, z = mist.celestial_2_unit_sphere(0., 45.)
assert phi == 0.
assert theta == round(np.pi/4., 6)
assert round(theta, 6) == round(np.pi/4., 6)
assert round(x, 6) == round(np.sqrt(2.)/2., 6)
assert round(y, 6) == 0.
assert round(z, 6) == round(np.sqrt(2.)/2., 6)
Expand All @@ -197,7 +197,7 @@ def test_celestial_2_unit_sphere():
assert round(z, 6) == 1.
phi, theta, x, y, z = mist.celestial_2_unit_sphere(0., 0., units='radians')
assert phi == 0.
assert theta == round(np.pi/2., 6)
assert round(theta, 6) == round(np.pi/2., 6)
assert round(x, 6) == 1.
assert round(y, 6) == 0.
assert round(z, 6) == 0.
Expand All @@ -207,7 +207,7 @@ def test_celestial_2_unit_sphere():
assert round(z, 6) == 0.
phi, theta, x, y, z = mist.celestial_2_unit_sphere(0., np.pi/4., units='radians')
assert phi == 0.
assert theta == round(np.pi/4., 6)
assert round(theta, 6) == round(np.pi/4., 6)
assert round(x, 6) == round(np.sqrt(2.)/2., 6)
assert round(y, 6) == 0.
assert round(z, 6) == round(np.sqrt(2.)/2., 6)
Expand Down

0 comments on commit 3ba24d2

Please sign in to comment.