Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simple pytraj test for cpptraj #5

Closed
hainm opened this issue Feb 6, 2015 · 14 comments
Closed

simple pytraj test for cpptraj #5

hainm opened this issue Feb 6, 2015 · 14 comments

Comments

@hainm
Copy link
Contributor

hainm commented Feb 6, 2015

Hi @Mojyt

I've just finished updating pytraj to catch up with cpptraj-dev. Please following this to run the tests.

  1. export CPPTRAJHOME (pytraj will find the header files and libcpptraj in $CPPTRAJHOME/src and $CPPTRAJHOME/lib/)
  2. Install pytraj (work well with python2.7, 3.3, 3.4)
  3. add libcpptraj to LD_LIBRARY_PATH before running pytraj
  4. Run simple test
    • (from anywhere: python -c 'import pytraj; pytraj.run_tests()'
    • from pytraj root folder:
      • cd tests
      • python ./run_simple_test.py

Note: pytraj's compiling time (linking to libcpptraj.so) is currently few times slower than compiling libcpptraj. :D

Let me know if you have any question. thx.

Hai

@drroe
Copy link
Contributor

drroe commented Feb 6, 2015

On Fri, Feb 6, 2015 at 10:20 AM, Hai Nguyen notifications@github.com
wrote:

python setup.py install

Note that although this step checks for Cython (which is nice), it doesn't
check for python development libraries. There's a check in
$AMBERHOME/AmberTools/src/configure2 around line 2898 you can probably
borrow for this.

I've made some changes to cpptraj that will break your version, but I'm
going to fork pytraj and see if I can fix them so you don't have to before
I push to the cpptraj github. Until I run successfully I will leave github
cpptraj as-is. I'll keep you up to date.

Thanks for writing some tests - it will make our lives much easier!

-Dan

add libcpptraj to LD_LIBRARY_PATH before running pytraj
2.

Run simple test

(from anywhere: python -c 'import pytraj; pytraj.run_tests()'

from pytraj root folder:
- cd tests
- python ./run_simple_test.py

Note: pytraj's compiling time (linking to libcpptraj.so) is currently few
times slower than compiling libcpptraj. :D

Let me know if you have any question. thx.

Hai


Reply to this email directly or view it on GitHub
#5.


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)

@hainm
Copy link
Contributor Author

hainm commented Feb 6, 2015

  • " it doesn't check for python development libraries"
    --> Can you elaborate this? (travis has been testing pytraj code and I am not aware of this issue before)
  • I've made more than 100 test cases for pytraj. You can run all of them by:
    • cd tests
    • python ./RunAllAndFindFailure.py
      • log and output.txt are the results of running above test. You can grep "ERROR" or "FAIL" in log to check which tests are failed.
      • you can run individual test too (example: python ./test_Action_Strip.py)

Thanks for your help.

Hai

@swails
Copy link
Contributor

swails commented Feb 6, 2015

--> Can you elaborate this? (travis has been testing pytraj code and I am not aware of this issue before)

By default, most Linux operating systems do not come pre-installed with Python.h or libpython2.7.so. Obviously the Travis VMs do, since they are designed for testing these programs :). And really, Cython is just a glorified translator to go from Python-like syntax to CPython C-API C code, so you still need to have the Python development headers available to install it.

This package is usually called something like python-dev or python-devel (depending on your OS).

The sander API suffers from the same limitation -- if the Python development headers are absent, it simply cannot be built.

@hainm
Copy link
Contributor Author

hainm commented Feb 6, 2015

thx Jason.

Hai

@swails
Copy link
Contributor

swails commented Feb 6, 2015

To clarify -- this is probably unnecessary for the setup.py script in the pytraj Github repository. Anyone that wants to install and use pytraj will know they need the Python development headers. For inclusion with AmberTools, this check will be necessary, though.

@drroe
Copy link
Contributor

drroe commented Feb 6, 2015

On Fri, Feb 6, 2015 at 12:13 PM, Jason Swails notifications@github.com
wrote:

Anyone that wants to install and use pytraj will know they need the Python
development headers.

I think you give people too much credit. :-)

-Dan


Reply to this email directly or view it on GitHub
#5 (comment).


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)

@swails
Copy link
Contributor

swails commented Feb 6, 2015

Only when it means less work for me :).

In this case, though, I think anybody that comes to Github to get the pytraj source code so they can compile it knows full well that python-dev is required, or they will quickly find out without an error message from setup.py.

@drroe
Copy link
Contributor

drroe commented Feb 6, 2015

On Fri, Feb 6, 2015 at 11:41 AM, Daniel Roe daniel.r.roe@gmail.com wrote:

I've made some changes to cpptraj that will break your version, but I'm
going to fork pytraj and see if I can fix them so you don't have to before
I push to the cpptraj github. Until I run successfully I will leave github
cpptraj as-is. I'll keep you up to date.

