[OpenBabel-Devel] Convenience functions

2017-02-25 Thread Noel O'Boyle
Hi there, As some of you know, I would like to remove all convenience functions from classes in Open Babel. I would like to explain why. It's hard to exactly define a convenience function, but it's an addition to the API that is implemented entirely using existing API calls and that makes it eas

Re: [OpenBabel-Devel] Convenience functions

2017-02-25 Thread Maciek Wójcikowski
Hi Noel, I agree with you and must say that in 99.99% of cases it's the right way to do. Although I still believe the convenient functions, especially the ones that loop over stuff, are extremely useful when called from Python - they are just so much faster. I'd be happy with some external place w

Re: [OpenBabel-Devel] Convenience functions

2017-02-25 Thread Stefano Forli
Hi Noel, I'm in, too. Spotting these convoluted approaches may be a great opportunity to identify places where the API should be streamlined. About the PDB atom name, unfortunately I don't fully understand the performance issue implied in my suggestion, but from an interface point of view, it se

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

Re: [OpenBabel-Devel] Convenience functions

2017-02-25 Thread Geoffrey Hutchison
> About the PDB atom name, unfortunately I don't fully understand the > performance issue implied in my suggestion, but from an interface point of > view, it seems more intuitive to access an atom property from OBAtom instead > of going back to the OBResidue (and pass the OBAtom). The OBAtom sh

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 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