Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ torchsim-mace = [
]
# mattersim can be added to torchsim-generic once they clean their dependencies
torchsim-generic = [
"torch-sim-atomistic[fairchem,metatomic,nequip,orb,sevenn,symmetry]==0.6.2; python_version >= '3.12'"
"torch-sim-atomistic[fairchem,metatomic,nequip,orb,sevenn,symmetry]==0.6.2; python_version >= '3.12'",
"grace-runtime[torchsim]>=0.1.4; python_version >= '3.12'",
]
jdftx = ["pymatgen==2026.10.24"]
approxneb = ["pymatgen-analysis-diffusion>=2024.7.15"]
Expand Down
5 changes: 5 additions & 0 deletions src/atomate2/torchsim/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,11 @@ def pick_model(
)

match model_type:
case TorchSimModelType.GRACE:
from grace_runtime.torchsim import GRACERuntimeModel

base_model = GRACERuntimeModel(model=model_path, **model_kwargs)

case TorchSimModelType.FAIRCHEM:
from torch_sim.models.fairchem import FairChemModel

Expand Down
1 change: 1 addition & 0 deletions src/atomate2/torchsim/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class TorchSimModelType(StrEnum): # type: ignore[attr-defined]
"""Enum for model types."""

FAIRCHEM = "FairChemModel"
GRACE = "GraceModel"
MACE = "MaceModel"
MATTERSIM = "MatterSimModel"
METATOMIC = "MetatomicModel"
Expand Down
Binary file not shown.
1 change: 1 addition & 0 deletions tests/torchsim/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def _is_backend_missing(package_names: str | list[str]) -> bool:


_SKIP_FAIRCHEM = _is_backend_missing("fairchem-core")
_SKIP_GRACE = _is_backend_missing("grace-runtime")
_SKIP_MACE = _is_backend_missing("mace-torch")
_SKIP_MATTERSIM = _is_backend_missing("mattersim")
_SKIP_METATOMIC = _is_backend_missing(["metatomic_torchsim", "upet"])
Expand Down
7 changes: 7 additions & 0 deletions tests/torchsim/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

from .conftest import (
_SKIP_FAIRCHEM,
_SKIP_GRACE,
_SKIP_MACE,
_SKIP_MATTERSIM,
_SKIP_METATOMIC,
Expand Down Expand Up @@ -378,6 +379,12 @@ def test_pick_model_fairchem() -> None:
pick_model(TorchSimModelType.FAIRCHEM, model_path="uma-s-1p1")


@pytest.mark.skipif(_SKIP_GRACE, reason="grace-runtime is not installed.")
def test_pick_model_grace(test_dir) -> None:
path = f"{test_dir}/forcefields/grace/grace_1l_order3.npz"
pick_model(TorchSimModelType.GRACE, model_path=path)


@pytest.mark.skipif(_SKIP_MACE, reason="mace-torch is not installed.")
def test_pick_model_mace(test_dir) -> None:
path = f"{test_dir}/forcefields/mace/MACE.model"
Expand Down
Loading