OK, so this will be a bigger change than I thought. Recently I had to
refactor the way cpptraj handles coordinate metadata (i.e. do the coords
have velocity info, temperature, etc). The way I had handled this
previously was that the TrajectoryIO class would report this via separate
function calls, which would percolate up through the TrajectoryFile classes
and finally get stored in Topology during a trajectory run, so things like
Actions and output trajectories would know something about the coordinates.
This was fine when there were only a few pieces of metadata, but since more
have been added it made sense to me to encapsulate this information in a
new class (CoordinateInfo) which could be passed around as necessary,
meaning if we add a new piece of metadata (e.g. time values) we don't have
to modify several interfaces.

However, since this was a substantial interface change, it has now broken
things like Trajin.pyx and TrajectoryIO.pyx etc which relied on it. I have
forked over a copy of pytraj but it seems to me it might be easier for you
to make these changes. However, if you don't have the time I can take a
crack at it. The only reason I bring it up is I'm pretty much a python n00b.

So bottom line, I will try working on this unless I hear from you. If you
do want to work on it, these cpptraj changes are currently in the Amber GIT
master. I will not change the github version of cpptraj until it will work
with pytraj.

-Dan

Thanks for writing some tests - it will make our lives much easier!

-Dan

add libcpptraj to LD_LIBRARY_PATH before running pytraj
2.

Run simple test

(from anywhere: python -c 'import pytraj; pytraj.run_tests()'

from pytraj root folder:
- cd tests
- python ./run_simple_test.py

Note: pytraj's compiling time (linking to libcpptraj.so) is currently few
times slower than compiling libcpptraj. :D

Let me know if you have any question. thx.

Hai


Reply to this email directly or view it on GitHub
#5.


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)


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)

@hainm
Copy link
Contributor Author

hainm commented Feb 6, 2015

@Mojyt

  • Since I get used to read cpptraj code and have been working with Cython, I think I can keep catching your changes. So, I can do the changes myself. (I have not have access to Amber GIT yet, but James's helping downloading cpptraj).
  • BTW, I just saw "hdf5" in config.h (great +1)
  • Is there any easy way to add Frame object to CpptrajState? It seems to me that "AddTrajin" method of this class add trajectory from a file.

Ideally, pytraj user would do some actions with Frame objects, then will combine them into a class objects that CpptrajState can accept (for example using "AddFrame" method of DataSet_Coords_TRJ). CpptrajState would take care of "massive" action, analysis, output stuff ..
Current CpptrajState class only have "AddTrajin" from files.

If this is not easy, I can translate CpptrajState.cpp to Cython code. Let me know if I miss anything. thx.

Hai

@hainm
Copy link
Contributor Author

hainm commented Feb 6, 2015

@Mojyt
I've just finishing made change for my pytraj local code to be compatible with cpptraj in Amber git. All test cases are passed. I think you can push new changes to github now.

Hai

@drroe
Copy link
Contributor

drroe commented Feb 6, 2015

OK, pushed. Hopefully all goes well...

On Fri, Feb 6, 2015 at 3:37 PM, Hai Nguyen notifications@github.com wrote:

@Mojyt https://github.com/mojyt
I've just finishing made change for my pytraj local code to be compatible
with cpptraj in Amber git. All test cases are passed. I think you can push
new changes to github now.

Hai


Reply to this email directly or view it on GitHub
#5 (comment).


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)

@hainm
Copy link
Contributor Author

hainm commented Feb 7, 2015

@Mojyt: yes. went really well https://travis-ci.org/hainm/pytraj/builds/49823926

@swails
Copy link
Contributor

swails commented Feb 7, 2015

On Fri, Feb 6, 2015 at 10:03 PM, Hai Nguyen notifications@github.com
wrote:

@Mojyt https://github.com/mojyt: yes. went really well
https://travis-ci.org/hainm/pytraj/builds/49823926

​It looked like there were some failures (from the Travis-CI log):

55.81s$ python RunAllAndFindFailure.py
​​

​​
​​ File "./test_Trajout.py", line 63, in test_load
​​ File "pytraj/FrameArray.pyx", line 46, in
pytraj.FrameArray.FrameArray.cinit
(/home/travis/build/hainm/pytraj/pytraj/FrameArray.cpp:3065)
​ File "./test_Action_Strip.py", line 92, in test_1
​File "./test_alias_topology.py", line 13, in test_0

Is this expected?

​​

Jason M. Swails
BioMaPS,
Rutgers University
Postdoctoral Researcher

@hainm
Copy link
Contributor Author

hainm commented Feb 7, 2015

Hi, yes, this is unrelated to what Dan has changed. I made some changes to the code and forgot to commit.

Thanks
Hai

@hainm hainm closed this as completed Feb 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants