File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 2525 },
2626 "end" : {
2727 "type" : int ,
28- "help" : "Stop analysing the trajectory at this frame index" ,
28+ "help" : (
29+ "Stop analysing the trajectory at this frame index. This is "
30+ "the frame index of the last frame to be included, so for example"
31+ "if start=0 and end=500 there would be 501 frames analysed. The "
32+ "default -1 will include the last frame."
33+ ),
2934 "default" : - 1 ,
3035 },
3136 "step" : {
Original file line number Diff line number Diff line change @@ -127,13 +127,17 @@ def main():
127127 if step is None :
128128 step = 1
129129 # Count number of frames, easy if not slicing
130+ # MDAnalysis trajectory slicing only includes up to end-1
131+ # This works the way we want it to if the whole trajectory is being included
130132 if start == 0 and end == - 1 and step == 1 :
133+ end = len (u .trajectory )
131134 number_frames = len (u .trajectory )
132135 elif end == - 1 :
133136 end = len (u .trajectory )
134- number_frames = math .floor ((end - start ) / step ) + 1
137+ number_frames = math .floor ((end - start ) / step )
135138 else :
136- number_frames = math .floor ((end - start ) / step ) + 1
139+ end = end + 1
140+ number_frames = math .floor ((end - start ) / step )
137141 logger .debug (f"Number of Frames: { number_frames } " )
138142
139143 # Create pandas data frame for results
You can’t perform that action at this time.
0 commit comments