diff --git a/dpdata/abacus/relax.py b/dpdata/abacus/relax.py index cce64b853..1ba975edd 100644 --- a/dpdata/abacus/relax.py +++ b/dpdata/abacus/relax.py @@ -157,7 +157,7 @@ def get_coords_from_log(loglines, natoms): # transfer bohrium to angstrom cells *= bohr2ang coords *= bohr2ang - + if len(stress) > 0: virial = np.zeros([len(cells), 3, 3]) for i in range(len(cells)): @@ -206,7 +206,7 @@ def get_frame(fname): data["coords"] = coords data["energies"] = energy data["forces"] = force - if virial != None: + if virial is not None: data["virials"] = virial data["stress"] = stress data["orig"] = np.zeros(3)