3
3
4
4
import pytest
5
5
from jobflow import run_locally
6
- from pymatgen .core import Structure
6
+ from pymatgen .core import Molecule , Structure
7
7
from pymatgen .symmetry .analyzer import SpacegroupAnalyzer
8
8
from pytest import approx , importorskip
9
9
@@ -319,9 +319,7 @@ def test_mace_relax_maker(
319
319
assert output1 .output .n_steps == 7
320
320
321
321
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 ):
325
323
job = ForceFieldRelaxMaker (
326
324
force_field_name = "MACE_MPA_0" ,
327
325
steps = 25 ,
@@ -333,12 +331,27 @@ def test_mace_mpa_0_relax_maker(
333
331
# validating the outputs of the job
334
332
output = responses [job .uuid ][1 ].output
335
333
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
+
336
345
assert output .ase_calculator_name == "MLFF.MACE_MPA_0"
337
346
assert output .output .energy == pytest .approx (- 10.829493522644043 )
338
347
assert output .output .structure .volume == pytest .approx (40.87471552602735 )
339
348
assert len (output .output .ionic_steps ) == 4
340
349
assert output .structure .volume == output .output .structure .volume
341
350
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
+
342
355
343
356
def test_gap_static_maker (si_structure : Structure , test_dir ):
344
357
importorskip ("quippy" )
0 commit comments