mdanalysis icon indicating copy to clipboard operation
mdanalysis copied to clipboard

`NoJump` transformation fails in a non intuitive way when applied outside of the first frame

Open IAlibay opened this issue 9 months ago • 2 comments

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())

IAlibay avatar Feb 14 '25 20:02 IAlibay

Please assign me this issue.

TejasNangru avatar Feb 16 '25 15:02 TejasNangru

@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.

orbeckst avatar Feb 17 '25 23:02 orbeckst