duartegroup / autodE

automated reaction profile generation
https://duartegroup.github.io/autodE/
MIT License
173 stars 52 forks source link

SMILES input -> molecule bug #307

Closed asterlingchem closed 1 year ago

asterlingchem commented 1 year ago

Describe the bug 'InvalidSmilesString' exceptions raised for C1C/C=C\C=C/CC/C=C\1

To Reproduce

import autode as ade mol = ade.Molecule(name='mol', smiles='C1C/C=C\C=C/CC/C=C\1')

Expected behavior Should generate a molecule object for ((1Z,3Z,7Z)-cyclodeca-1,3,7-triene)

Environment

Additional context

image
t-young31 commented 1 year ago

Who needs that many double bonds in a ring?! 😉

Thanks – @asterlingchem, definitely a bug.

t-young31 commented 1 year ago

Thanks – @asterlingchem, definitely a bug.

Actually.. maybe not. You need to tell Python that it's a raw string to prevent interpreting \1 as a byte. The following works ok

import autode as ade
mol = ade.Molecule(name='mol', smiles=r'C1C/C=C\C=C/CC/C=C\1')
asterlingchem commented 1 year ago

Thanks @t-young31 – silly me!