Skip to content

Commit

Permalink
tiny fix
Browse files Browse the repository at this point in the history
  • Loading branch information
stefdoerr committed Oct 21, 2024
1 parent b521624 commit 8112973
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion moleculekit/atomselect/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def analyze(mol: Molecule, bonds, _profile=False):
masses.append(periodictable[el].mass)
masses = np.array(masses, dtype=np.float32)

if bonds.max() >= mol.numAtoms:
if len(bonds) and bonds.max() >= mol.numAtoms:
raise ValueError(
"Bonds array contains atoms which are not in the molecule. "
f"The maximum atom index in the bonds array is {bonds.max()} while the molecule contains {mol.numAtoms} atoms."
Expand Down

0 comments on commit 8112973

Please sign in to comment.