Repository navigation
Land the phased Xbar/S stack on main (#149–#152) - #153
Merged
Merged
Conversation
…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.
execute(chart='Xbar' | 'S', phased=True) gives each factor combination its own centre line and limits on one chart, drawn as stepped lines with a labelled divider at each change, as phased X/mR does for its lanes. Each phase is computed as the per-condition chart of by=[time] computes one stratum: the mean of its subgroup means as centre, its own S-bar and sigma-hat, its own limits (10-12 manual Eqs 11-5, 11-8, 11-9, 11-16, 11-17). With other factors pooled into the subgroup (by=['stage', time]) the centre is the mean of the pooled subgroup averages, as Dr. Bishop specified on 2026-10-18. On Wheeler's four-cavity thickness data the per-cavity centres and limits match Minitab's staged Xbar-S chart to the digit. New result.phase_statistics(chart); chart data and chart_table gain a phase column; metadata carries phase_by, lane_boundaries, single_point_phases and insufficient_phases. by=[time], residual values and calibrations are refused with messages that say what to use instead. phased=False output is unchanged (validation/xbar_s_sweep.py: 0 differing lines); gate 1547 / 0 / 4; full suite 2628 passed.
… factor (#144) The canonical row order in build_keys sorted the raw factor labels, so a stage column with categories before < after gave Xbar/S subgroups in that order (the aggregation groups on the factor column) but X/mR lanes, phases and strata in the order after, before. The canonical sort now uses an ordered Categorical's category codes. Every other input sorts exactly as before: the parallel key is built only when an ordered Categorical is present (xbar_s_sweep: 0 differing lines; golden masters untouched; gate 1547 / 0 / 4; full suite 2638 passed).
Phased X and mR charts gain what phased Xbar/S got: a phase column (the lane label) on the chart data and in chart_table, and result.phase_statistics(chart) with one row per phase (phase, points, center, mR_bar, lpl, upl). A stratified phased chart keeps one table per stratum, read with stratum= or through focus(). The companion mR of a phased X chart now reports single_point_phases, which only the solo mR did. Output additions only: the per-phase arithmetic, row order, limits and signals are unchanged, and phased=False charts are untouched (xbar_s_sweep: 0 differing lines; gate 1547 / 0 / 4; full suite 2633 passed).
…rder X/mR lane order honours an ordered Categorical factor (#144, PR 4)
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.
Lands the phased Xbar/S stack on main. #149, #150, #151 and #152 were merged in quick succession after #148, but their bases were still the stacked branches (the #148 branch was not deleted, so GitHub never retargeted them), so each merged into the branch below it and none reached
main. This branch is the top of that chain: it contains every commit and merge of #149 through #152, on top of the #148 commit main already has.Contents (already reviewed in the four PRs)
calculate_limits_vectorized;validation/xbar_s_sweep.pyresult.phase_statistics; Tom's cavity data as a fixture; golden scenariophased_xbar_s; docs and CHANGELOGphasecolumn andphase_statisticson phased X/mR; companion mRsingle_point_phasesVerification
git merge-treeagainstmain: clean, no conflictsintegration/app-devf59c981, from which the preview wheel0.5.0.dev1+gf59c981in the app (app Major refactoring: Package structure, SDS validation, stratification, and UX improvements #32, deployed) was built: full suite 2638 passed; gate 1547 / 0 / 4;docs/reference/validation.mdunchangedNo new code. Merge with a merge commit, as the others were.