Re: [OpenBabel-Devel] GetIdx vs GetId vs GetIndex

2011-11-10 Thread My Th
C , 2011-11-10 17:35 -0500, Igor Filippov [Contr] rakstīja:
> > Or they could participate in the prerelease testing which now is
> > done by devs only, AFAIK.
> 
> I was participating in building/testing from svn before one of the
> releases in the past, spent quite a bit of time and effort only to
> discover that the release differed from what was in the svn snapshot
> so
> significantly that my testing was mostly useless.

Have to be careful to test the right branch (not master), then it should
be ok. And follow the changes during testing as the issues are fixed.

> > Otherwise it's not really possible to guarantee no breakages when
> the
> > build system and library changes, but developers are not really
> using
> > all platforms.
> 
> I know... I was just hoping the build system is stabilized on cmake at
> this point and there are not great changes in how plugins are compiled
> when going for a minor point update (2.3.0->2.3.1).

I don't think there is a major change in plugin compilation, but have to
wait for the resolution for your issue to tell where the problem is. The
build system with cmake is good in my opinion, but it is not static
since it's maintained and developed along with the library, so some
breakage can happen.


Reinis


--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel


Re: [OpenBabel-Devel] GetIdx vs GetId vs GetIndex

2011-11-10 Thread Igor Filippov [Contr]

> The only solution I'm seeing for this is testing. Maybe it would be
> worthwhile to make ar release candidate before the actual release and
> give a week for people willing to test the build to iron out all build
> issues. 
> 
This would be ideal. I think I was even asking for it at some point a
couple of years ago.

> Or they could participate in the prerelease testing which now is
> done by devs only, AFAIK.

I was participating in building/testing from svn before one of the
releases in the past, spent quite a bit of time and effort only to
discover that the release differed from what was in the svn snapshot so
significantly that my testing was mostly useless.


> Otherwise it's not really possible to guarantee no breakages when the
> build system and library changes, but developers are not really using
> all platforms.

I know... I was just hoping the build system is stabilized on cmake at
this point and there are not great changes in how plugins are compiled
when going for a minor point update (2.3.0->2.3.1).

Igor


--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel


Re: [OpenBabel-Devel] GetIdx vs GetId vs GetIndex

2011-11-10 Thread Craig A. James
On 11/10/11 1:39 PM, Chris Morley wrote:
> On 10/11/2011 17:40, Igor Filippov [Contr] wrote:
>>
>>> The confusion caused by too much choice and the deficiencies in all of
>>> the above mean that MolCore API (the proposed re-writing of the central
>>> part of the toolkit) deserves better. I am pushing for no atom indexes
>>> at all, and only one way for a user to reference an atom - a sort of
>>> atom pointer which remains valid whatever you do to the molecule. It is
>>> also an iterator that can be can be incremented in various interesting
>>> ways.
>>
>> I don't want to be a naysayer but I think it's a horrible idea.
>> I've had numerous problems with the current implementation of atom/bond
>> iterators, if they are going to remain the only way to loop through
>> atoms/bonds it will be very difficult if not impossible to manipulate
>> OBMol to the degree that I need.

What's the harm in allowing array access?  I don't see how it complicates the 
API.  It's just a matter of good documentation and nice example programs to 
illustrate proper use.

Arrays are one of the oldest and still one of the best data structures in 
computer science for two simple reasons: they're extremely fast, and they're 
easy to use.  They're fast because the architecture of modern CPUs supports 
offset operations at the nanosecond time scale, and they're easy to use because 
it's a simple data structure.

Algorithms that manipulate a molecular graph often have to access atoms with 
O(N^2) and sometimes higher-order loops.  These loops often don't access the 
atoms sequentially, so an iterator is useless.

By eliminating direct indexing, you're just forcing programmers to waste 
valuable CPU cycles building their own arrays and using an iterator to fill 
those arrays.  That's a huge waste of CPU cycles and will dramatically slow 
OpenBabel's performance, especially considering that somewhere under the covers 
the atoms and bonds are probably in an array already.

The only thing wrong with the original atom IDX was that it started with 1 
instead of zero.  That's fixed now, and hopefully the old 1-based index will be 
deprecated at some point.

Craig

--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel


Re: [OpenBabel-Devel] GetIdx vs GetId vs GetIndex

