Skip to content

Commit

Permalink
Add comment to explain how we ensure jumps on the second frame are ha…
Browse files Browse the repository at this point in the history
…ndled correctly by NoJump
  • Loading branch information
p-j-smith committed Aug 28, 2023
1 parent 0d51b3d commit 2a2d100
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions package/MDAnalysis/transformations/nojump.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ def _transform(self, ts):
msg = f"Periodic box dimensions are not invertible at step {ts.frame}"
raise NoDataError(msg)
if ts.frame == 0:
# We don't need to apply the transformation here. However, we need to ensure we
# have the 0th frame coordinates in reduced form. We also need to set an
# an appropriate value for self.older frame. This is so that on the following frame
# we don't return early when we check `self.older_frame != "A"`. If we return early,
# then the transformation is not applied, and any jumps across boundaries that occur
# at that frame will not be accounted for.
self.prev = ts.positions @ Linverse
self.old_frame = 0
self.older_frame = -1
Expand Down

0 comments on commit 2a2d100

Please sign in to comment.