duartegroup / autodE

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

SMILES input -> molecule bug #307

Closed asterlingchem closed 9 months ago

asterlingchem commented 9 months 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 9 months ago

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

Thanks – @asterlingchem, definitely a bug.

t-young31 commented 9 months 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 9 months ago

Thanks @t-young31 – silly me!