refactor: safe configuration resolution and shared RSM geometry (1/4) - #136
Open
pecomyint wants to merge 1 commit into
Open
refactor: safe configuration resolution and shared RSM geometry (1/4)#136pecomyint wants to merge 1 commit into
pecomyint wants to merge 1 commit into
Conversation
Osayi-ANL
approved these changes
Aug 12, 2026
Osayi-ANL
left a comment
Collaborator
There was a problem hiding this comment.
Don't see a problem with this commit
2 tasks
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.
Stack 1 of 4. Base
main. No beam time required.Behavior-preserving groundwork. Six-axis Q is bit-identical across the offline, HPC and area-detector paths; the point is to make the next three PRs safe, not to change results.
What this adds
Raw vs effective configuration.
IOC_RSM_PARAMETERbecomes the canonical geometry section and generates an effective[HKL]mapping in memory. Hand-authored[HKL]on disk is never rewritten and unknown groups survive, so adopting the canonical section is reversible.Snapshot / CAS persistence.
DbProfileConfigSource.saveandTomlConfigSource.saveboth did a shallowexisting.update(), so saving one section replaced it wholesale, and the read-modify-write was unguarded — two editors meant last-writer-wins with no warning. Now:load_snapshot()/replace_if_revision()with conflict detection.One geometry model.
RotationAxis/DetectorModel/RSMGeometryand a singlebuild_hxrd, replacing four near-duplicateQConversion+HXRD+init_areasites.Ang2Q.areais called with an explicitdeg=True.Validated
SAMPLE_ORIENTATION. Checked against the xrayutilities docstring rather than assumed:'det'requires an innermost detector rotation not parallel to the primary beam, and correctly falls through a final beam-axis rotation (which'det'ignores) — this is what keeps PR 3'sdetrotcontinuous.'sam'warns that it is only physically correct when the innermost sample circle is the azimuth motor. That is a constraint on which motor, not a structural check.'det'is the xu default, so this governs every existing profile.Verification
Full unit suite green,
ruff check src/dashpva/clean, legacy profiles resolve unchanged, and the existing bit-identical-Q test guards the refactor.Review notes
Merge with a merge commit, not a squash — PRs 2–4 stack on this.