diff --git a/tests/test_relaxation.py b/tests/test_relaxation.py index b678d24..7b2cbfc 100644 --- a/tests/test_relaxation.py +++ b/tests/test_relaxation.py @@ -19,7 +19,7 @@ @pytest.mark.parametrize( ("cell_filter", "expected_a", "expected_energy"), - [(ExpCellFilter, 3.288585, -14.176882), (FrechetCellFilter, 3.291071, -14.176743)], + [(ExpCellFilter, 3.288585, -14.176867), (FrechetCellFilter, 3.291072, -14.176713)], ) def test_relax_calc_relax_cell( Li2O: Structure, @@ -54,7 +54,7 @@ def test_relax_calc_relax_cell( assert final_struct.volume == pytest.approx(a * b * c / 2**0.5, abs=0.1) -@pytest.mark.parametrize(("expected_a", "expected_energy"), [(3.291071, -14.1767423)]) +@pytest.mark.parametrize(("expected_a", "expected_energy"), [(3.291072, -14.176713)]) def test_relax_calc_relax_atoms( Li2O: Structure, M3GNetCalc: M3GNetCalculator, tmp_path: Path, expected_a: float, expected_energy: float ) -> None: @@ -82,28 +82,27 @@ def test_relax_calc_relax_atoms( ("expected_energy", "expected_forces", "expected_stresses"), [ ( - -14.176743, + -14.176713, np.array( [ - [-4.252263e-03, -3.029412e-03, -7.360560e-03], - [4.272716e-03, 3.017864e-03, 7.360807e-03], - [-2.035008e-05, 1.152878e-05, -2.714805e-07], + [6.577218e-06, 1.851469e-06, -7.080846e-06], + [-4.507415e-03, -3.310852e-03, -7.090813e-03], + [4.500971e-03, 3.309000e-03, 7.097944e-03], ], dtype=np.float32, ), - np.array([0.003945, 0.004185, 0.003000, -0.000584, -0.000826, -0.000337], dtype=np.float32), + np.array([0.003883, 0.004126, 0.003089, -0.000617, -0.000839, -0.000391], dtype=np.float32), ), ], ) def test_static_calc( Li2O: Structure, M3GNetCalc: M3GNetCalculator, - tmp_path: Path, expected_energy: float, expected_forces: ArrayLike, expected_stresses: ArrayLike, ) -> None: - relax_calc = RelaxCalc(M3GNetCalc, traj_file=f"{tmp_path}/li2o_relax.txt", relax_atoms=False, relax_cell=False) + relax_calc = RelaxCalc(M3GNetCalc, relax_atoms=False, relax_cell=False) result = relax_calc.calc(Li2O) energy: float = result["energy"] @@ -115,7 +114,7 @@ def test_static_calc( assert np.allclose(stresses, expected_stresses, rtol=1e-3) -@pytest.mark.parametrize(("cell_filter", "expected_a"), [(ExpCellFilter, 3.288585), (FrechetCellFilter, 3.291071)]) +@pytest.mark.parametrize(("cell_filter", "expected_a"), [(ExpCellFilter, 3.288585), (FrechetCellFilter, 3.291072)]) def test_relax_calc_many(Li2O: Structure, M3GNetCalc: M3GNetCalculator, cell_filter: Filter, expected_a: float) -> None: relax_calc = RelaxCalc(M3GNetCalc, optimizer="FIRE", cell_filter=cell_filter) results = list(relax_calc.calc_many([Li2O] * 2))