Skip to content

fix(#292) populate alpha_i/beta_out/psi/omega output extras after forward()#295

Merged
prjemian merged 1 commit into
mainfrom
292-populate-surface-angle-extras
Jun 9, 2026
Merged

fix(#292) populate alpha_i/beta_out/psi/omega output extras after forward()#295
prjemian merged 1 commit into
mainfrom
292-populate-surface-angle-extras

Conversation

@prjemian

@prjemian prjemian commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

The fixed_alpha_i_, fixed_beta_out_, alpha_eq_beta_, fixed_psi_,
and fixed_omega_* modes declared placeholder slots in mode.extras
for derived angles that the forward solver did not constrain
directly. Before this PR those slots remained at their YAML default
of None even after a successful forward() call — an advertised
output contract that the solver did not honor.

Adds _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.

Adds the missing Extras (output) rows to the affected psic modes
in docs/source/geometries/psic.mdsixc.md, zaxis.md, and
s2d2.md already had them. Adds the Fixed bullet to
CHANGES.md.

New regression test tests/test_regression_issue_292.py (12 cases)
covers: B3 surface mode populates alpha_i + beta_out against an
independent recomputation; fixed_omega_* populates omega;
fixed_psi populates psi; empty solutions reset to []; second
forward() overwrites the prior contents; modes without output
slots are untouched; soft-fail leaves the slot as None and logs at
DEBUG.

Verification on wow.xray.aps.anl.gov (Python 3.14.4, NumPy 2.4):

  • pytest: 2592 passed, 2 skipped, 3 deselected — 100.00 % coverage
  • pre-commit run --all-files: clean
  • make -C docs clean html: clean build, no warnings, no RST-leak
    patterns
  • US-English spelling check on changed files: clean

Contributed by: OpenCode (argo/claudeopus47)

…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)
@prjemian prjemian merged commit 2cbe8ba into main Jun 9, 2026
7 checks passed
@prjemian prjemian deleted the 292-populate-surface-angle-extras branch June 9, 2026 14:57
@prjemian prjemian added this to the v0.11.1 patches milestone Jun 9, 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.

psic: fixed alpha_i modes

1 participant