Fixing an off by one indexing error when slicing trajectories.#87
Merged
harryswift01 merged 5 commits intomainfrom May 9, 2025
Merged
Conversation
harryswift01
requested changes
May 7, 2025
Member
harryswift01
left a comment
There was a problem hiding this comment.
This is a great fix for the slicing bug - it now correctly captures the full range of specified frames. The only small thing to tidy up is the length of the help string. Splitting it across multiple lines would keep it consistent with the rest of the code. Other than that, everything looks great!
harryswift01
approved these changes
May 8, 2025
Member
harryswift01
left a comment
There was a problem hiding this comment.
This all looks good to go now, thank you for this fix.
harryswift01
added a commit
that referenced
this pull request
May 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is to fix errors when the slicing of trajectories occurs (MDAnalysis uses the end variable and then goes to frame end-1).
Changes
Adapting the end parameter to account for the whole trajectory as the default, but to give the expected frames and frame count when end is set to a positive integer.
Impact
This should give the correct results. In particular, it will avoid the problem of the dihedral angle appearing as 0 when there was a mismatch between the frames MDAnalysis included in the timesteps loop and the expected number of frames reducing the number of incorrect peaks in the histograms for the conformational entropy.