Fix typo in _calculateBeta: check nb1 instead of nb2 twice (#9202)

The non-terminal bond filter checked len(nb2) > 1 for both atoms,
ignoring nb1 entirely. This could include bonds with a terminal
begin-atom when computing dmax for torsion weights.
This commit is contained in:
EvaSnow
2026-03-25 20:57:04 -07:00
committed by GitHub
parent d90a73aa6b
commit b56f3dc68a

View File

@@ -392,7 +392,7 @@ def _calculateBeta(mol, distmat, aid1):
for b in mol.GetBonds():
nb1 = _getHeavyAtomNeighbors(b.GetBeginAtom())
nb2 = _getHeavyAtomNeighbors(b.GetEndAtom())
if len(nb2) > 1 and len(nb2) > 1:
if len(nb1) > 1 and len(nb2) > 1:
bonds.append(b)
# get shortest distance
dmax = 0