Skip to content

Check when alternative indexing or origin shifts are possible - #351

Draft
tjlane wants to merge 1 commit into
mainfrom
codex/phase-alignment-01-ambiguities
Draft

Check when alternative indexing or origin shifts are possible#351
tjlane wants to merge 1 commit into
mainfrom
codex/phase-alignment-01-ambiguities

Conversation

@tjlane

@tjlane tjlane commented Aug 22, 2026

Copy link
Copy Markdown
Member

! This PR was vibe-coded.

Stack

Part 1 of 11 for #31. Merge this stack from the bottom upward.

Next branch: codex/phase-alignment-02-reindex-core.

What this implements

  • Adds has_reindexing_ambiguity(), using both the unit-cell metric and space group, with an explicit obliquity tolerance and proper-hand-only scope.
  • Adds has_origin_shift_ambiguity(), covering continuous polar freedom and distinct discrete origin classes after quotienting lattice and centering translations.
  • Adds the shared input error, public exports, API documentation, and a small package import-order fix needed for resolvable DataSet annotations.

Tests

The tests cover exact and pseudo-merohedral metric cases, invalid metadata and tolerances, representative discrete and polar origin cases, every reference space group, all Gemmi settings, and the import-order regression.

Reviewer focus

  • Whether the two predicates express the intended crystallographic definitions.
  • The centering-translation quotient and strict space-group conversion behavior.
  • The decision to exclude hand inversion from indexing ambiguity.

Related: #31 and #174. This prerequisite does not close the issue.

@codecov

codecov Bot commented Aug 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.19626% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.23%. Comparing base (61af8b1) to head (e5acf07).

Files with missing lines Patch % Lines
reciprocalspaceship/algorithms/reindexing.py 90.32% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #351      +/-   ##
==========================================
+ Coverage   86.86%   87.23%   +0.36%     
==========================================
  Files          40       43       +3     
  Lines        2856     2962     +106     
==========================================
+ Hits         2481     2584     +103     
- Misses        375      378       +3     
Flag Coverage Δ
unittests 87.23% <97.19%> (+0.36%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tjlane
tjlane requested review from kmdalton and minhuanli August 22, 2026 23:18
@tjlane tjlane changed the title Add crystallographic ambiguity predicates Check when alternative indexing or origin shifts are possible 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