Spaces:
Running
Running
promote tasks up to module level
Browse files- mlip_arena/tasks/__init__.py +11 -1
- mlip_arena/tasks/md.py +1 -1
- mlip_arena/tasks/neb.py +2 -2
- tests/test_neb.py +2 -3
mlip_arena/tasks/__init__.py
CHANGED
@@ -6,7 +6,17 @@ from huggingface_hub import HfApi, HfFileSystem, hf_hub_download
|
|
6 |
from mlip_arena.models import MLIP
|
7 |
from mlip_arena.models import REGISTRY as MODEL_REGISTRY
|
8 |
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
REGISTRY = yaml.safe_load(f)
|
11 |
|
12 |
|
|
|
6 |
from mlip_arena.models import MLIP
|
7 |
from mlip_arena.models import REGISTRY as MODEL_REGISTRY
|
8 |
|
9 |
+
|
10 |
+
from .elasticity import run as ELASTICITY
|
11 |
+
from .eos import run as EOS
|
12 |
+
from .md import run as MD
|
13 |
+
from .neb import run as NEB
|
14 |
+
from .neb import run_from_endpoints as NEB_FROM_ENDPOINTS
|
15 |
+
from .optimize import run as OPT
|
16 |
+
|
17 |
+
__all__ = ["OPT", "EOS", "MD", "NEB", "NEB_FROM_ENDPOINTS", "ELASTICITY"]
|
18 |
+
|
19 |
+
with open(Path(__file__).parent / "registry.yaml", encoding="utf-8") as f:
|
20 |
REGISTRY = yaml.safe_load(f)
|
21 |
|
22 |
|
mlip_arena/tasks/md.py
CHANGED
@@ -202,7 +202,7 @@ def _generate_task_run_name():
|
|
202 |
def run(
|
203 |
atoms: Atoms,
|
204 |
calculator_name: str | MLIPEnum,
|
205 |
-
calculator_kwargs: dict | None,
|
206 |
dispersion: bool = False,
|
207 |
dispersion_kwargs: dict | None = None,
|
208 |
device: str | None = None,
|
|
|
202 |
def run(
|
203 |
atoms: Atoms,
|
204 |
calculator_name: str | MLIPEnum,
|
205 |
+
calculator_kwargs: dict | None = None,
|
206 |
dispersion: bool = False,
|
207 |
dispersion_kwargs: dict | None = None,
|
208 |
device: str | None = None,
|
mlip_arena/tasks/neb.py
CHANGED
@@ -167,11 +167,11 @@ def run(
|
|
167 |
|
168 |
|
169 |
@task(
|
170 |
-
name="NEB from
|
171 |
task_run_name=_generate_task_run_name,
|
172 |
cache_policy=TASK_SOURCE + INPUTS,
|
173 |
)
|
174 |
-
def
|
175 |
start: Atoms,
|
176 |
end: Atoms,
|
177 |
n_images: int,
|
|
|
167 |
|
168 |
|
169 |
@task(
|
170 |
+
name="NEB from endpoints",
|
171 |
task_run_name=_generate_task_run_name,
|
172 |
cache_policy=TASK_SOURCE + INPUTS,
|
173 |
)
|
174 |
+
def run_from_endpoints(
|
175 |
start: Atoms,
|
176 |
end: Atoms,
|
177 |
n_images: int,
|
tests/test_neb.py
CHANGED
@@ -2,8 +2,7 @@ import sys
|
|
2 |
|
3 |
import pytest
|
4 |
from mlip_arena.models import MLIPEnum
|
5 |
-
from mlip_arena.tasks
|
6 |
-
from mlip_arena.tasks.neb import run_from_end_points as NEB
|
7 |
from prefect.testing.utilities import prefect_test_harness
|
8 |
|
9 |
from ase.spacegroup import crystal
|
@@ -32,7 +31,7 @@ def test_neb(model: MLIPEnum):
|
|
32 |
"""
|
33 |
|
34 |
with prefect_test_harness():
|
35 |
-
result =
|
36 |
start=start.copy(),
|
37 |
end=end.copy(),
|
38 |
n_images=5,
|
|
|
2 |
|
3 |
import pytest
|
4 |
from mlip_arena.models import MLIPEnum
|
5 |
+
from mlip_arena.tasks import NEB_FROM_ENDPOINTS
|
|
|
6 |
from prefect.testing.utilities import prefect_test_harness
|
7 |
|
8 |
from ase.spacegroup import crystal
|
|
|
31 |
"""
|
32 |
|
33 |
with prefect_test_harness():
|
34 |
+
result = NEB_FROM_ENDPOINTS(
|
35 |
start=start.copy(),
|
36 |
end=end.copy(),
|
37 |
n_images=5,
|