mdanalysis
mdanalysis copied to clipboard
`NoJump` transformation fails in a non intuitive way when applied outside of the first frame
Expected behavior
NoJump should fail when applied outside of the first frame (at least it makes sense to me), but it should do so in a way that is a bit more informative.
Actual behavior
TypeError: unsupported operand type(s) for -: 'float' and 'NoneType'
Code to reproduce the behavior
import MDAnalysis as mda
from MDAnalysis.tests.datafiles import GRO, XTC
from MDAnalysis.transformations.nojump import NoJump
u = mda.Universe(GRO, XTC)
u.trajectory[-1]
u.trajectory.add_transformations(NoJump())
Please assign me this issue.
@TejasNangru you're very welcome to contribute a solution, please open a PR that references this issue. We don't normally assign open issues in advance. Just seeing the linked PR will direct reviewers to your work.