Skip to content

fix: gate intensity state on CLI, writers, and JOSS docs - #2

Merged
D-sudoasd merged 4 commits into
mainfrom
cursor/joss-reviewer-polish-8363
Aug 16, 2026
Merged

fix: gate intensity state on CLI, writers, and JOSS docs#2
D-sudoasd merged 4 commits into
mainfrom
cursor/joss-reviewer-polish-8363

Conversation

@D-sudoasd

@D-sudoasd D-sudoasd commented Aug 16, 2026

Copy link
Copy Markdown
Owner

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, and v2.0.0 tagging were left untouched. estimate_k_factor_robust math and propagate_absolute_uncertainty were not churned.

1. Intensity-state gates were not on the public contract — confirmed on main, fixed

On 3e599dd, cli.py estimate-k never called require_relative_input_for_absolute_scaling. tests/test_cli.py::test_cli_estimate_k_accepts_scattering_column_names_with_units fed I_abs and recovered K=2. subtract_buffer had no state check (docstring said “cm⁻¹ or relative”). minimal_2d applied K/d with no state object.

Now: CLI estimate-k gates relative input and refuses unlabeled I and I_abs columns. New subtract-buffer and the kernel require absolute sample/buffer provenance. minimal_2d gates 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 returned i_relconfirmed on main, fixed

On 3e599dd, writers hardcoded unit="1/cm". Readers always set i_rel/err_rel. tests/test_io_formats.py wrote i_abs = 100/q and asserted result["i_rel"].

Now: writers stamp 1/cm only for absolute_cm^-1 plus an explicit cm⁻¹ unit. Readers always return intensity/uncertainty and add i_abs or i_rel only for the assessed state. Tests assert i_abs and 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 docs

README, 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 --thickness and accepted unlabeled I — confirmed on main, fixed

--thickness-cm is centimetres. Help text keeps Workbench Tab 1 in mm (1.055 mm = 0.1055 cm). Unlabeled I is refused.

6. minimal_2d overclaimed — confirmed, tightened; one clause discarded

The example is a 9×9 homemade integer-bin radial average, not pyFAI, with unknown uncertainty. Paper, README, example README, FAQ, and test_minimal_2d_example now assert detector_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_image for detector-space NIST-blank subtraction. Docs now say that explicitly.

7. Unitless "absolute" mapped to cm⁻¹ — confirmed on main, fixed

_state_from_metadata no longer aliases bare "absolute" to ABSOLUTE_CM_INV. That label is ambiguous. Writers refuse it.

What changed on this branch

  • Intensity-state gates on CLI estimate-k, CLI subtract-buffer, subtract_buffer, and minimal_2d
  • Conditional 1/cm writers; state-keyed readers; tests no longer enshrine i_rel for absolute data
  • --thickness-cm; refuse unlabeled I and I_abs columns
  • Docs: review 2.0.0 on main; XSD/punx offline 2026-08-15; minimal_2d limited to the 9×9 homemade reducer

Tests run

  • pytest -q734 passed
  • ruff check SASAbs.py saxs_mpl_style.py src tests paper/*.py scripts/*.pyall checks passed
  • python examples/minimal_2d/run_minimal_2d_pipeline.py — planted K recovered (k_relative_error ≈ 0.00193)
  • Pandoc is not in this environment, so scripts/check_submission_readiness.py was not rerun

Author-only leftovers (not invented)

  • Corresponding author, current email, author list/order, ORCID confirmation, CRediT
  • Funding, acknowledgements, competing-interest statements
  • Recoverable AI product/model/version details
  • A verifiable research-use case
  • Six-month public-history gate: wait until 2026-08-26
  • Do not create v2.0.0, a GitHub Release, or a Zenodo version archive
Open in Web Open in Cursor 

cursoragent and others added 2 commits August 16, 2026 18:15
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
D-sudoasd marked this pull request as ready for review August 16, 2026 18:19
cursoragent and others added 2 commits August 16, 2026 18:20
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>
@D-sudoasd
D-sudoasd merged commit 820e2fd into main Aug 16, 2026
13 checks passed
@D-sudoasd
D-sudoasd deleted the cursor/joss-reviewer-polish-8363 branch August 16, 2026 19:57
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.

2 participants