2011-11-10 Thread My Th
C , 2011-11-10 17:04 -0500, Igor Filippov [Contr] rakstīja:
> > Solving the problems with static builds and MinGW, which I suspect
> are 
> > are of interest to a minority of users, really needs input from a 
> > developer who is using these features. Do you know of anyone willing
> to 
> > help?
> > 
> There were two emails on the list so far - from Ernst-George and
> myself
> - on this subject. I think it's an important problem, but I'm of
> course
> judging from my own POV only.
> 
> If you search the archives a bit further back it's a recurring theme
> with every update. I was hoping it was resolved once and for all with
> 2.3.0 but 2.3.1 broke things again :(

The only solution I'm seeing for this is testing. Maybe it would be
worthwhile to make ar release candidate before the actual release and
give a week for people willing to test the build to iron out all build
issues. Or they could participate in the prerelease testing which now is
done by devs only, AFAIK.

Otherwise it's not really possible to guarantee no breakages when the
build system and library changes, but developers are not really using
all platforms.


Reinis


--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel


Re: [OpenBabel-Devel] GetIdx vs GetId vs GetIndex

2011-11-10 Thread Igor Filippov [Contr]
Chris,

> I hope you don't mind a harmless drudge getting some relaxation by 
> speculating on what might be in a new program (not the next version of 
> OB).
Absolutely, no problem!
I hope you will also forgive a harmless wish to keep things operational,
even for "a minority of users" :)


>  As well as the difficulties with manipulating molecules in OB 
> implied above, I also am irked by having to use bonds when what I need 
> are connections and having to remember in what order you construct, 
> specify and incorporate atoms and bonds. I would be interested to hear 
> of what features of the iterators you do not like.
It was some time ago that I tried it, so my recollection might be hazy.
I believe it was impossible to get from AtomIter to OBAtom, and the
former does not allow the same level of access.
The examples from the API documentation were not always working and the
documentation regarding the iterators was very paltry.

I'm not an expert but with STL iterators it's trivial to dereference an
iterator to get the real object, with AtomIter it was impossible.
Perhaps the situation changed since then.

> Solving the problems with static builds and MinGW, which I suspect are 
> are of interest to a minority of users, really needs input from a 
> developer who is using these features. Do you know of anyone willing to 
> help?
> 
There were two emails on the list so far - from Ernst-George and myself
- on this subject. I think it's an important problem, but I'm of course
judging from my own POV only.

