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

DetectChemistryProblems fails with traceback when run on mols coming from aromatic SMARTS #7375

Closed
ricrogz opened this issue Apr 19, 2024 · 0 comments · Fixed by #7381
Closed
Labels
Milestone

Comments

@ricrogz
Copy link
Contributor

ricrogz commented Apr 19, 2024

Examples:

In [1]: Chem.DetectChemistryProblems(Chem.MolFromSmarts('c'))
[16:41:35] 

****
Pre-condition Violation
RingInfo not initialized
Violation occurred on line 52 in file /home/rodrigue/Documents/code/rdkit_builder/rdkit/Code/GraphMol/RingInfo.cpp
Failed Expression: df_init
****

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[1], line 1
----> 1 Chem.DetectChemistryProblems(Chem.MolFromSmarts('c'))

RuntimeError: Pre-condition Violation
	RingInfo not initialized
	Violation occurred on line 52 in file Code/GraphMol/RingInfo.cpp
	Failed Expression: df_init
	RDKIT: 2024.03.1
	BOOST: 1_81


In [2]: Chem.DetectChemistryProblems(Chem.MolFromSmarts('n'))
[16:42:07] 

****
Pre-condition Violation
RingInfo not initialized
Violation occurred on line 52 in file /home/rodrigue/Documents/code/rdkit_builder/rdkit/Code/GraphMol/RingInfo.cpp
Failed Expression: df_init
****

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[2], line 1
----> 1 Chem.DetectChemistryProblems(Chem.MolFromSmarts('n'))

RuntimeError: Pre-condition Violation
	RingInfo not initialized
	Violation occurred on line 52 in file Code/GraphMol/RingInfo.cpp
	Failed Expression: df_init
	RDKIT: 2024.03.1
	BOOST: 1_81


In [3]: Chem.DetectChemistryProblems(Chem.MolFromSmarts('a'))
[16:42:10] 

****
Pre-condition Violation
RingInfo not initialized
Violation occurred on line 52 in file /home/rodrigue/Documents/code/rdkit_builder/rdkit/Code/GraphMol/RingInfo.cpp
Failed Expression: df_init
****

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[3], line 1
----> 1 Chem.DetectChemistryProblems(Chem.MolFromSmarts('a'))

RuntimeError: Pre-condition Violation
	RingInfo not initialized
	Violation occurred on line 52 in file Code/GraphMol/RingInfo.cpp
	Failed Expression: df_init
	RDKIT: 2024.03.1
	BOOST: 1_81

But, surprisingly, it doesn't fail in this case:

In [4]: Chem.DetectChemistryProblems(Chem.MolFromSmarts('[#6&a]'))
Out[4]: ()
@ricrogz ricrogz added the bug label Apr 19, 2024
@ricrogz ricrogz mentioned this issue Apr 22, 2024
@greglandrum greglandrum added this to the 2024_03_3 milestone May 16, 2024
greglandrum pushed a commit that referenced this issue May 16, 2024
* check for ringinfo levels instead of init

* check for ring info in kekulizefragment

* add a test

* update tests

* update doctests

* revert ringinfo level checks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants