Skip to content

Commit ff26850

Browse files
committed
Round min image distance to avoid tiny mismatches causing breaks (e.g. 9.9995 being flagged as less than 10 Å)
1 parent 79846ea commit ff26850

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

doped/generation.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1423,7 +1423,9 @@ def __init__(
14231423
if not generate_supercell: # re-order bulk supercell to match that of input supercell
14241424
self.bulk_supercell = reorder_s1_like_s2(self.bulk_supercell, self.structure)
14251425

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

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

0 commit comments

Comments
 (0)