Closed hainm closed 9 years ago
I'll start working on this based on your pycpptraj code and let you know when it is ready for testing.
great. thanks.
Hai
I've added the '-shared' flag to cpptraj configure and a 'libcpptraj' build target. Let me know if it works for you the way you expect. I think at some point we should look at what parts of cpptraj are really necessary for libcpptraj.so and perhaps build a more compact library (for example, do you really need the interactive prompt/readline stuff?). If you're going to the Amber meeting we can chat about it then.
I think at some point we should look at what parts of cpptraj are really necessary for libcpptraj.so and perhaps build a more compact library (for example, do you really need the interactive prompt/readline stuff?).
Another thing that would be great for libcpptraj... namespace(s)! Ideally, everything would be wrapped in a cpptraj
namespace.
I actually re-implemented NetCDFFile in C++ since the cpptraj version was tied to a number of base classes, and I didn't want to dodge names in the global namespace when I didn't know which names were already taken...
@mojyt : thanks. I just tested and it works well.
You're right that there are some parts of cpptraj that pycpptraj does need. pycpptraj use ipython and ipython-notebook so it can give help easily as long as I write docstring for methods/classes.
Unfortunately I won't join Amber meeting this spring. I will join Case' group on March and probably will discuss further with Jason. But let's keep in touch here.
Hai
my apologies for accidentally closing this.
A demonstration of pycpptraj with ipython-notebook (many more will come)
http://nbviewer.ipython.org/github/hainm/pycpptraj/blob/master/note-books/Frame_class.ipynb
Very nice! Let me know if you want me to mention this at the Amber meeting (send me a slide or something).
On Fri, Jan 30, 2015 at 2:07 PM, Hai Nguyen notifications@github.com wrote:
A demonstration of pycpptraj with ipython-notebook (many more will come)
http://nbviewer.ipython.org/github/hainm/pycpptraj/blob/master/note-books/Frame_class.ipynb
— Reply to this email directly or view it on GitHub https://github.com/mojyt/cpptraj/issues/3#issuecomment-72270391.
Daniel R. Roe, PhD Department of Medicinal Chemistry University of Utah 30 South 2000 East, Room 307 Salt Lake City, UT 84112-5820 http://home.chpc.utah.edu/~cheatham/ (801) 587-9652 (801) 585-6208 (Fax)
can you remind when is the meeting? Case mentioned once but I forgot.
Yes, I will send you a slide about pycpptraj. thanks.
Hai
Feb 13-16
On Fri, Jan 30, 2015 at 2:17 PM, Hai Nguyen notifications@github.com wrote:
can you remind when is the meeting? Case mentioned once but I forgot.
Yes, I will send you a slide about pycpptraj. thanks.
Hai
— Reply to this email directly or view it on GitHub https://github.com/mojyt/cpptraj/issues/3#issuecomment-72271777.
Daniel R. Roe, PhD Department of Medicinal Chemistry University of Utah 30 South 2000 East, Room 307 Salt Lake City, UT 84112-5820 http://home.chpc.utah.edu/~cheatham/ (801) 587-9652 (801) 585-6208 (Fax)
You meant something like "cpptraj.Frame"? (Currently I am using _Frame for cpptraj class and Frame for pycpptraj)
It's good idea. Thx.
Hai
On Jan 30, 2015, at 1:25 PM, Jason Swails notifications@github.com wrote:
I think at some point we should look at what parts of cpptraj are really necessary for libcpptraj.so and perhaps build a more compact library (for example, do you really need the interactive prompt/readline stuff?).
Another thing that would be great for libcpptraj... namespace(s)! Ideally, everything would be wrapped in a cpptraj namespace.
I actually re-implemented NetCDFFile in C++ since the cpptraj version was tied to a number of base classes, and I didn't want to dodge names in the global namespace when I didn't know which names were already taken...
— Reply to this email directly or view it on GitHub.
Sorry it's taken me awhile to get back here. This looks great, Hai -- this interface is much simpler and really helps get out of the way. The next step will be to make installation easier (and incorporate it into AmberTools -- we can work on that when you join Dave's group in March).
To make it easier for people to start using now, I would suggest looking into conda (from Continuum IO). It's like pip, but actually works with packages that have compiled dependencies.
thanks @swails
The installation is very simple if people use pre-shipped cpptraj version in pycpptraj github. Currently pycpptraj only works with development version of cpptraj (v15.22b). @mojyt significantly change cpptraj code recently (like excluding FrameList class in Action class) and this break my codes. I am still working on making compat with different versions.
Using binstar for hosting pycpptraj and installing with conda is in my plan too. Thanks.
Hai
I am still working on making compat with different versions.
What's the motivation behind supporting multiple versions? I think this is going to be a significant maintenance challenge as long as the cpptraj API remains so fluid, so my suggestion would be to target a single version.
you'r right.
Hai
Up until this point, the only program that has made use of the cpptraj API was cpptraj itself (so it wasn't really an API under certain definitions). Perhaps now that pycpptraj is using it, @mojyt will commit a bit more to stabilizing the API.
On another note -- what do you think about the name "pytraj" instead of "pycpptraj"? Just like cpptraj is a C++ version of ptraj, pytraj can be a Python version? Just a thought
that's name is great. "pycpptraj" is very long name for me too.
I will change its name to pytraj
in next cpptraj version when Dan finish changing his interface.
Hai
This name was taken
This name was taken
I don't know that this is necessarily a problem. This pytraj has 1 contributor, is stale (hasn't had a commit to it in about a year), is in a different field, and isn't on PyPI (so it's not pip-installable).
Note:
[swails@Robin ~/src/openmm/wrappers/python/simtk/openmm/app (gbn-chk) ]$ pip search pytraj
PyTrajectory - Python library for trajectory planning.
IMO, the name is yours for the taking.
Also, the trend for Python packages on Github seems to be
So what do you think about changing the group of pytraj from hainm to pytraj, so the Github repo would be something like:
http://github.com/pytraj/pytraj
? That would even further help you stake your claim to the name :)
Perhaps now that pycpptraj is using it, @mojyt will commit a bit more to stabilizing the API.
@swails A stable API? In Amber? Never!
Honestly this has always been my goal, but then I come across some functionality which requires me to revamp the old headers. In the case that @hainm mentioned the FrameList class went away because reference coordinates became a COORDS-type data set. I think this is cool because it allows actions to modify reference coordinates (e.g. you could center/rms fit them after they are loaded) as well as create reference coordinates (e.g. the 'average' action can do this now, so things can be used in one run without going through disk IO).
However, you're right that if any sort of real development is going to happen with cpptraj, the API needs to stabilize at some point. As a stopgap for now, @hainm do you have a simple pycpptraj test case included with your download? If so that may help me to recognize when changes I make break pycpptraj, so I can e.g. not put those changes in github etc.
@swails yes, I would love to change my personal github' name to something more common so people can collaborate.
(and will register pytraj in pypi asap. :D)
@mojyt: I do have tests cases but the problem is that I can not compile Cython code with your new code. (like Cython need to read cpptraj header files to link to libcpptraj.so, (FrameList.h does not exist anymore)).
So currently there are somethings I need to do first:
Let me know if anything I need to add to this TODO list.
Hai
In my defense, I said "stabilizing", not "stable" :). In the past, there was no barrier to 'breaking' an API that was only used by the program the API was written for, even if it was only a cosmetic improvement that made you feel better about some aspect of your code.
I think cpptraj is still young enough -- and its use as an API especially so -- that it's too early to commit to a truly stable API -- I have ambitions at some point to use cpptraj as a trajectory writing back-end to OpenMM tools I write in C++ (cpptraj can be powerful in this respect), but its use in those kinds of projects would necessitate putting all of cpptraj's classes and helper functions into a namespace to avoid trampling the global namespace (every MD-based program and their mother has a Vec3
class, for instance).
Namespaces aren't as important in py(cpp)traj, though, since its use as an extension I think provides an effective namespace that separates it from any Python names. What I'm not sure about is what happens when someone tries to use cpptraj and numpy in the same session -- will there be any name collisions there? The sander API suffers from the same thing (especially in Fortran), but there's not much I can do about that.
If so that may help me to recognize when changes I make break pycpptraj, so I can e.g. not put those changes in github etc.
I think there are too few of us to support divergent codes. Here's my idea -- pycpptraj and cpptraj development should occur more or less together. The tests can help Dan decide whether or not a particular API break is worth the improvement that comes with it. If it is, he can push it and raise an issue on the pytraj Github issue tracker saying what broke (and hints on how to fix, maybe).
I think a good goal is to get pycpptraj shipped with AmberTools 15 such that cpptraj and pytraj are compatible with each other in that release. People that want to live on the cutting edge then have to manage their versions accordingly.
This is an awesome project with great potential, IMO, and a big win for Amber. I'd also especially like to be able to hook ParmEd in here, too, but that's something I can work out the details with Hai later.
new home:
@swails thanks for suggesting to use conda. Now people can install pytraj + libcpptraj to linux-64 with different python versions in just <30 seconds. So nice.
Hai
That's why they wrote conda in the first place :)
I am going to release pycpptraj-0.1 and will include in AMBER in near future. It's really great if you can add option to install libcpptraj for dynamic link.
Thanks
Hai