Skip to content

Commit

Permalink
TST #300 specify the type of tolerance
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian authored Nov 22, 2023
1 parent e5d6440 commit cedc797
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions hkl/tests/test_diffract.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def test_forward_solutions_table(fourc):
def check_limits_and_value(axis, value, tol=1e-5):
assert min(fourc.calc[axis].limits) <= value
assert max(fourc.calc[axis].limits) >= value
assert pytest.approx(getattr(sol, axis), 1e-5) == value
assert pytest.approx(getattr(sol, axis), abs=1e-5) == value

check_limits_and_value("omega", -30, 0.1)
check_limits_and_value("chi", 0, 0.1)
Expand Down Expand Up @@ -314,10 +314,10 @@ def test_apply_constraints(fourc):
)
# fmt: on
sol = fourc.forward(1, 0, 0)
assert pytest.approx(sol.omega, 1e-5) == 30
assert pytest.approx(sol.chi, 1e-5) == 0
assert pytest.approx(sol.phi, 1e-5) == 90
assert pytest.approx(sol.tth, 1e-5) == 60
assert pytest.approx(sol.omega, abs=1e-5) == 30
assert pytest.approx(sol.chi, abs=1e-5) == 0
assert pytest.approx(sol.phi, abs=1e-5) == 90
assert pytest.approx(sol.tth, abs=1e-5) == 60


def test_specify_engine():
Expand Down

0 comments on commit cedc797

Please sign in to comment.