Repository navigation
fix(match): Kabsch alignment for free frames and a ConFrame adapter - #1
Merged
Merged
Conversation
The bond alignment left a twist about atoms 0 and 1 and skipped an antiparallel bond. Non-periodic frames now use a weighted Kabsch SVD with the determinant-sign guard. Collinear frames report the undefined axis and do not choose a spin about it. Periodic frames lose only the mean minimum-image translation, and an open axis is not wrapped. as_frame accepts a pyeonclient frame or a readcon.ConFrame. D4: a zero-atom frame is a legal input. D12: missing pbc is periodic, and lattice_vectors replace the length-angle cell. D1, D2, D3, D5, D6, D7, D8, D9, D10, D11, D13, D14, D15, D16, and D17 are CON codec rules. This package does not read or write a file.
The readme states that spacegroup calls spglib and cites the minimage commit pin. Org sources follow the tutorial, how-to, reference, and explanation layout. The citation page lists Rohit Goswami's papers first. CITATION.cff records ORCID 0000-0002-2393-8056. Exported rst is not committed.
Actions are pinned to commit SHAs. The docs job exports org with pandoc and builds HTML with Sphinx.
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.
The old bond alignment left a twist about atoms 0 and 1 and skipped an antiparallel bond.
internal_motion now superimposes a non-periodic frame with a mass-weighted Kabsch rotation (Kabsch 1976), keeping a proper rotation through the determinant-sign guard.
Thirty random rigid motions are recovered to an unweighted RMSD below 1e-12 angstrom.
A collinear frame reports the undefined axis and does not choose a spin about it, including an antiparallel bond.
A periodic frame, including one with no pbc, loses only the mean minimum-image translation, and an open axis is not wrapped.
as_frame accepts a pyeonclient frame or a readcon.ConFrame.
CON v3.1 D4 and D12 apply here: a zero-atom frame is a legal input, missing pbc means periodic in all three directions, and lattice_vectors replace the length-angle cell.
The other CON decisions are codec rules, and this package does not read or write files.
The docs follow the tutorial, how-to, reference and explanation layout, and CI now runs pytest, ruff and the Sphinx build.
CI passed on 3a1a0c2 in https://github.com/lode-org/readcon-ops/actions/runs/38144354846.
Note
Medium Risk
internal_motionis a breaking behavioral change (return type and alignment math) for callers that relied on bond-based alignment or periodic rotation; extensive new tests mitigate regression risk.Overview
Replaces the old two-atom bond alignment in
internal_motionwith mass-weighted Kabsch superposition for non-periodic frames, returning anAlignedFramewithrotation,rmsd, andundefined_axisfor collinear/antiparallel cases. Periodic inputs (including missingpbc, CON D12) only remove the mean minimum-image translation; mixedpbcleaves open axes unwrapped.Adds
as_frame,Frame, andAlignedFrameinframes.pysoidentical,spacegroup,rotational_match, and alignment accept pyeonclient frames orreadcon.ConFrame(cell/metadatapbc,lattice_vectors).Ships Org-mode → Sphinx docs,
CITATION.cff, ruff config, and GitHub Actions (pytest, ruff, docs build with pandoc export).Reviewed by Cursor Bugbot for commit 3a1a0c2. Bugbot is set up for automated code reviews on this repo. Configure here.