Skip to content

Automatically reindex and align phases to a common origin - #359

Draft
tjlane wants to merge 1 commit into
codex/phase-alignment-08-phase-datafrom
codex/phase-alignment-09-align-api
Draft

Automatically reindex and align phases to a common origin#359
tjlane wants to merge 1 commit into
codex/phase-alignment-08-phase-datafrom
codex/phase-alignment-09-align-api

Conversation

@tjlane

@tjlane tjlane commented Aug 22, 2026

Copy link
Copy Markdown
Member

! This PR was vibe-coded.

Stack

Part 9 of 11 for #31. Depends on #358. Merge bottom-up.

Next branch: codex/phase-alignment-10-alignment-options.

What this implements

Adds OriginShiftCandidate, PhaseAlignmentResult, and the first public align_phases() orchestration. It validates two isomorphous merged DataSets, automatically performs correlation reindexing when the moving metric admits an ambiguity, searches only symmetry-allowed origins, applies the selected Phenix-sign shift to a copy, and returns ranked diagnostics.

Tests

End-to-end tests cover three real space-group fixtures, automatic P 61 reindexing before origin fitting, exact phase recovery, the Phenix sign convention, result types, and nonmutation.

Reviewer focus

  • The reindex-first control flow and the no-reindex path.
  • The boundary between the reindexing result and residual origin search.
  • The public result model and Phenix-sign behavior.

Related: #31 and #174.

@tjlane tjlane changed the title Add public phase-alignment orchestration Automatically reindex and align phases to a common origin Aug 24, 2026
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.

1 participant