rdkit: Chem.ResonanceMolSupplier freezes/hangs


Describe the bug While running:

from rdkit import Chem
mol = Chem.MolFromSmiles('COc1cc(-c2ccc(-[n+]3nc(-c4ccc([N+](=O)[O-])cc4)nn3-c3ccc([N+](=O)[O-])cc3)c(OC)c2)ccc1-[n+]1nc(-c2ccc([N+](=O)[O-])cc2)nn1-c1ccc([N+](=O)[O-])cc1')
resonance_mols = list(Chem.ResonanceMolSupplier(mol)) 

The ResonanceMolSupplier freezes.

To Reproduce run the code above.

Expected behavior Not freeze but return.

Configuration (please complete the following information):

  • RDKit version: 2023.3.1
  • OS: Windows 10
  • Python version (if relevant): 3.11
  • Are you using conda: yes
  • If you are using conda, which channel did you install the rdkit from? rdkit 2023.3.1 pypi_0 pypi

I don’t know if this is related to: #4884, #2597, #5406

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (5 by maintainers)

Most upvoted comments

This is still an issue in 2023.9.4

update:

  1. rdkit doesn’t freeze if the flag rdkit.Chem.rdchem.ResonanceFlags.UNCONSTRAINED_CATIONS is given
  2. the workaround above leads to incorrect (much fewer resoners) results given by ResonanceMolSupplier
  3. instead of the EmptyResonanceMolSupplierCallback workaround above, if rms.SetProgressCallback(None), rdkit seems better, ResonanceMolSupplier returns results after a couple of minutes. Very slow, but not completely frozen.

@simonmb I will fix this before next release.