If you search the archives a bit further back it's a recurring theme
with every update. I was hoping it was resolved once and for all with
2.3.0 but 2.3.1 broke things again :(

Igor


--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel


Re: [OpenBabel-Devel] GetIdx vs GetId vs GetIndex

2011-11-10 Thread Chris Morley
On 10/11/2011 17:40, Igor Filippov [Contr] wrote:
>
>> The confusion caused by too much choice and the deficiencies in all of
>> the above mean that MolCore API (the proposed re-writing of the central
>> part of the toolkit) deserves better. I am pushing for no atom indexes
>> at all, and only one way for a user to reference an atom - a sort of
>> atom pointer which remains valid whatever you do to the molecule. It is
>> also an iterator that can be can be incremented in various interesting
>> ways.
>
> I don't want to be a naysayer but I think it's a horrible idea.
> I've had numerous problems with the current implementation of atom/bond
> iterators, if they are going to remain the only way to loop through
> atoms/bonds it will be very difficult if not impossible to manipulate
> OBMol to the degree that I need.
>
> I would urge leaving things that work well enough alone and concentrate
> on fixing stuff that's broken - for example 2.3.1 broke static
> compilation on OSX and MinGW yet again, I haven't heard back any
> comments regarding that.

I hope you don't mind a harmless drudge getting some relaxation by 
speculating on what might be in a new program (not the next version of 
OB). As well as the difficulties with manipulating molecules in OB 
implied above, I also am irked by having to use bonds when what I need 
are connections and having to remember in what order you construct, 
specify and incorporate atoms and bonds. I would be interested to hear 
of what features of the iterators you do not like.

I'll try to put up a demo of the AtomPtr idea soon, so that there can be 
more focused criticism.

Solving the problems with static builds and MinGW, which I suspect are 
are of interest to a minority of users, really needs input from a 
developer who is using these features. Do you know of anyone willing to 
help?

Chris


--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel


Re: [OpenBabel-Devel] GetIdx vs GetId vs GetIndex

2011-11-10 Thread Igor Filippov [Contr]

> The confusion caused by too much choice and the deficiencies in all of 
> the above mean that MolCore API (the proposed re-writing of the central 
> part of the toolkit) deserves better. I am pushing for no atom indexes 
> at all, and only one way for a user to reference an atom - a sort of 
> atom pointer which remains valid whatever you do to the molecule. It is 
> also an iterator that can be can be incremented in various interesting 
> ways.

I don't want to be a naysayer but I think it's a horrible idea.
I've had numerous problems with the current implementation of atom/bond
iterators, if they are going to remain the only way to loop through
atoms/bonds it will be very difficult if not impossible to manipulate
OBMol to the degree that I need.

I would urge leaving things that work well enough alone and concentrate
on fixing stuff that's broken - for example 2.3.1 broke static
compilation on OSX and MinGW yet again, I haven't heard back any
comments regarding that.


Igor


--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel


Re: [OpenBabel-Devel] GetIdx vs GetId vs GetIndex

2011-11-10 Thread David Lonie
On Thu, Nov 10, 2011 at 12:13 PM, Chris Morley  wrote:
> On 10/11/2011 15:35, David Lonie wrote:
> The confusion caused by too much choice and the deficiencies in all of
> the above mean that MolCore API (the proposed re-writing of the central
> part of the toolkit) deserves better. I am pushing for no atom indexes
> at all, and only one way for a user to reference an atom - a sort of
> atom pointer which remains valid whatever you do to the molecule. It is
> also an iterator that can be can be incremented in various interesting
> ways.

Interesting -- I imagine there would still be an id, just no index? I
rather like the sound of that, if it proves practical. It would
certainly simplify things!

Dave

--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel


Re: [OpenBabel-Devel] GetIdx vs GetId vs GetIndex

2011-11-10 Thread Chris Morley
On 10/11/2011 15:35, David Lonie wrote:
>But I'm still confused as to why
> index and idx are both included in the API.

(Tim has just posted all this.)

idx is the original and still the most used and starts at 1. It changes 
if you delete an atom with a lower idx.

index starts at 0 (because really serious arrays do - and and to be 
consistent with the bond index).

id is unique within a molecule, and remains the same even after 
deletions. It is a number but but it is dangerous to increment it to get 
the next atom.

The confusion caused by too much choice and the deficiencies in all of 
the above mean that MolCore API (the proposed re-writing of the central 
part of the toolkit) deserves better. I am pushing for no atom indexes 
at all, and only one way for a user to reference an atom - a sort of 
atom pointer which remains valid whatever you do to the molecule. It is 
also an iterator that can be can be incremented in various interesting 
ways.

Chris

--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel


Re: [OpenBabel-Devel] GetIdx vs GetId vs GetIndex

2011-11-10 Thread David Lonie
On Thu, Nov 10, 2011 at 11:51 AM, Geoffrey Hutchison  wrote:
> On Nov 10, 2011, at 11:47 AM, My Th wrote:
>> The idea is to use everywhere zero-based indices in future [1], but the
>> library is in the state of transition, so there is quite a mess with
>> this. It's a task assigned to Geoff :)
> ...
>> But to fix all of that API change would be required.
>
> I'll be posting some thoughts about API changes and "Open Babel 3.0" shortly. 
> It's been an unfortunately exciting day at work, with a very hot server room.

Sorry to hear that -- hope everything gets under control soon.

I'm glad to hear that this is being fixed up -- I'll cast my vote for
a single zero-based size_t index ;-)

Dave

--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel


Re: [OpenBabel-Devel] GetIdx vs GetId vs GetIndex

2011-11-10 Thread Geoffrey Hutchison

On Nov 10, 2011, at 11:47 AM, My Th wrote:

> The idea is to use everywhere zero-based indices in future [1], but the
> library is in the state of transition, so there is quite a mess with
> this. It's a task assigned to Geoff :)
...
> But to fix all of that API change would be required.

I'll be posting some thoughts about API changes and "Open Babel 3.0" shortly. 
It's been an unfortunately exciting day at work, with a very hot server room.

-Geoff

---
Prof. Geoffrey Hutchison
Department of Chemistry
University of Pittsburgh
tel: (412) 648-0492
email: geo...@pitt.edu
web: http://hutchison.chem.pitt.edu/


--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel


Re: [OpenBabel-Devel] GetIdx vs GetId vs GetIndex

2011-11-10 Thread My Th
C , 2011-11-10 10:35 -0500, David Lonie rakstīja:
> On Thu, Nov 10, 2011 at 10:32 AM, David Lonie  wrote:
> > The reason I ask is that I'm trying to limit an OBFF calculation with
> > OBForceField::AddInt[er,ra]Group[s], which takes the atom index, but
> > it's not clear to me whether this means the index, the idx, or the id.
> 
> >From reading forcefieldmmff94.cpp, it looks like the group bitvectors
> actually use the idx, not the index. But I'm still confused as to why
> index and idx are both included in the API.

The idea is to use everywhere zero-based indices in future [1], but the
library is in the state of transition, so there is quite a mess with
this. It's a task assigned to Geoff :)

