Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CodeEntropy/config/arg_config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@
},
"end": {
"type": int,
"help": "Stop analysing the trajectory at this frame index",
"help": (
"Stop analysing the trajectory at this frame index. This is "
"the frame index of the last frame to be included, so for example"
"if start=0 and end=500 there would be 501 frames analysed. The "
"default -1 will include the last frame."
),
"default": -1,
},
"step": {
Expand Down
8 changes: 6 additions & 2 deletions CodeEntropy/main_mcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,17 @@ def main():
if step is None:
step = 1
# Count number of frames, easy if not slicing
# MDAnalysis trajectory slicing only includes up to end-1
# This works the way we want it to if the whole trajectory is being included
if start == 0 and end == -1 and step == 1:
end = len(u.trajectory)
number_frames = len(u.trajectory)
elif end == -1:
end = len(u.trajectory)
number_frames = math.floor((end - start) / step) + 1
number_frames = math.floor((end - start) / step)
else:
number_frames = math.floor((end - start) / step) + 1
end = end + 1
number_frames = math.floor((end - start) / step)
logger.debug(f"Number of Frames: {number_frames}")

# Create pandas data frame for results
Expand Down