Repository navigation
Extract the per-group Xbar/S estimator for phased charts (#144, PR 1) - #149
Merged
cnicholas merged 1 commit intoOct 18, 2026
Merged
Conversation
This was referenced Oct 18, 2026
…ed paths (#144) The global and stratified Xbar/S builders carried the same aggregation, fit and limit code twice. It now lives in five helpers (_aggregate_subgroups, _fit_xbar_group, _apply_xbar_limits, _apply_s_limits, _subgroup_label_column), the lane-divider label rule is its own function (_lane_labels), and calculate_limits_vectorized accepts a sigma-hat per row. Phased Xbar/S (#144) is N per-stage charts on one axis, each one exactly the per-stratum estimator; with the estimator extracted the feature adds a loop, not arithmetic. No behaviour change. validation/xbar_s_sweep.py (new) fingerprints 504 Xbar/S requests on T100 PM SDS 1 and 3 and prints identical output before and after; golden masters untouched; gate 1547 passed, 0 failed, 4 pending.
cnicholas
force-pushed
the
fix/xbar-s-table-subgroup-n
branch
from
October 18, 2026 22:21
7f32215 to
3e08ebb
Compare
cnicholas
force-pushed
the
feat/phased-xbar-s-refactor
branch
from
October 18, 2026 22:21
732512f to
57f499c
Compare
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.
Part of #144 (PR 1 of 4). Stacked on #148: the base is
fix/xbar-s-table-subgroup-n, so the diff shows only this change; it retargets tomainwhen #148 merges.Summary
_aggregate_subgroups,_fit_xbar_group,_apply_xbar_limits,_apply_s_limits,_subgroup_label_column); the lane-divider label rule is its own function (_lane_labels);calculate_limits_vectorizedtakes a sigma-hat per row.Contract / invariants
validation/xbar_s_sweep.py(new) fingerprints 504 Xbar/S requests on T100 PM SDS 1 and 3 (chart x companion x sevenby=shapes x value x n_mode: 420 charts and 84 refusals). Identical output on 7f32215 and this branch: 0 differing lines.Behaviour changes
None.
Methodology
Tests
tests/test_xbar_s_helpers.py(14 tests):_lane_labelskeeps theastypedate rendering and the_join; a per-rowsigmamatches the formula row by row, a scalar equals a constant Series exactly, and a Seriessigmasupplies the result index;_fit_xbar_groupreturns None without replication, charts n = 1 and drops n = 0, decides constant-n separately for Xbar and S, and undern_mode='average'overwritesNwhilenkeeps the actual sizes;_apply_s_limitsis B3/B4 per row around S-bar;_aggregate_subgroupswith and without the cached cell mean and with an R2 limits column; the four subgroup-label rulespytest tests/— 2567 passed, 7 skippedruff check .mypy processbehavior— 14 errors, all pre-existing and outside the touched code (X/mR and Histogram sites)python validation/e2e_bishop_report.py— 1547 passed, 0 failed, 4 pending;docs/reference/validation.mdunchangedNotes
ruff-formathook skipped:analysis.pyandspc_constants.pyhave never been ruff-formatted, and the hook would have rewritten about twenty unrelated blocks. A formatting-only commit can follow separately if wanted.phased=Truefor Xbar and S on top of these helpers.