diff --git a/source/train/calculator.py b/source/train/calculator.py index 37fb7ad412..de439c3f78 100644 --- a/source/train/calculator.py +++ b/source/train/calculator.py @@ -42,10 +42,13 @@ def __init__(self, model, label="DP", type_dict=None, **kwargs): def calculate(self, atoms=None, properties=["energy", "forces", "stress"], system_changes=all_changes): coord = atoms.get_positions().reshape([1, -1]) - cell = atoms.get_cell().reshape([1, -1]) + if sum(atoms.get_pbc())>0: + cell = atoms.get_cell().reshape([1, -1]) + else: + cell = None symbols = atoms.get_chemical_symbols() atype = [self.type_dict[k] for k in symbols] - e, f, v = self.dp.eval(coord, cell, atype) + e, f, v = self.dp.eval(coords=coord, cells=cell, atom_types=atype) self.results['energy'] = e[0] self.results['forces'] = f[0] self.results['stress'] = v[0]