cyrusyc commited on
Commit
c3e45ae
1 Parent(s): 79e5bd9

refactor test eos

Browse files
Files changed (1) hide show
  1. tests/test_eos.py +7 -5
tests/test_eos.py CHANGED
@@ -1,18 +1,20 @@
1
- import numpy as np
2
  from ase.build import bulk
3
 
 
4
  from mlip_arena.tasks.eos.run import fit as EOS
5
 
6
  atoms = bulk("Cu", "fcc", a=3.6)
7
 
8
- def test_eos():
 
9
  """
10
  Test EOS prefect workflow with a simple cubic lattice.
11
  """
12
 
13
  result = EOS(
14
  atoms=atoms,
15
- calculator_name="MACE-MP(M)",
16
  calculator_kwargs={},
17
  device=None,
18
  optimizer="BFGSLineSearch",
@@ -20,10 +22,10 @@ def test_eos():
20
  filter="FrechetCell",
21
  filter_kwargs=None,
22
  criterion=dict(
23
- fmax=0.01,
24
  ),
25
  max_abs_strain=0.1,
26
- npoints=11,
27
  )
28
 
29
  print(result)
 
1
+ import pytest
2
  from ase.build import bulk
3
 
4
+ from mlip_arena.models.utils import MLIPEnum
5
  from mlip_arena.tasks.eos.run import fit as EOS
6
 
7
  atoms = bulk("Cu", "fcc", a=3.6)
8
 
9
+ @pytest.mark.parametrize("model", [MLIPEnum["MACE-MP(M)"]])
10
+ def test_eos(model: MLIPEnum):
11
  """
12
  Test EOS prefect workflow with a simple cubic lattice.
13
  """
14
 
15
  result = EOS(
16
  atoms=atoms,
17
+ calculator_name=model.name,
18
  calculator_kwargs={},
19
  device=None,
20
  optimizer="BFGSLineSearch",
 
22
  filter="FrechetCell",
23
  filter_kwargs=None,
24
  criterion=dict(
25
+ fmax=0.1,
26
  ),
27
  max_abs_strain=0.1,
28
+ npoints=6,
29
  )
30
 
31
  print(result)