Skip to content

Commit

Permalink
Update tests for NEB
Browse files Browse the repository at this point in the history
  • Loading branch information
ElliottKasoar committed Feb 28, 2025
1 parent 9ceb5a8 commit cc5c4ca
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
20 changes: 10 additions & 10 deletions tests/test_neb.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ def test_neb(tmp_path, LFPO_start_b, LFPO_end_b):

assert len(neb.images) == 7
assert all(key in neb.results for key in ("barrier", "delta_E", "max_force"))
assert neb.results["barrier"] == pytest.approx(7817.150960456944)
assert neb.results["delta_E"] == pytest.approx(78.34034136421758)
assert neb.results["barrier"] == pytest.approx(8117.328587956959)
assert neb.results["delta_E"] == pytest.approx(-3.0149328722473e-07)
assert neb.results["max_force"] == pytest.approx(148695.846153840771)


Expand Down Expand Up @@ -88,8 +88,8 @@ def test_neb_pymatgen(tmp_path, LFPO_start_b, LFPO_end_b):

assert len(neb.images) == 7
assert all(key in neb.results for key in ("barrier", "delta_E", "max_force"))
assert neb.results["barrier"] == pytest.approx(0.7536690819713392)
assert neb.results["delta_E"] == pytest.approx(5.363118589229998e-07)
assert neb.results["barrier"] == pytest.approx(0.5852889569624722)
assert neb.results["delta_E"] == pytest.approx(-3.0149328722473e-07)
assert neb.results["max_force"] == pytest.approx(2.533305796378263)


Expand All @@ -114,8 +114,8 @@ def test_set_calc(tmp_path, LFPO_start_b, LFPO_end_b):
# Same as results from test_neb
assert len(neb.images) == 7
assert all(key in neb.results for key in ("barrier", "delta_E", "max_force"))
assert neb.results["barrier"] == pytest.approx(7817.150960456944)
assert neb.results["delta_E"] == pytest.approx(78.34034136421758)
assert neb.results["barrier"] == pytest.approx(8117.328587986063)
assert neb.results["delta_E"] == pytest.approx(-3.0149328722473e-07)
assert neb.results["max_force"] == pytest.approx(148695.846153840771)


Expand All @@ -138,8 +138,8 @@ def test_neb_functions(tmp_path, LFPO_start_b, LFPO_end_b):

assert len(neb.images) == 7
assert all(key in neb.results for key in ("barrier", "delta_E", "max_force"))
assert neb.results["barrier"] == pytest.approx(7817.150960456944)
assert neb.results["delta_E"] == pytest.approx(78.34034136421758)
assert neb.results["barrier"] == pytest.approx(8117.328587986063)
assert neb.results["delta_E"] == pytest.approx(-3.0149328722473e-07)
assert neb.results["max_force"] == pytest.approx(148695.846153840771)


Expand All @@ -159,6 +159,6 @@ def test_neb_plot(tmp_path):

assert len(neb.images) == 7
assert all(key in neb.results for key in ("barrier", "delta_E", "max_force"))
assert neb.results["barrier"] == pytest.approx(0.67567742247752)
assert neb.results["delta_E"] == pytest.approx(5.002693796996027e-07)
assert neb.results["barrier"] == pytest.approx(0.4790452267999399)
assert neb.results["delta_E"] == pytest.approx(-2.814124400174478e-07)
assert neb.results["max_force"] == pytest.approx(1.5425684122118983)
8 changes: 4 additions & 4 deletions tests/test_neb_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def test_neb():
assert lines[0] == "#Barrier [eV] | delta E [eV] | Max force [eV/Å] \n"
results = [float(result) for result in lines[1].split()]
assert results == pytest.approx(
[0.8984807983308647, 5.634287845168728e-07, 4.802233744475505]
[0.8497755543465928, -3.0149328722473e-07, 4.802233744475505]
)
assert "command" in neb_summary
assert "janus neb" in neb_summary["command"]
Expand Down Expand Up @@ -144,7 +144,7 @@ def test_minimize(tmp_path):
assert lines[0] == "#Barrier [eV] | delta E [eV] | Max force [eV/Å] \n"
results = [float(result) for result in lines[1].split()]
assert results == pytest.approx(
[0.8296793283384434, 5.145591330801835e-07, 2.174366063099385]
[0.8551249637134779, -1.4654790447821142e-07, 2.174366063099385]
)

assert_log_contains(
Expand Down Expand Up @@ -315,7 +315,7 @@ def test_interpolator(tmp_path):
lines = results_file.readlines()
results = [float(result) for result in lines[1].split()]
assert results == pytest.approx(
[336131.8396612201, -3.792642177184348, 59797105.48085273]
[336164.9211653024, -3.0149328722473e-07, 59797105.48085273]
)


Expand Down Expand Up @@ -354,7 +354,7 @@ def test_optimzer(tmp_path):
lines = results_file.readlines()
results = [float(result) for result in lines[1].split()]
assert results == pytest.approx(
[1.59760263850103, 3.3379069463990163e-07, 6.3809101701189075]
[1.705643002186438, -3.0149328722473e-07, 6.3809101701189075]
)


Expand Down

0 comments on commit cc5c4ca

Please sign in to comment.