Spaces:
Running
Running
refactor test eos
Browse files- tests/test_eos.py +7 -5
tests/test_eos.py
CHANGED
@@ -1,18 +1,20 @@
|
|
1 |
-
import
|
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 |
-
|
|
|
9 |
"""
|
10 |
Test EOS prefect workflow with a simple cubic lattice.
|
11 |
"""
|
12 |
|
13 |
result = EOS(
|
14 |
atoms=atoms,
|
15 |
-
calculator_name=
|
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.
|
24 |
),
|
25 |
max_abs_strain=0.1,
|
26 |
-
npoints=
|
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)
|