Skip to content

Commit 5f4f57b

Browse files
committed
Take inputs of both Molecule and Structure
1 parent 0ae388e commit 5f4f57b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/atomate2/forcefields/jobs.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from pathlib import Path
2828

2929
from ase.calculators.calculator import Calculator
30-
from pymatgen.core.structure import Structure
30+
from pymatgen.core.structure import Molecule, Structure
3131

3232
logger = logging.getLogger(__name__)
3333

@@ -149,15 +149,15 @@ def __post_init__(self) -> None:
149149

150150
@forcefield_job
151151
def make(
152-
self, structure: Structure, prev_dir: str | Path | None = None
152+
self, structure: Molecule | Structure, prev_dir: str | Path | None = None
153153
) -> ForceFieldStructureTaskDocument | ForceFieldMoleculeTaskDocument:
154154
"""
155155
Perform a relaxation of a structure using a force field.
156156
157157
Parameters
158158
----------
159-
structure: .Structure
160-
pymatgen structure.
159+
structure: .Structure or Molecule
160+
pymatgen structure or molecule.
161161
prev_dir : str or Path or None
162162
A previous calculation directory to copy output files from. Unused, just
163163
added to match the method signature of other makers.

src/atomate2/forcefields/md.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from pathlib import Path
2727

2828
from ase.calculators.calculator import Calculator
29-
from pymatgen.core.structure import Structure
29+
from pymatgen.core.structure import Molecule, Structure
3030

3131

3232
@dataclass
@@ -133,15 +133,15 @@ def __post_init__(self) -> None:
133133
)
134134
def make(
135135
self,
136-
structure: Structure,
136+
structure: Molecule | Structure,
137137
prev_dir: str | Path | None = None,
138138
) -> ForceFieldStructureTaskDocument | ForceFieldMoleculeTaskDocument:
139139
"""
140140
Perform MD on a structure using forcefields and jobflow.
141141
142142
Parameters
143143
----------
144-
structure: .Structure
144+
structure: .Structure or Molecule
145145
pymatgen structure.
146146
prev_dir : str or Path or None
147147
A previous calculation directory to copy output files from. Unused, just

0 commit comments

Comments
 (0)