pckroon / pysmiles

A lightweight python-only library for reading and writing SMILES strings
Apache License 2.0
147 stars 21 forks source link

Hypothesis overhaul #47

Open pckroon opened 2 months ago

pckroon commented 2 months ago

This PR completely overhauls the hypothesis tests to make it generate only chemically valid molecules. Note that chemically valid is a bit of a stretch, since c1cc-2ccc12 is considered valid. This makes the hypothesis tests much faster.

It uncovered some issues with the aromaticity code involving 0-order bonds and *-atoms. mark_aromatic_edges was way to aggressive in setting aromatic bond orders; it now only affects bonds that are in a cycle of aromatic atoms.