Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the united test for hessian in test_ase.py to improve the coverage score #157

Merged
merged 10 commits into from
Sep 1, 2023
2 changes: 2 additions & 0 deletions tests/ext/test_ase.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ def test_M3GNetCalculator(MoS):
adaptor = AseAtomsAdaptor()
s_ase = adaptor.get_atoms(MoS) # type: ignore
ff = load_model("M3GNet-MP-2021.2.8-PES")
ff.calc_hessian = True
calc = M3GNetCalculator(potential=ff)
s_ase.set_calculator(calc)
assert [s_ase.get_potential_energy().size] == [1]
assert list(s_ase.get_forces().shape) == [2, 3]
assert list(s_ase.get_stress().shape) == [6]
assert list(calc.results["hessian"].shape) == [6, 6]
np.testing.assert_allclose(s_ase.get_potential_energy(), -10.312888)


Expand Down