Skip to content

Commit 5fd2aea

Browse files
committed
add structure catch ValueError for DefectSetup, to avoid future TransformationFW failures
1 parent 3e73aab commit 5fd2aea

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

atomate/vasp/firetasks/defects.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,8 @@ def get_charges_from_inter( inter_elt):
379379
chgdef_trans = ["DefectTransformation"]
380380
chgdef_trans_params = [{"scaling_matrix": supercell_size,
381381
"defect": defect_for_trans_param}]
382+
if structure != defect_for_trans_param.bulk_structure:
383+
raise ValueError("Defect bulk_structure is not the same as input structure.")
382384

383385
def_tag = "{}:{}_{}_{}atoms".format(structure.composition.reduced_formula,
384386
defect.name, charge, num_atoms)

0 commit comments

Comments
 (0)