Spaces:
Running
Running
Yuan (Cyrus) Chiang
commited on
promote run deps, bump prefect and mace versions (#40)
Browse files* promote run deps, bump prefect and mace versions
* reorganize pyproject toml
* test caching
* disable granular cache in eos
- mlip_arena/tasks/eos.py +3 -10
- pyproject.toml +9 -13
- tests/test_eos.py +3 -6
mlip_arena/tasks/eos.py
CHANGED
@@ -54,8 +54,6 @@ def run(
|
|
54 |
max_abs_strain: float = 0.1,
|
55 |
npoints: int = 11,
|
56 |
concurrent: bool = True,
|
57 |
-
persist_opt: bool = True,
|
58 |
-
cache_opt: bool = True,
|
59 |
) -> dict[str, Any] | State:
|
60 |
"""
|
61 |
Compute the equation of state (EOS) for the given atoms and calculator.
|
@@ -80,12 +78,7 @@ def run(
|
|
80 |
A dictionary containing the EOS data, bulk modulus, equilibrium volume, and equilibrium energy if successful. Otherwise, a prefect state object.
|
81 |
"""
|
82 |
|
83 |
-
|
84 |
-
refresh_cache=not cache_opt,
|
85 |
-
persist_result=persist_opt,
|
86 |
-
)
|
87 |
-
|
88 |
-
state = OPT_(
|
89 |
atoms=atoms,
|
90 |
calculator_name=calculator_name,
|
91 |
calculator_kwargs=calculator_kwargs,
|
@@ -119,7 +112,7 @@ def run(
|
|
119 |
atoms = relaxed.copy()
|
120 |
atoms.set_cell(c0 * f, scale_atoms=True)
|
121 |
|
122 |
-
future =
|
123 |
atoms=atoms,
|
124 |
calculator_name=calculator_name,
|
125 |
calculator_kwargs=calculator_kwargs,
|
@@ -145,7 +138,7 @@ def run(
|
|
145 |
atoms = relaxed.copy()
|
146 |
atoms.set_cell(c0 * f, scale_atoms=True)
|
147 |
|
148 |
-
state =
|
149 |
atoms=atoms,
|
150 |
calculator_name=calculator_name,
|
151 |
calculator_kwargs=calculator_kwargs,
|
|
|
54 |
max_abs_strain: float = 0.1,
|
55 |
npoints: int = 11,
|
56 |
concurrent: bool = True,
|
|
|
|
|
57 |
) -> dict[str, Any] | State:
|
58 |
"""
|
59 |
Compute the equation of state (EOS) for the given atoms and calculator.
|
|
|
78 |
A dictionary containing the EOS data, bulk modulus, equilibrium volume, and equilibrium energy if successful. Otherwise, a prefect state object.
|
79 |
"""
|
80 |
|
81 |
+
state = OPT(
|
|
|
|
|
|
|
|
|
|
|
82 |
atoms=atoms,
|
83 |
calculator_name=calculator_name,
|
84 |
calculator_kwargs=calculator_kwargs,
|
|
|
112 |
atoms = relaxed.copy()
|
113 |
atoms.set_cell(c0 * f, scale_atoms=True)
|
114 |
|
115 |
+
future = OPT.submit(
|
116 |
atoms=atoms,
|
117 |
calculator_name=calculator_name,
|
118 |
calculator_kwargs=calculator_kwargs,
|
|
|
138 |
atoms = relaxed.copy()
|
139 |
atoms.set_cell(c0 * f, scale_atoms=True)
|
140 |
|
141 |
+
state = OPT(
|
142 |
atoms=atoms,
|
143 |
calculator_name=calculator_name,
|
144 |
calculator_kwargs=calculator_kwargs,
|
pyproject.toml
CHANGED
@@ -4,7 +4,7 @@ build-backend="flit_core.buildapi"
|
|
4 |
|
5 |
[project]
|
6 |
name="mlip-arena"
|
7 |
-
version="0.0.
|
8 |
authors=[
|
9 |
{name="Yuan Chiang", email="[email protected]"},
|
10 |
]
|
@@ -21,37 +21,33 @@ keywords=[
|
|
21 |
classifiers=[
|
22 |
"Development Status :: 1 - Planning",
|
23 |
"Programming Language :: Python",
|
|
|
24 |
"Programming Language :: Python :: 3.11",
|
25 |
"Programming Language :: Python :: 3.12",
|
26 |
"Programming Language :: Python :: 3 :: Only",
|
27 |
]
|
28 |
dependencies=[
|
29 |
"ase",
|
|
|
30 |
"torch",
|
31 |
-
"torch_dftd>=0.4.0",
|
32 |
"huggingface_hub",
|
33 |
"datasets",
|
34 |
-
"torch-geometric",
|
35 |
"safetensors",
|
36 |
-
"
|
37 |
-
]
|
38 |
-
|
39 |
-
[project.optional-dependencies]
|
40 |
-
run = [
|
41 |
-
"prefect>=3.0.4,<3.1.0",
|
42 |
"prefect-dask",
|
43 |
"dask",
|
44 |
"dask_jobqueue",
|
45 |
"tables",
|
46 |
]
|
|
|
|
|
47 |
app = [
|
48 |
"streamlit==1.38.0",
|
49 |
"plotly",
|
50 |
-
"bokeh==2.4.3",
|
51 |
-
"statsmodels"
|
52 |
]
|
53 |
test = [
|
54 |
"torch==2.2.0",
|
|
|
55 |
"nvidia-ml-py==12.560.30",
|
56 |
"e3nn==0.5.0",
|
57 |
"matgl==1.1.2",
|
@@ -65,11 +61,11 @@ test = [
|
|
65 |
"mattersim==1.0.0rc9",
|
66 |
"pytest",
|
67 |
"pytest-xdist",
|
68 |
-
"prefect
|
69 |
"pymatgen@git+https://github.com/chiang-yuan/pymatgen" # hotfix for deprecated pymatgen property https://github.com/materialsproject/pymatgen/pull/4242
|
70 |
]
|
71 |
mace = [
|
72 |
-
"mace-torch==0.3.
|
73 |
]
|
74 |
deepmd = [
|
75 |
"deepmd-kit@git+https://github.com/deepmodeling/[email protected]"
|
|
|
4 |
|
5 |
[project]
|
6 |
name="mlip-arena"
|
7 |
+
version="0.0.1a2"
|
8 |
authors=[
|
9 |
{name="Yuan Chiang", email="[email protected]"},
|
10 |
]
|
|
|
21 |
classifiers=[
|
22 |
"Development Status :: 1 - Planning",
|
23 |
"Programming Language :: Python",
|
24 |
+
"Programming Language :: Python :: 3.10",
|
25 |
"Programming Language :: Python :: 3.11",
|
26 |
"Programming Language :: Python :: 3.12",
|
27 |
"Programming Language :: Python :: 3 :: Only",
|
28 |
]
|
29 |
dependencies=[
|
30 |
"ase",
|
31 |
+
"pymatgen",
|
32 |
"torch",
|
|
|
33 |
"huggingface_hub",
|
34 |
"datasets",
|
|
|
35 |
"safetensors",
|
36 |
+
"prefect>3.1.0",
|
|
|
|
|
|
|
|
|
|
|
37 |
"prefect-dask",
|
38 |
"dask",
|
39 |
"dask_jobqueue",
|
40 |
"tables",
|
41 |
]
|
42 |
+
|
43 |
+
[project.optional-dependencies]
|
44 |
app = [
|
45 |
"streamlit==1.38.0",
|
46 |
"plotly",
|
|
|
|
|
47 |
]
|
48 |
test = [
|
49 |
"torch==2.2.0",
|
50 |
+
"torch_dftd==0.4.0",
|
51 |
"nvidia-ml-py==12.560.30",
|
52 |
"e3nn==0.5.0",
|
53 |
"matgl==1.1.2",
|
|
|
61 |
"mattersim==1.0.0rc9",
|
62 |
"pytest",
|
63 |
"pytest-xdist",
|
64 |
+
"prefect==3.1.11",
|
65 |
"pymatgen@git+https://github.com/chiang-yuan/pymatgen" # hotfix for deprecated pymatgen property https://github.com/materialsproject/pymatgen/pull/4242
|
66 |
]
|
67 |
mace = [
|
68 |
+
"mace-torch==0.3.9",
|
69 |
]
|
70 |
deepmd = [
|
71 |
"deepmd-kit@git+https://github.com/deepmodeling/[email protected]"
|
tests/test_eos.py
CHANGED
@@ -9,15 +9,13 @@ from mlip_arena.models import MLIPEnum
|
|
9 |
from mlip_arena.tasks.eos import run as EOS
|
10 |
|
11 |
|
12 |
-
@flow
|
13 |
def single_eos_flow(calculator_name, concurrent=True, cache=False):
|
14 |
atoms = bulk("Cu", "fcc", a=3.6)
|
15 |
|
16 |
-
|
17 |
refresh_cache=not cache,
|
18 |
-
)
|
19 |
-
|
20 |
-
return EOS_(
|
21 |
atoms=atoms,
|
22 |
calculator_name=calculator_name,
|
23 |
calculator_kwargs={},
|
@@ -32,7 +30,6 @@ def single_eos_flow(calculator_name, concurrent=True, cache=False):
|
|
32 |
max_abs_strain=0.1,
|
33 |
npoints=6,
|
34 |
concurrent=concurrent,
|
35 |
-
cache_opt=cache
|
36 |
)
|
37 |
|
38 |
|
|
|
9 |
from mlip_arena.tasks.eos import run as EOS
|
10 |
|
11 |
|
12 |
+
@flow(persist_result=True)
|
13 |
def single_eos_flow(calculator_name, concurrent=True, cache=False):
|
14 |
atoms = bulk("Cu", "fcc", a=3.6)
|
15 |
|
16 |
+
return EOS.with_options(
|
17 |
refresh_cache=not cache,
|
18 |
+
)(
|
|
|
|
|
19 |
atoms=atoms,
|
20 |
calculator_name=calculator_name,
|
21 |
calculator_kwargs={},
|
|
|
30 |
max_abs_strain=0.1,
|
31 |
npoints=6,
|
32 |
concurrent=concurrent,
|
|
|
33 |
)
|
34 |
|
35 |
|