33
44import pytest
55from jobflow import run_locally
6- from pymatgen .core import Structure
6+ from pymatgen .core import Molecule , Structure
77from pymatgen .symmetry .analyzer import SpacegroupAnalyzer
88from pytest import approx , importorskip
99
@@ -319,9 +319,7 @@ def test_mace_relax_maker(
319319 assert output1 .output .n_steps == 7
320320
321321
322- def test_mace_mpa_0_relax_maker (
323- si_structure : Structure ,
324- ):
322+ def test_mace_mpa_0_relax_maker (si_structure : Structure , water_molecule : Molecule ):
325323 job = ForceFieldRelaxMaker (
326324 force_field_name = "MACE_MPA_0" ,
327325 steps = 25 ,
@@ -333,12 +331,27 @@ def test_mace_mpa_0_relax_maker(
333331 # validating the outputs of the job
334332 output = responses [job .uuid ][1 ].output
335333
334+ job_mol = ForceFieldRelaxMaker (
335+ force_field_name = "MACE_MPA_0" ,
336+ steps = 25 ,
337+ relax_kwargs = {"fmax" : 0.005 },
338+ ).make (water_molecule )
339+ # run the flow or job and ensure that it finished running successfully
340+ responses_mol = run_locally (job_mol , ensure_success = True )
341+
342+ # validating the outputs of the job
343+ output_mol = responses_mol [job_mol .uuid ][1 ].output
344+
336345 assert output .ase_calculator_name == "MLFF.MACE_MPA_0"
337346 assert output .output .energy == pytest .approx (- 10.829493522644043 )
338347 assert output .output .structure .volume == pytest .approx (40.87471552602735 )
339348 assert len (output .output .ionic_steps ) == 4
340349 assert output .structure .volume == output .output .structure .volume
341350
351+ assert output_mol .ase_calculator_name == "MLFF.MACE_MPA_0"
352+ assert output_mol .output .energy == pytest .approx (- 13.786081314086914 )
353+ assert len (output_mol .output .ionic_steps ) == 20
354+
342355
343356def test_gap_static_maker (si_structure : Structure , test_dir ):
344357 importorskip ("quippy" )
0 commit comments