Skip to content

Commit c4269e0

Browse files
committed
add a check state for the calc for changing info
1 parent 1853050 commit c4269e0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

mace/calculators/mace.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,22 @@ def __init__(
315315
for param in model.parameters():
316316
param.requires_grad = False
317317

318+
def check_state(self, atoms, tol: float = 1e-15) -> list:
319+
"""
320+
Check for any system changes since the last calculation.
321+
322+
Args:
323+
atoms (ase.Atoms): The atomic structure to check.
324+
tol (float): Tolerance for detecting changes.
325+
326+
Returns:
327+
list: A list of changes detected in the system.
328+
"""
329+
state = super().check_state(atoms, tol=tol)
330+
if (not state) and (self.atoms.info != atoms.info):
331+
state.append("info")
332+
return state
333+
318334
def _create_result_tensors(
319335
self, model_type: str, num_models: int, num_atoms: int
320336
) -> dict:

0 commit comments

Comments
 (0)