Skip to content

Split Conformational Analysis into Explicit Serial Phases#367

Merged
harryswift01 merged 2 commits into
mainfrom
363-split-conformational-analysis
Jun 16, 2026
Merged

Split Conformational Analysis into Explicit Serial Phases#367
harryswift01 merged 2 commits into
mainfrom
363-split-conformational-analysis

Conversation

@harryswift01

Copy link
Copy Markdown
Member

Summary

This PR refactors the existing serial conformational analysis into explicit phases without changing execution behaviour. The current two-pass conformational workflow is preserved, but the logic is now separated into clearer steps for angle collection, peak construction, state assignment, flexible-dihedral counting, and final output merging. This prepares the conformational analysis for a future chunked map-reduce implementation.

Changes

Split peak-identification workflow into explicit phases:

  • Extracted selected-frame dihedral angle collection into _collect_dihedral_angle_data(...).
  • Extracted histogram and peak construction into _build_peak_data(...).
  • Kept _identify_peaks(...) as a serial orchestration wrapper around the new phase helpers.
  • Added DihedralAngleData and DihedralPeakData containers to make intermediate phase outputs explicit.

Split state-assignment workflow into explicit phases:

  • Extracted group-level conformational state calculation into _calculate_group_state_data(...).
  • Extracted final accumulator merging into _merge_group_state_data(...).
  • Kept _assign_states(...) as a serial orchestration wrapper around the new phase helpers.
  • Added ConformationStateData to represent state labels and flexible-dihedral counts before final output construction.

Update atomic unit tests:

  • Updated dihedral unit tests to cover the new explicit serial phase boundaries.
  • Added tests for angle collection, peak construction, group state calculation, and final output merging.
  • Preserved existing behaviour tests for negative-angle wrapping, histogram peak detection, state assignment, progress handling, and frame-selection bounds.
  • Confirmed that unit and regression tests pass.

Impact

  • Makes the conformational analysis workflow easier to reason about and maintain.
  • Preserves the existing serial execution behaviour and scientific output.
  • Keeps the MDAnalysis frame-index contract unchanged: Dihedral.run(...) uses analysis-universe frame bounds, while results.angles is indexed locally from zero.
  • Creates clear internal phase boundaries that can later be mapped onto chunked serial execution and Dask-based map-reduce.
  • Avoids introducing chunking, Dask, scheduler logic, or public API changes in this PR.

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

@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 prep for further work on the parallel implementation. I will approve this on the basis that the cyclohexane regression test is looked at, since I will be at a conference the next two days and won't respond as quickly.

@harryswift01 harryswift01 merged commit 2cf219f into main Jun 16, 2026
65 of 67 checks passed
@harryswift01 harryswift01 deleted the 363-split-conformational-analysis branch June 16, 2026 15:42
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.

Split Conformational Analysis into Explicit Serial Phases

2 participants