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

Drawing query atoms containing an AND query raises an exception #5006

Closed
ptosco opened this issue Feb 13, 2022 · 0 comments · Fixed by #5007
Closed

Drawing query atoms containing an AND query raises an exception #5006

ptosco opened this issue Feb 13, 2022 · 0 comments · Fixed by #5007
Labels
Milestone

Comments

@ptosco
Copy link
Contributor

ptosco commented Feb 13, 2022

Describe the bug
Originally reported by Mark Mackey: https://www.mail-archive.com/rdkit-discuss@lists.sourceforge.net/msg10958.html

To Reproduce
Type the following in a Jupyter Notebook:

Chem.MolFromSmarts("[c,nH1]")
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
/scratch/toscopa1/.conda/envs/pyds_v0.9L/lib/python3.8/site-packages/IPython/core/formatters.py in __call__(self, obj)
    343             method = get_real_method(obj, self.print_method)
    344             if method is not None:
--> 345                 return method()
    346             return None
    347         else:

~/install/rdkit_github/StructureRenderer/lib/python3.8/site-packages/rdkit/Chem/Draw/IPythonConsole.py in _toPNG(mol)
    229     highlightAtoms = []
    230   kekulize = kekulizeStructures
--> 231   return Draw._moltoimg(mol, molSize, highlightAtoms, "", returnPNG=True, kekulize=kekulize,
    232                         drawOptions=drawOptions)
    233 

~/install/rdkit_github/StructureRenderer/lib/python3.8/site-packages/rdkit/Chem/Draw/__init__.py in _moltoimg(mol, sz, highlights, legend, returnPNG, drawOptions, **kwargs)
    479                        highlightBonds=bondHighlights)
    480     else:
--> 481       d2d.DrawMolecule(mc, legend=legend or "", highlightAtoms=highlights or [])
    482     d2d.FinishDrawing()
    483     if returnPNG:

ValueError: bad query type1

Expected behavior
An exception should not be raised

Screenshots
If applicable, add screenshots to help explain your problem.

Configuration (please complete the following information):

  • RDKit version: 2021.09.4
@ptosco ptosco added the bug label Feb 13, 2022
@ptosco ptosco mentioned this issue Feb 13, 2022
@greglandrum greglandrum added this to the 2021_09_5 milestone Feb 14, 2022
greglandrum pushed a commit that referenced this issue Feb 14, 2022
…5006) (#5007)

Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
nigel-palmer-cresset pushed a commit to cresset-group/rdkit that referenced this issue Feb 14, 2022
greglandrum pushed a commit that referenced this issue Mar 5, 2022
…5006) (#5007)

Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
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