Re: [OpenBabel-Devel] Proposal to overhaul/replace OBElementTable

2017-02-25 Thread Noel O'Boyle
These days I've got a Python script that generates switch statements. On 25 Feb 2017 11:06 p.m., "Geoffrey Hutchison" wrote: > > 2. The GetAtomicNum() will be a compiled prefix tree using switch > > statements. Right now, if you ask what is the atomic number of Fermium > > (element 100), it will

Re: [OpenBabel-Devel] Proposal to overhaul/replace OBElementTable

2017-02-25 Thread David Hall
On Sat, Feb 25, 2017 at 6:06 PM, Geoffrey Hutchison < geoff.hutchi...@gmail.com> wrote: > > 2. The GetAtomicNum() will be a compiled prefix tree using switch > > statements. Right now, if you ask what is the atomic number of Fermium > > (element 100), it will do 100 string comparisons. > > Fair en

Re: [OpenBabel-Devel] Proposal to overhaul/replace OBElementTable

2017-02-25 Thread Geoffrey Hutchison
> 2. The GetAtomicNum() will be a compiled prefix tree using switch > statements. Right now, if you ask what is the atomic number of Fermium > (element 100), it will do 100 string comparisons. Fair enough - does it make sense to hand-write the switch statements, though? > 4. We can add an enum fo

[OpenBabel-Devel] Proposal to overhaul/replace OBElementTable

2017-02-24 Thread Noel O'Boyle
Hi there, The OBElementTable has some problems, and I propose a replacement. Conversion of element numbers to symbols and vice versa is one of the operations that should be optimal in a cheminf toolkit but is not currently. Here's what I propose: 1. No global etab is necessary, just a collection