Skip to content

Commit 9ea4806

Browse files
committed
Fix trajectory bounds logic in _get_trajectory_bounds to correctly interpret -1 as the last frame
1 parent 927d1aa commit 9ea4806

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

CodeEntropy/entropy.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,11 @@ def _get_trajectory_bounds(self):
247247
Tuple of (start, end, step) frame indices.
248248
"""
249249
start = self._args.start or 0
250-
end = self._args.end or -1
250+
end = (
251+
len(self._universe.trajectory) - 1
252+
if self._args.end == -1
253+
else self._args.end
254+
)
251255
step = self._args.step or 1
252256

253257
return start, end, step

0 commit comments

Comments
 (0)