Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ResonanceMolSupplier can fail with small maxStructs values #3041

Closed
greglandrum opened this issue Mar 27, 2020 · 2 comments
Closed

ResonanceMolSupplier can fail with small maxStructs values #3041

greglandrum opened this issue Mar 27, 2020 · 2 comments
Assignees
Labels
Milestone

Comments

@greglandrum
Copy link
Member

Here are a couple of examples:

In [3]: from rdkit import Chem 
   ...: mol = Chem.MolFromSmiles('CC(C)C(C(=O)OC(C#N)c1cccc(Oc2ccccc2)c1)c3ccc(OC(F)F)cc3') 
   ...: len(Chem.ResonanceMolSupplier(mol, Chem.KEKULE_ALL, maxStructs = 5))                                                
Out[3]: 5

In [4]: len(Chem.ResonanceMolSupplier(mol, Chem.KEKULE_ALL, maxStructs = 3))                                                
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-4-67b3948cbeb1> in <module>
----> 1 len(Chem.ResonanceMolSupplier(mol, Chem.KEKULE_ALL, maxStructs = 3))

RuntimeError: idx = 0, d_ceVect.size() = 0

In [5]: mol = Chem.MolFromSmiles('c1cccnc1CCc1ccncc1')                                                                      

In [6]: len(Chem.ResonanceMolSupplier(mol, Chem.KEKULE_ALL, maxStructs = 3))                                                
Out[6]: 3

In [7]: len(Chem.ResonanceMolSupplier(mol, Chem.KEKULE_ALL, maxStructs = 2))                                                
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-7-1973ad78917d> in <module>
----> 1 len(Chem.ResonanceMolSupplier(mol, Chem.KEKULE_ALL, maxStructs = 2))

RuntimeError: idx = 0, d_ceVect.size() = 0

In [8]: len(Chem.ResonanceMolSupplier(mol, Chem.KEKULE_ALL, maxStructs = 3))                                                
Out[8]: 3

@ptosco ptosco self-assigned this Mar 27, 2020
@ptosco
Copy link
Contributor

ptosco commented Mar 27, 2020

@greglandrum I'll have a look later today or tomorrow.

@greglandrum
Copy link
Member Author

Thanks @ptosco

ptosco added a commit to ptosco/rdkit that referenced this issue Mar 29, 2020
- added a couple of missing const
- added a test for maxStructs
@greglandrum greglandrum added this to the 2020_03_2 milestone Apr 1, 2020
greglandrum pushed a commit that referenced this issue May 8, 2020
- added a couple of missing const
- added a test for maxStructs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants