Amber-MD / pytraj

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

iterload prints error messages when told to load empty trajectory #1462

Closed pindakaas42 closed 6 years ago

pindakaas42 commented 6 years ago

For API consistency it can be nice to be able to load an empty slice of a trajectory. The desired action is performed but an error is printed:

import pytraj as pt from pytraj.testing import get_fn fn, tn = get_fn('ala3') traj = pt.iterload(fn, tn, frame_slice=(0,0))

pindakaas42 commented 6 years ago

Although the empty trajectories seem to cause lots of problems everywhere. Using above trajectory, for example: pt.distance(traj[0:0], '@1 @2') where pt.distance(traj[0:0], '@1 @2')

hainm commented 6 years ago

thanks for your suggestion.

hainm commented 6 years ago

Although the empty trajectories seem to cause lots of problems everywhere.

seems that the [0:0] is rarely (and should not be) used.

hainm commented 6 years ago

I close this issue for above reason. Thanks @pindakaas42 again for your suggestion. Do feel free to open other issues. Cheers.