Skip to content

Commit

Permalink
Round min image distance to avoid tiny mismatches causing breaks (e.g…
Browse files Browse the repository at this point in the history
…. 9.9995 being flagged as less than 10 Å)
  • Loading branch information
kavanase committed Nov 20, 2024
1 parent 79846ea commit ff26850
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion doped/generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1423,7 +1423,9 @@ def __init__(
if not generate_supercell: # re-order bulk supercell to match that of input supercell
self.bulk_supercell = reorder_s1_like_s2(self.bulk_supercell, self.structure)

self.min_image_distance = supercells.get_min_image_distance(self.bulk_supercell)
# get and round (to avoid tiny mismatches, due to rounding in search functions,
# flagging issues) min image distance of supercell:
self.min_image_distance = np.round(supercells.get_min_image_distance(self.bulk_supercell), 3)

# check that generated supercell is greater than ``min_image_distance``` Å in each direction:
if self.min_image_distance < specified_min_image_distance and self.generate_supercell:
Expand Down

0 comments on commit ff26850

Please sign in to comment.