PLUMED and Python

534 views
Skip to first unread message

Ondrej Marsalek

unread,
Sep 22, 2014, 5:00:09 PM9/22/14
to plumed...@googlegroups.com
Dear PLUMED developers,

I would like to use PLUMED from Python and would like to get your
input on the topic. Has any work been done in that direction? I see
that there is something for ASE and PLUMED 1.3, have there been any
updates for 2.x?

My tentative plan is to use Cython to wrap the C interface. I am very
much open to suggestions for alternatives. Would you be interested in
joining the work and/or in including the interface in PLUMED itself?

Thank you,
Ondrej

Giovanni Bussi

unread,
Sep 24, 2014, 10:26:23 AM9/24/14
to plumed...@googlegroups.com
Hi Ondrej,

I am not aware of any attempt with PLUMED 2 + python.

You can either wrap C or C++ interface. They are basically equivalent, the only advantage of the C++ one is that it takes care of initialization and finalization in constructor/destructor, so it could be slightly more user friendly.

I have very little experience with python so I cannot suggest the best route.

Thanks!

Giovanni



--
You received this message because you are subscribed to the Google Groups "PLUMED users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plumed-users...@googlegroups.com.
To post to this group, send email to plumed...@googlegroups.com.
Visit this group at http://groups.google.com/group/plumed-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/plumed-users/CAEgQLgvqYz92GA66%3DyV8dHD00xVrLSZVQFZvMM7wzD3m6FxQ8g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

davide branduardi

unread,
Sep 24, 2014, 10:41:34 AM9/24/14
to plumed...@googlegroups.com
Hi!
You might want to take inspiration from what Rosa Bulo did for plumed1, there is still her wrapper in the old package plumed1.3 that was meant to work with ASE.
Ciao
D

Ondrej Marsalek

unread,
Sep 25, 2014, 12:33:30 PM9/25/14
to plumed...@googlegroups.com
On Wed, Sep 24, 2014 at 10:25 AM, Giovanni Bussi
<giovann...@gmail.com> wrote:
> Hi Ondrej,
>
> I am not aware of any attempt with PLUMED 2 + python.
>
> You can either wrap C or C++ interface. They are basically equivalent, the
> only advantage of the C++ one is that it takes care of initialization and
> finalization in constructor/destructor, so it could be slightly more user
> friendly.

Seeing that the C++ API is a wrapper over the C one anyway, I will try
to do basically the same in Python.

I will post here once I have something to share.

Ondrej

Ondrej Marsalek

unread,
Sep 26, 2014, 4:41:01 PM9/26/14
to plumed...@googlegroups.com
I ended up using ctypes. Here is the pull request:

https://github.com/plumed/plumed2/pull/109

where I would like to ask for feedback on the code. It needs some
testing and polishing (including documentation), but the overall
structure is there. I hope that once it's finished, it can be included
in the code base.

Ondrej
Reply all
Reply to author
Forward
0 new messages