Skip to content

Commit

Permalink
clean2d fixed for bondless molecules.
Browse files Browse the repository at this point in the history
  • Loading branch information
stsouko committed Mar 3, 2021
1 parent 43bb98a commit ababd3b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CGRtools/algorithms/calculate2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ def clean2d(self):
xn, yn = plane[n]
xm, ym = plane[m]
bonds.append(sqrt((xm - xn) ** 2 + (ym - yn) ** 2))
bond_reduce = sum(bonds) / len(bonds) / .825
if bonds:
bond_reduce = sum(bonds) / len(bonds) / .825
else:
bond_reduce = 1.

self_plane = self._plane
for n, (x, y) in plane.items():
Expand Down

0 comments on commit ababd3b

Please sign in to comment.