Skip to content

Commit 387938d

Browse files
authored
Merge pull request #772 from tschaume/patch-extract-from-calcs-reversed
check for obj_key
2 parents 43298db + 27eae8a commit 387938d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

atomate/vasp/database.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ def extract_from_calcs_reversed(obj_key):
132132
# remove the big object from all calcs_reversed
133133
# this can catch situations were the drone added the data to more than one calc.
134134
for i_calcs in range(len(task_doc["calcs_reversed"])):
135-
del task_doc["calcs_reversed"][i_calcs][obj_key]
135+
if obj_key in task_doc["calcs_reversed"][i_calcs]:
136+
del task_doc["calcs_reversed"][i_calcs][obj_key]
136137
return calcs_r_data
137138

138139
# drop the data from the task_document and keep them in a separate dictionary (big_data_to_store)

0 commit comments

Comments
 (0)