From b56f3dc68af96230dc2f6406daedcce203870746 Mon Sep 17 00:00:00 2001 From: EvaSnow <10635420+evasnow1992@users.noreply.github.com> Date: Wed, 25 Mar 2026 20:57:04 -0700 Subject: [PATCH] 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. --- rdkit/Chem/TorsionFingerprints.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rdkit/Chem/TorsionFingerprints.py b/rdkit/Chem/TorsionFingerprints.py index d0a28f23d..9a7241f40 100644 --- a/rdkit/Chem/TorsionFingerprints.py +++ b/rdkit/Chem/TorsionFingerprints.py @@ -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