feat(design-report): state where sigma comes from, and how precise it is, at the observed T (#114) - #124
Merged
Conversation
… is, at the observed T (#114) ## Summary - **What:** one line under Structure in the design report, plus study.series_length / study.series_length_description, and the MR_SIGMA_INTERVAL_80 table in spc_constants. - **Why:** #114's series-length question. Tom's position: judgment belongs to the analyst, not to a rule. So the report states a fact — where sigma rests at this structure and the 80% interval of the moving-range estimate at this T — and attaches no threshold, label, or warning. ADS 2 is ADS 2 whether T is 4 or 400; the line sits beside the state. - **Scope:** series_length.py (new, pure), spc_constants.py (table), study.py (two properties, DesignReport field + line), api.md, key-concepts.md, CHANGELOG, tests. ## Contract / Invariants (must remain true) - ADS/ODS/PDS detection, recommended_chart, valid_charts and the analysis menu unchanged and independent of T (pinned: test_design_state_and_menu_do_not_move_with_T). - No chart math; validation/e2e_bishop_report.py exit 0, validation.md unchanged. - DesignReport field appended with a default; positional construction unaffected. - No warnings emitted (pinned). ## Behavior Changes (explicit) - design() prints "Series length: ..." after Structure whenever there is something to say (time variable present, or replication present). Nothing when neither. - Sentences: unreplicated 3..30 -> interval from the table; >30 -> bounded by the n=30 row; T=2 -> single moving range; replicated -> within-cell degrees of freedom, not T; partial replication -> both facts. ## Tests - tests/test_series_length.py: the pure function on every branch; no verdict words; frozen; the table covers 3..30, narrows monotonically, and rows n=4 and n=20 regenerate from the validation script's seed; Study surface on the reporter's shape, Tom's T=1 replicated shape, no-time replicated, and the T-invariance of the design state. ## Manual Verification - pytest tests/: 2360 passed, 10 skipped - ruff check .: clean; mypy: 17 pre-existing errors, none new - validation/e2e_bishop_report.py: exit 0
…sigma Per Tom: no degrees of freedom, no estimates, no 'stable process' in the report sentence. Six forms: T=4. Sigma for X/mR rests on 3 moving ranges. T=1. Sigma rests on within-cell replication. Sigma rests on within-cell replication. (no time variable) T=8. Sigma for X/mR rests on 7 moving ranges. (partial replication) T=60. Sigma for X/mR rests on 59 moving ranges. T=2. Sigma for X/mR rests on a single moving range. within_cell_df and mr_interval_80 stay on SeriesLengthPrecision for callers; the report prints only the sentence. Tests pin the six forms and forbid the retired words. pytest: 2360 passed; ruff clean; validator exit 0.
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.
Summary
Structurein the design report naming where the sigma behind the limits comes from at the observed structure and series length. Exposed asstudy.series_length(a frozenSeriesLengthPrecision) andstudy.series_length_description.series_length.py(new, pure),spc_constants.py(theMR_SIGMA_INTERVAL_80table, carried on the result for callers, not printed),study.py(two properties, oneDesignReportfield and one report line),api.md,key-concepts.md, CHANGELOG,tests/test_series_length.py.The six forms the line takes, wording per Tom (no degrees of freedom, no estimates, no "stable process"):
No time variable and no replication prints nothing.
within_cell_dfandmr_interval_80(the p10/p90 of MRbar/d2 by n = 3..30, fromvalidation/short_series_bands.py, contributed by @rabujamra in #114 / #119) ride on the result for anyone who wants the numbers in code.Contract / invariants
validation/e2e_bishop_report.pyexits 0 anddocs/reference/validation.mdis unchanged.DesignReportgains one field with a default, appended last; positional construction is unaffected. Two new read-onlyStudyproperties.recommended_chart,valid_chartsidentical at T = 3 and T = 300 on the same structure (test_design_state_and_menu_do_not_move_with_T). No warning is emitted (pinned).Behaviour changes
study.design()prints one extra line whenever there is something to say. That is the only visible change.Methodology
processbehavior/series_length.py.Tests
TestAssessSeriesLength— the six forms exactly; the retired words ("short", "adequate", "provisional", "warning", "degrees of freedom", "estimate", "stable process") never appear; frozen result.TestIntervalTable— covers n = 3..30, narrows monotonically, and rows n = 4 and n = 20 regenerate from the validation script's seed scheme to three decimals.TestStudySurface— the reporter's four-point shape, Tom's T = 1 replicated file shape, replication with no time variable, T-invariance of the design state, and no warning on a short series.pytest tests/— 2360 passed, 10 skippedruff check .— cleanmypy processbehavior— 17 pre-existing errors, none newGolden masters untouched
Notes
coffee-shop,sds-validation,sds1-complete-analysis) will show the new line when next re-executed; not re-run here.🤖 Generated with Claude Code
https://claude.ai/code/session_01BKphCi1LC1hjGYteWEK9JV