Skip to content

Commit c0c40dd

Browse files
committed
fix variable clash "dist" in zero_d_graph_to_molecule_graph() introduced in 7e0c8f4
1 parent cb2f490 commit c0c40dd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pymatgen/analysis/local_env.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3923,20 +3923,20 @@ def get_nn_data(self, structure: Structure, n: int, length=None):
39233923
for entry in nn:
39243924
r2 = _get_radius(entry["site"])
39253925
if r1 > 0 and r2 > 0:
3926-
dist = r1 + r2
3926+
diameter = r1 + r2
39273927
else:
39283928
warnings.warn(
39293929
"CrystalNN: cannot locate an appropriate radius, "
39303930
"covalent or atomic radii will be used, this can lead "
39313931
"to non-optimal results."
39323932
)
3933-
dist = _get_default_radius(structure[n]) + _get_default_radius(entry["site"])
3933+
diameter = _get_default_radius(structure[n]) + _get_default_radius(entry["site"])
39343934

39353935
dist = np.linalg.norm(structure[n].coords - entry["site"].coords)
39363936
dist_weight: float = 0
39373937

3938-
cutoff_low = dist + self.distance_cutoffs[0]
3939-
cutoff_high = dist + self.distance_cutoffs[1]
3938+
cutoff_low = diameter + self.distance_cutoffs[0]
3939+
cutoff_high = diameter + self.distance_cutoffs[1]
39403940

39413941
if dist <= cutoff_low:
39423942
dist_weight = 1

0 commit comments

Comments
 (0)