Repository navigation
Stabilize cell volumes for highly skew lattice bases - #137
Open
srijan2607 wants to merge 4 commits into
Open
srijan2607 wants to merge 4 commits into
srijan2607 wants to merge 4 commits into
Conversation
Author
|
The test-typing follow-up is pushed at @pkienzle could you approve the pending fork workflow when appropriate? The current-head run is waiting for approval with zero jobs executed; hosted CI is not yet verified. |
srijan2607
marked this pull request as ready for review
October 18, 2026 04:26
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Evaluate crystal-cell volume using the equivalent four-sine factorization of the Gram determinant. Compensated degree-space sums reduce cancellation for extreme or near-degenerate cell descriptions; this is not a typical reduced-cell density-corruption claim.
Exact orthogonal results are preserved:
cell_volume(2) == 8.0andcell_volume(2, 3, 4) == 24.0. Flat cells with angles(30, 60, 90),(90, 90, 180)and(120, 120, 120)return exactly0.0. Real-angle conversion occurs before negation so NumPy unsigned scalars do not wrap.Verification
The configured default command,
python -m pytest, passes 279 tests, including the project's doctests, coverage and mypy checks. Mypy reports no issues in 33 source files; overall coverage is 87%, withperiodictable/util.pyat 100%. This was rerun on Python 3.13.13, NumPy 2.5.4 and mypy 2.4.0.The previous head produced 2 failed, 277 passed, with three typing errors in
REAL_ANGLE_CASES. The follow-up changes only test-constructor annotations; production code, test configuration and checks are unchanged. Hosted CI has passed: all four test jobs and the wheel build completed successfully; the PyPI upload job was skipped.No new angle-range validation or general length-product overflow guarantee is added. Known behavior outside the principal angle domain remains outside this repair.
Research basis: NIST DLMF §4.21 supplies the addition/product identities; the IUCr coreCIF cell-volume definition supplies the Gram determinant. Floating-point accuracy is tested separately from the algebraic identity.