fix(#292) populate alpha_i/beta_out/psi/omega output extras after forward()#295
Merged
Conversation
…ward() The fixed_alpha_i_*, fixed_beta_out_*, alpha_eq_beta_*, fixed_psi_*, and fixed_omega_* modes (psic, sixc, zaxis, s2d2, fourcv, fourch, kappa4cv, kappa4ch, kappa6c) declare placeholder slots in mode.extras for derived angles that the forward solver does not constrain directly. Pre-fix those slots remained at their YAML default of None even after a successful forward() call: an advertised output contract the solver did not honor. Add _populate_output_extras() to compute_forward(), called after _validate_solutions(). For each output-slot key declared in the active mode's extras (alpha_i, beta_out, psi, omega), it writes a list of per-solution float values computed via the matching helper in ad_hoc_diffractometer.reference. Empty solution lists reset the slot to []; a raising reference helper leaves the slot as None and logs the cause at DEBUG. Add the missing Extras (output) rows to the affected psic modes in docs/source/geometries/psic.md (sixc.md, zaxis.md, s2d2.md already had them). Add the Fixed bullet to CHANGES.md. Contributed by: OpenCode (argo/claudeopus47)
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 fixed_alpha_i_, fixed_beta_out_, alpha_eq_beta_, fixed_psi_,
and fixed_omega_* modes declared placeholder slots in
mode.extrasfor derived angles that the forward solver did not constrain
directly. Before this PR those slots remained at their YAML default
of
Noneeven after a successfulforward()call — an advertisedoutput contract that the solver did not honor.
Adds
_populate_output_extras()tocompute_forward(), calledafter
_validate_solutions(). For each output-slot key declared inthe active mode's
extras(alpha_i,beta_out,psi,omega),it writes a list of per-solution float values computed via the
matching helper in
ad_hoc_diffractometer.reference. Emptysolution lists reset the slot to
[]; a raising reference helperleaves the slot as
Noneand logs the cause at DEBUG.Adds the missing Extras (output) rows to the affected psic modes
in
docs/source/geometries/psic.md—sixc.md,zaxis.md, ands2d2.mdalready had them. Adds theFixedbullet toCHANGES.md.New regression test
tests/test_regression_issue_292.py(12 cases)covers: B3 surface mode populates
alpha_i+beta_outagainst anindependent recomputation;
fixed_omega_*populatesomega;fixed_psipopulatespsi; empty solutions reset to[]; secondforward()overwrites the prior contents; modes without outputslots are untouched; soft-fail leaves the slot as
Noneand logs atDEBUG.
Verification on
wow.xray.aps.anl.gov(Python 3.14.4, NumPy 2.4):pytest: 2592 passed, 2 skipped, 3 deselected — 100.00 % coveragepre-commit run --all-files: cleanmake -C docs clean html: clean build, no warnings, no RST-leakpatterns
Contributed by: OpenCode (argo/claudeopus47)