Also because of the mess with signed vs unsigned, there are quite a lot
of compiler warnings. I submitted patches for some of them in tracker a
while ago, but it seems to be forgotten again. But to fix all of that
API change would be required. Besides maybe using fore these something
like size_t would be more appropriate.


Reinis

[1] http://openbabel.org/wiki/Version_3.0_Projects


--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel


Re: [OpenBabel-Devel] GetIdx vs GetId vs GetIndex

2011-11-10 Thread David Lonie
Hi Tim,

First off, it's good to hear from you again :-) I'm glad you're still
active in the community.

On Thu, Nov 10, 2011 at 11:23 AM, Tim Vandermeersch
 wrote:
> On Thu, Nov 10, 2011 at 4:32 PM, David Lonie  wrote:
>> In atom.h, there are the following three functions:
>>
>>      //! \return the internal atom index (e.g., inside an OBMol)
>>      unsigned int GetIdx()           const { return((int)_idx);  }
>>      unsigned int GetIndex() const { return _idx - 1; }
>>      unsigned long GetId() const { return _id; }
>>
>> Can someone explain and/or document these in a bit more detail? I was
>> quite surprised that GetIdx and GetIndex are defined differently. What
>> is the role of _idx vs _id? Is there a reason that in GetIdx _idx is
>> cast from uint->int, then (implicitly) back to a uint?
>
> The idx is an atom index that goes from 1 to N (N = number of atoms).
> This is the _idx field and can be retreived using GetIdx().
>
> The index (GetIndex()) is also an atom index but starts from 0 (0 to
> N-1). This is the _idx - 1 field. This function was added for more
> conformance to the bond indexes which start from 0.
>
> The _id (GetId()) field is a unique id that does not change if atoms
> are deleted and can be to identify atoms during an OBMol's lifespan.
>
>> The reason I ask is that I'm trying to limit an OBFF calculation with
>> OBForceField::AddInt[er,ra]Group[s], which takes the atom index, but
>> it's not clear to me whether this means the index, the idx, or the id.
>
> You usually have to see at the specific code.

That is much clearer. I'll add this to the docs later today.

Thanks,
Dave

--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel


Re: [OpenBabel-Devel] GetIdx vs GetId vs GetIndex

2011-11-10 Thread Tim Vandermeersch
Hi,

On Thu, Nov 10, 2011 at 4:32 PM, David Lonie  wrote:
> Hi list,
>
> In atom.h, there are the following three functions:
>
>      //! \return the internal atom index (e.g., inside an OBMol)
>      unsigned int GetIdx()           const { return((int)_idx);  }
>      unsigned int GetIndex() const { return _idx - 1; }
>      unsigned long GetId() const { return _id; }
>
> Can someone explain and/or document these in a bit more detail? I was
> quite surprised that GetIdx and GetIndex are defined differently. What
> is the role of _idx vs _id? Is there a reason that in GetIdx _idx is
> cast from uint->int, then (implicitly) back to a uint?
>
> I also see:
>
> unsigned int   _idx; //!< unique node index (GetIdx(), SetIdx())
> unsigned long  _id; //!< unique id
>
> I'm not sure what the difference between these descriptions is either?

The idx is an atom index that goes from 1 to N (N = number of atoms).
This is the _idx field and can be retreived using GetIdx().

The index (GetIndex()) is also an atom index but starts from 0 (0 to
N-1). This is the _idx - 1 field. This function was added for more
conformance to the bond indexes which start from 0.

The _id (GetId()) field is a unique id that does not change if atoms
are deleted and can be to identify atoms during an OBMol's lifespan.

> The reason I ask is that I'm trying to limit an OBFF calculation with
> OBForceField::AddInt[er,ra]Group[s], which takes the atom index, but
> it's not clear to me whether this means the index, the idx, or the id.

You usually have to see at the specific code.

> Thanks in advance,
>
> Dave
>
> --
> RSA(R) Conference 2012
> Save $700 by Nov 18
> Register now
> http://p.sf.net/sfu/rsa-sfdev2dev1
> ___
> OpenBabel-Devel mailing list
> OpenBabel-Devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-devel
>

--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel


Re: [OpenBabel-Devel] GetIdx vs GetId vs GetIndex

2011-11-10 Thread David Lonie
Quick addition:

On Thu, Nov 10, 2011 at 10:32 AM, David Lonie  wrote:
> The reason I ask is that I'm trying to limit an OBFF calculation with
> OBForceField::AddInt[er,ra]Group[s], which takes the atom index, but
> it's not clear to me whether this means the index, the idx, or the id.

>From reading forcefieldmmff94.cpp, it looks like the group bitvectors
actually use the idx, not the index. But I'm still confused as to why
index and idx are both included in the API.

Dave

--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel