Skip to content

Commit

Permalink
fix zero_d_graph_to_molecule_graph() from variable name clash "dist" …
Browse files Browse the repository at this point in the history
…introduced in 7e0c8f4
  • Loading branch information
janosh committed Jan 25, 2024
1 parent cb2f490 commit 2120dde
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pymatgen/analysis/local_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -3923,20 +3923,20 @@ def get_nn_data(self, structure: Structure, n: int, length=None):
for entry in nn:
r2 = _get_radius(entry["site"])
if r1 > 0 and r2 > 0:
dist = r1 + r2
diameter = r1 + r2
else:
warnings.warn(
"CrystalNN: cannot locate an appropriate radius, "
"covalent or atomic radii will be used, this can lead "
"to non-optimal results."
)
dist = _get_default_radius(structure[n]) + _get_default_radius(entry["site"])
diameter = _get_default_radius(structure[n]) + _get_default_radius(entry["site"])

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

cutoff_low = dist + self.distance_cutoffs[0]
cutoff_high = dist + self.distance_cutoffs[1]
cutoff_low = diameter + self.distance_cutoffs[0]
cutoff_high = diameter + self.distance_cutoffs[1]

if dist <= cutoff_low:
dist_weight = 1
Expand Down

0 comments on commit 2120dde

Please sign in to comment.