Skip to content

Cache customised residue axes topology for frame covariance#375

Merged
harryswift01 merged 2 commits into
mainfrom
374-cache-customised-residue-axes-topology
Jun 24, 2026
Merged

Cache customised residue axes topology for frame covariance#375
harryswift01 merged 2 commits into
mainfrom
374-cache-customised-residue-axes-topology

Conversation

@harryswift01

Copy link
Copy Markdown
Member

Summary

This PR improves customised residue covariance performance by caching static residue axes-topology metadata before frame execution. The frame covariance loop can now reuse cached residue topology instead of repeatedly rediscovering the same heavy-atom, UA-mass, and neighbouring-bond information with MDAnalysis selections.

Changes

Cached residue axes topology:

  • Added residue-level topology metadata to the existing axes-topology cache.
  • Cached frame-independent residue data, including residue heavy atom indices, residue UA masses, and neighbouring-residue bond status.
  • Stored cached residue topology in shared_data["axes_topology"].

Cached residue axes execution path:

  • Added a cached residue axes method in AxesCalculator.
  • Updated FrameCovarianceNode to use cached residue topology when available.
  • Preserved the existing get_residue_axes(...) path as a fallback.
  • Kept frame-dependent values such as positions, centres of mass, axes, moments of inertia, forces, torques, and covariance matrices computed per frame.

Tests:

  • Added unit coverage for cached residue topology construction.
  • Added unit coverage for cached residue axes calculations.
  • Updated covariance-node tests to cover the cached residue path and fallback behaviour.

Impact

  • Reduces repeated MDAnalysis selection work inside the customised residue covariance path.
  • Improves performance for workflows using customised axes.
  • Keeps the optimisation scoped to residue axes topology only.
  • Preserves existing force, torque, covariance, entropy, Dask, and scheduling behaviour.
  • Maintains fallback behaviour when cached residue topology is unavailable.

@harryswift01 harryswift01 added this to the 2.3.0 milestone Jun 24, 2026
@harryswift01 harryswift01 self-assigned this Jun 24, 2026
@harryswift01 harryswift01 added the feature request New feature or request label Jun 24, 2026
@harryswift01 harryswift01 linked an issue Jun 24, 2026 that may be closed by this pull request
@harryswift01 harryswift01 requested a review from jimboid June 24, 2026 11:22

@jimboid jimboid left a comment

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.

More MDA performance optimisations. PR looks like it has all of the necessary changes to accompany the performance improvement based alterations.

@harryswift01 harryswift01 merged commit 008fbbc into main Jun 24, 2026
42 of 45 checks passed
@harryswift01 harryswift01 deleted the 374-cache-customised-residue-axes-topology branch June 24, 2026 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cache customised residue axes topology for frame covariance

2 participants