Skip to content

Conversation

@skfegan
Copy link
Member

@skfegan skfegan commented Apr 7, 2025

Summary

This PR is to fix an index issue that caused out of bounds errors when the start parameter for selecting a subset of frames from the trajectory was not zero.

Changes

In the get_matrices and assign_conformation functions where the code was looping over timesteps, changed from using timestep.frame to using an index that counts from the first timestep used rather than the frame number in the original trajectory (timestep_index = timestep.frame - start).

Impact

  • Reduces the number of IndexErrors raised

@skfegan skfegan requested review from harryswift01 and jimboid April 7, 2025 15:19
@skfegan skfegan linked an issue Apr 7, 2025 that may be closed by this pull request
Copy link
Contributor

@harryswift01 harryswift01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a nice way to ensure that the index issue is resolved to prevent out-of-bounds errors, I'm happy for this to be merged in.

Copy link
Member

@jimboid jimboid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks to have contained the bug affecting the timesteps. Looks like an elegant solution with concise code.

@skfegan skfegan merged commit 6cf11e5 into main Apr 8, 2025
5 of 6 checks passed
@skfegan skfegan deleted the 80-controlling-trajectory-size branch April 8, 2025 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Controlling trajectory size

4 participants