[gmx-developers] Python interface for Gromacs

Roland Schulz roland at utk.edu
Sat Mar 28 09:26:18 CET 2009


On Sat, Mar 28, 2009 at 2:49 AM, <jhaas at gwdg.de> wrote:

> Hi all,
>
> > I was aware of pymacs but I wanted something which is pythonic from the
> > interface.
> YAA - Yet Another Approach:
>
> I am using the boost.python libraries for python export (on a C++ project
> though,) and despite some complexity in the error messages usage is
> straightforward:

I think for C++ boost.python is one of the best approaches. IMHO together
with sip followed by swig.

> Also I wanted something which doesn't generate any dependencies and
> doesn't
> > add any complexity to the makefile.
> That is a very good point, though I never used ctypes, at a first glance
> your code looks straightforward.
> I assume the difference is that ctypes calls functions from a library and
> swig/boost.python approaches allow access to global variables, ie allowing
> to construct a python shell for gmx as such?

This is true. You can't access global variables.


> are there any cross-platform issues? it seems to run smoothly on OS X,
> linux and windows systems...

not that I know of.

>
> >This is why I chose to use ctypes.
> >
> > How many functions did you wrap with swig? Would it really be much more
> work
> > to do it with ctypes? Can you upload you lib somewhere so we can take a
> look
> > at the interface? The problem with the libs, I have seen so far which
> have
> > been wrapped with swig, is that they keep the C interface. I think you
> only
> > have half the advantage of using python if the interface is still C-like.
> I
> one definitely should be able to do the usual python iterating through
> lists (and list comprehension) without needing to write an explicit export
> function

Who shouldn't have to write it? The user of ther wrapper or the wrapper
author?


Roland


-- 
ORNL/UT Center for Molecular Biophysics cmb.ornl.gov
865-241-1537, ORNL PO BOX 2008 MS6309
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20090328/2444abf5/attachment.html>


More information about the gromacs.org_gmx-developers mailing list