Amber-MD / pytraj

Python interface of cpptraj
https://amber-md.github.io/pytraj
170 stars 38 forks source link

pt.compute does not raise error when names appear more then once #1553

Closed pindakaas42 closed 4 years ago

pindakaas42 commented 4 years ago

I am often using pt.compute and i noticed that this:

import pytraj as pt
traj = pt.datafiles.load_tz2()
data = pt.compute(['rms myrms refindex 0 @CA','radgyr myrms @CA nomax','molsurf',], traj, ref=traj[3])

will not raise an error. But instead print an error message to the screen.

Catching the error on the library site is quite bad because this way pytraj silently fails, without me being alarmed about it.

hainm commented 4 years ago

I will consider it. Under the hood, above commands are cpptraj's commands and pytraj just sends them directly to cpptraj and retrieve the output from cpptraj. But you might be right. Let me see if it's easier to send the error from C++ to pytraj in this case to raise error earlier.

hainm commented 4 years ago

fixed in #1554

thanks @pindakaas42