Repository navigation
Phase column and phase_statistics on phased X/mR (#144, PR 3) - #151
Merged
Merged
Conversation
11 tasks done
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).
cnicholas
force-pushed
the
feat/phased-xbar-s
branch
from
October 18, 2026 22:21
881f6aa to
fb8f10d
Compare
cnicholas
force-pushed
the
feat/phased-xmr-phase-stats
branch
from
October 18, 2026 22:21
844abb7 to
3454269
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 3 of 4). Stacked on #150: the base is
feat/phased-xbar-s, so the diff shows only this change.Summary
phasecolumn (the lane label) on the chart data and inchart_table, andresult.phase_statistics(chart)with one row per phase (phase,points,center,mR_bar,lpl,upl). On a stratified phased chart (by=['factor 1'], phased=True) the table is per stratum:phase_statistics(chart, stratum=...)orfocus(stratum).phase_statistics(chart). The companion mR now reportssingle_point_phases, which only the solo mR did.phased=Falsecharts are untouched.Contract / invariants
phased=True);validation/xbar_s_sweep.pyidentical (0 differing lines)phasecolumn afterrsg,phasespayload key,single_point_phaseson the companion mR. Golden masters untouched (none of the scenarios is phased)Behaviour changes
['time', 'rsg', 'phase', value, 'center', 'lpl', 'upl', 'beyond_limits', 'obs_id'](stratified: thebycolumn beforephase);chart_tableshowsphaseaftersubgroup.phase_statistics(chart, stratum=None)works on phased X/mR; on a stratified one it asks for a stratum and names the available ones.single_point_phases.Methodology
Tests
tests/test_phased_limits.py::TestPhaseColumnAndStatistics(5): thephasecolumn equals the lane label and each phase has one centre; the X and mR tables have one row per phase in display order, points sum to the rows, each row's centre and limits match the chart rows, the mR centre is its mR-bar with LPL 0 and the same mR-bar as X; the companion mR carriessingle_point_phasesequal to X's and to the count of phases under two points; stratified tables by stratum equalfocus(stratum).phase_statistics, missing or unknown strata are refused; unphased charts have nophasecolumn and refusephase_statistics, and a stratum on an unstratified chart is refusedtests/test_phased_xbar_s.py: the X/mR refusal test became the stratum refusalpytest tests/— 2633 passed, 7 skippedruff check .mypy processbehavior— 14 errors, all pre-existing, none in the touched codepython validation/e2e_bishop_report.py— 1547 passed, 0 failed, 4 pending;docs/reference/validation.mdunchangedNotes
api.md"Phases" covers X/mR and the stratum argument; CHANGELOG entries from Phased limits on Xbar and S charts (#144, PR 2) #150 extended, plus a Fixed line for the companion mR.