Skip to content

Commit

Permalink
fixed pyacemdmaker
Browse files Browse the repository at this point in the history
  • Loading branch information
BryantLi-BLI committed Jul 29, 2024
1 parent cb72028 commit 29bcbc2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/atomate2/forcefields/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ class MLFF(Enum): # TODO inherit from StrEnum when 3.11+
CHGNet = "CHGNet"
Forcefield = "Forcefield" # default placeholder option
Nequip = "Nequip"
Pyace = "Pyace"
9 changes: 2 additions & 7 deletions src/atomate2/forcefields/md.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,10 +397,5 @@ def _calculator(self) -> Calculator:
class PyACEMDMaker(ForceFieldMDMaker):
"""Perform an MD run with PACE."""

name: str = "Py-ACE MD"
force_field_name: str = "Py-ACE"

def _calculator(self) -> Calculator:
import pyace

return pyace.PyACECalculator(**self.calculator_kwargs)
name: str = f"{MLFF.Pyace} MD"
force_field_name: str = f"{MLFF.Pyace}"
5 changes: 5 additions & 0 deletions src/atomate2/forcefields/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,11 @@ def ase_calculator(calculator_meta: str | dict, **kwargs: Any) -> Calculator | N

calculator = NequIPCalculator.from_deployed_model(**kwargs)

elif calculator_name == MLFF.Pyace:
import pyace

calculator = pyace.PyACECalculator(**kwargs)

elif isinstance(calculator_meta, dict):
calc_cls = MontyDecoder().decode(json.dumps(calculator_meta))
calculator = calc_cls(**kwargs)
Expand Down

0 comments on commit 29bcbc2

Please sign in to comment.