I forgot to say that the background to all of this is that I was writing up
docs describing the handling of aromaticity in Open Babel, and when I got
to the section describing DeleteAtom() I found that the behaviour was not
how I thought.

- Noel

On 14 June 2018 at 07:03, Noel O'Boyle <baoille...@gmail.com> wrote:

> Hi all,
>
> I've sent in a pull request (https://github.com/openbabel/
> openbabel/pull/1847) regarding to DeleteAtom() and aromaticity, and Geoff
> asked me to bring it up here.
>
> Currently, when you delete an atom (to be exact, it's actually
> Begin/EndModify that I'm changing), the flag that indicates that
> aromaticity is detected is cleared. This means that the reported
> aromaticity on an atom or bond will always be in synch with the molecule's
> current structure.
>
> I propose to change this so that the aromaticity flag on the molecule is
> unaffected by deleting atoms (or indeed by any API call that involves
> Begin/EndModify).
>
> The reason I propose this is:
> (a) to make it obvious how the user can retain the original aromaticity if
> they wish, even after modifying the molecule (this is the main reason).
> With the current behavior, a user would never realise that aromaticity
> information is still present, or that they just need to set that it has
> been perceived (which is counter-intuitive).
> (b) to avoid unneccessary work (e.g.calling DeleteHydrogens should not
> invalidate aromaticity (if it currently does))
>
> I could also argue that it simplifies toolkit behavior a bit (only the
> user can invalidate aromaticity), but that's not really a reason for doing
> this, just a possible silver lining.
>
> I think this is a reasonably safe change because:
> (a) aromaticity is stored on atoms and bonds, rather than involving a data
> structure that retains pointers to atoms or bonds.
> (b) if the user does not wish this behavior, it should be fairly (?)
> obvious that it's happening, and there's a clear fix
>
> Regards,
> - Noel
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel

Reply via email to