fix: gate intensity state on CLI, writers, and JOSS docs - #2
Merged
Conversation
Apply the intensity-state contract to estimate-k, subtract-buffer, and minimal_2d. Stamp 1/cm only for labeled absolute_cm^-1 data, refuse unlabeled I, and point reviewers at unreleased 2.0.0 on main. Co-authored-by: Delun Gong <dlgong17s@imr.ac.cn>
Keep column-override coverage without raw-count name conflicts, require labeled Workbench XML exports, and gate minimal_2d as K-only after thickness is already recorded. Co-authored-by: Delun Gong <dlgong17s@imr.ac.cn>
D-sudoasd
marked this pull request as ready for review
August 16, 2026 18:19
Record that the example uses a homemade integer-bin radial average, not pyFAI or the BL19B2 campaign runner, and refuse I_abs columns in estimate-k. Co-authored-by: Delun Gong <dlgong17s@imr.ac.cn>
Co-authored-by: Delun Gong <dlgong17s@imr.ac.cn>
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.
Reviewer report (file-backed review of
main@ 3e599dd)Verified each finding against
3e599dd, then fixed what a coding agent can fix. Author metadata, research-use case, public-history date, andv2.0.0tagging were left untouched.estimate_k_factor_robustmath andpropagate_absolute_uncertaintywere not churned.1. Intensity-state gates were not on the public contract — confirmed on main, fixed
On
3e599dd,cli.pyestimate-knever calledrequire_relative_input_for_absolute_scaling.tests/test_cli.py::test_cli_estimate_k_accepts_scattering_column_names_with_unitsfedI_absand recoveredK=2.subtract_bufferhad no state check (docstring said “cm⁻¹ or relative”).minimal_2dapplied K/d with no state object.Now: CLI
estimate-kgates relative input and refuses unlabeled I andI_abscolumns. Newsubtract-bufferand the kernel require absolute sample/buffer provenance.minimal_2dgates the standard as relative before K (K-only after thickness is already on the ledger). Paper/README no longer claim a universal contract for the thin utilities (norm-factor,parse-header,parse-external1d).2. Writers stamped
1/cm; readers always returnedi_rel— confirmed on main, fixedOn
3e599dd, writers hardcodedunit="1/cm". Readers always seti_rel/err_rel.tests/test_io_formats.pywrotei_abs = 100/qand assertedresult["i_rel"].Now: writers stamp
1/cmonly forabsolute_cm^-1plus an explicit cm⁻¹ unit. Readers always returnintensity/uncertaintyand addi_absori_relonly for the assessed state. Tests asserti_absand refuse unlabeled writes.3. Paper claimed XSD + punx as software facts — confirmed on main, docs downgraded
CI still does not run xmlschema/punx. Paper/README/FAQ now say: offline 2026-08-15 check, not in CI; no third-party consumer validation.
4. Review unreleased 2.0.0 on
main, not v1.1.1 — fixed in docsREADME, paper, FAQ, and readiness notes say to review the unreleased 2.0.0 tree on
main. No tag or release was created.5. CLI had no
--thicknessand accepted unlabeled I — confirmed on main, fixed--thickness-cmis centimetres. Help text keeps Workbench Tab 1 in mm (1.055 mm = 0.1055 cm). Unlabeled I is refused.6.
minimal_2doverclaimed — confirmed, tightened; one clause discardedThe example is a 9×9 homemade integer-bin radial average, not pyFAI, with unknown uncertainty. Paper, README, example README, FAQ, and
test_minimal_2d_examplenow assertdetector_shape=[9,9],reduction=homemade_integer_bin_radial_average,uses_pyfai=false,uses_bl19b2_campaign=false.Discarded clause: “NIST path bypassed” is only true for the BL19B2 campaign runner. The example still calls
build_nist_net_imagefor detector-space NIST-blank subtraction. Docs now say that explicitly.7. Unitless
"absolute"mapped to cm⁻¹ — confirmed on main, fixed_state_from_metadatano longer aliases bare"absolute"toABSOLUTE_CM_INV. That label is ambiguous. Writers refuse it.What changed on this branch
estimate-k, CLIsubtract-buffer,subtract_buffer, andminimal_2d1/cmwriters; state-keyed readers; tests no longer enshrinei_relfor absolute data--thickness-cm; refuse unlabeled I andI_abscolumnsmain; XSD/punx offline 2026-08-15;minimal_2dlimited to the 9×9 homemade reducerTests run
pytest -q— 734 passedruff check SASAbs.py saxs_mpl_style.py src tests paper/*.py scripts/*.py— all checks passedpython examples/minimal_2d/run_minimal_2d_pipeline.py— planted K recovered (k_relative_error ≈ 0.00193)scripts/check_submission_readiness.pywas not rerunAuthor-only leftovers (not invented)
v2.0.0, a GitHub Release, or a Zenodo version archive