Skip to content

Trajectory Slicing#316

Merged
skfegan merged 6 commits intomainfrom
309-trajectory-slicing
Apr 17, 2026
Merged

Trajectory Slicing#316
skfegan merged 6 commits intomainfrom
309-trajectory-slicing

Conversation

@skfegan
Copy link
Copy Markdown
Member

@skfegan skfegan commented Apr 17, 2026

Summary

This pull request fixes the trajectory slicing and some conformational entropy bugs.

Changes

Trajectory Slicing

  • in entropy/workflows.py: The build_reduced_universe function now selects frames (according to user set start/end/step) so the reduced universe only contains the requested frames and not all frames.
  • in levels: The force/torque accumulation, conformational states builder, and neighbor finding all iterate over every frame in the reduced universe.

Looping Over Molecules

  • in levels/dihedrals.py: The get_dihedrals function is called for every molecule as the code is looping over the molecules to ensure that the MDAnalysis.Dihedrals function is getting the data from the desired molecule while building the histograms and assigning states.

Counting Flexible Dihedrals

  • in levels/dihedrals.py: While the histograms for identifying peaks are built with data from the whole group, the counting of flexible dihedrals is done one molecule at a time.

Tests

  • Unit tests updated to reflect the changes in the looping over molecules
  • Regression test baselines updated

Impact

  • The trajectory slicing now correctly chooses the frames selected by the user.
  • The code runs faster when choosing a small subset of frames, because the dihedral analysis and neighbor finding are not using all the frames in the trajectory.
  • The looping over molecules ensures it is getting data from all molecules in the group improving sampling over the group.

Copy link
Copy Markdown
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.

Happy to approve this PR. The code is now more efficiently selecting frames when users specify reduced universe scenarios. This has the knock on effect of improving run times, for both this type of run and also for testing. Also bundled in this PR is a number of smaller fixes for conformational entropy sampling. The changes look good, code looks good, please merge

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The changes here are part of the fix for trajectory slicing. Code looks clean and completes the job efficiently

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Updated conformational methods to reflect the change to frame counting specification

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Updated to reflect changes to frame counting

@jimboid
Copy link
Copy Markdown
Member

jimboid commented Apr 17, 2026

@harryswift01 I do note here that one test is failing and discussions with @skfegan reveal they all work on her local machine so we should look at this when you return from vacation if there is something making this different on CI. Also I note there is significant ping-pong of paths and various user metrics going on in the baselines which adds noise to PRs. We should aim to standardise these as much as possible and only change them when the important numbers are changed.

@skfegan skfegan changed the title 309 trajectory slicing Trajectory Slicing Apr 17, 2026
@skfegan skfegan merged commit f2e0e7c into main Apr 17, 2026
22 of 23 checks passed
@skfegan skfegan deleted the 309-trajectory-slicing branch April 17, 2026 14:43
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.

[Bug]: Looping over molecules [Bug]: Trajectory Slicing for Conformational States and Orientational Neighbors

2 participants