Skip to content

Commit 61720bb

Browse files
committed
more robust handling of JDFTXOutfile forces (copy from handling of stress)
1 parent 474bd5e commit 61720bb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/atomate2/jdftx/schemas/calculation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ def from_jdftxoutput(
158158
The output document.
159159
"""
160160
optimized_structure: Structure = jdftxoutput.structure
161-
forces = jdftxoutput.forces.tolist() if hasattr(jdftxoutput, "forces") else None
161+
if hasattr(jdftxoutput, "forces"):
162+
forces = None if jdftxoutput.forces is None else jdftxoutput.forces.tolist()
162163
if hasattr(jdftxoutput, "stress"):
163164
stress = None if jdftxoutput.stress is None else jdftxoutput.stress.tolist()
164165
else:

0 commit comments

Comments
 (0)