Repository navigation
Add a Staged Charts tutorial and make the 0.5 examples runnable (#144) - #157
Merged
Merged
Conversation
## Summary - **What:** a new CI-executed tutorial, docs/tutorials/staged-charts.ipynb, plus runnable staged examples in the chart-types guide, the API reference and the README. - **Why:** phased Xbar/S and phase_statistics() ship in 0.5.0, but the guide's example used Wheeler's cavity data, which exists only as a test fixture, and no notebook used phased=True. Readers could not run any of it. - **Scope:** docs only. The tutorial uses the bundled coffee-shop data, with the stage derived by one .bin() call on week (cut points 8, 12, 14), in the chained style: formulate, print(study.design()), execute(...).plot(title=...). ## Contract / Invariants (must remain true) - [x] **Default behavior unchanged:** nothing under processbehavior/ changes - [x] **Residuals unaffected:** no library change - [x] **Row/index alignment preserved:** no library change - [x] **Lane boundaries preserved:** no library change - [x] **Output schema compatible:** no library change ## Behavior Changes (explicit) - **New semantics (docs):** - Tutorial 8, Staged Charts: one set of limits vs limits per stage on Xbar and S, phase_statistics(), signals, phased X/mR on every reading, a second factor pooled (by=['stage', 'date']) or charted on its own (by=['daypart']) - chart-types "Staged Xbar/S": the example runs as written; the pooling example now uses a study with a factor to pool (the cavity study has only one); a stage is a level, not a stretch of time; explicit (staged-xbar-s)= target, fixing the #staged-xbars links that pointed nowhere - api.md Phases: phase_by and insufficient_phases are Xbar/S-only metadata - README: a staged-chart snippet and a Features bullet ## Key Design Decisions - **Data:** bundled coffee-shop set, so every reader can run it; no Wheeler or fill-weight data bundled - **Plots:** one chart per plot() call; the stacked companion layout collides its rotated subgroup labels with the second panel - **save_image:** shown in Markdown only; CI has no kaleido ## Risks & Mitigations - **P0 risks:** prose numbers drifting from the outputs - **Mitigations:** every quoted number checked against the executed outputs; the README and guide snippets executed as written and reproduce them ## Tests ### Added / Updated - [x] docs/tutorials/staged-charts.ipynb added to the nbmake allowlist in ci.yml ### Regression Focus (must fail if broken) - [x] nbmake fails if phased Xbar/S, phase_statistics() or the bin-derived stage stop working as the tutorial uses them ## Manual Verification - [x] `pytest --nbmake docs/tutorials/staged-charts.ipynb` passes - [x] `pytest tests/test_manual_citations.py tests/test_notebook_ergonomics.py` passes - [x] `pytest tests/ -m "not slow"`: 2610 passed, 7 skipped - [x] README and chart-types snippets run as written: centres 241.26, 200.62, 220.50, 200.03; S-bar 32.11 for the new baristas - [x] `myst build --html` with mystmd 1.10.1: the page builds with its 14 plots; no new warnings - [x] A returning stage level merges into one phase (A, B, A gives phases A and B), as the docs now say ## Notes - **Docs:** CHANGELOG [Unreleased] Added - **Follow-ups (not in this PR):** the design report counts a time-nested stage's impossible cells as empty (288 on this study) and lists levels alphabetically, ignoring an ordered categorical; a companion plot's second panel has no y-axis title; a returning stage level merges silently
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
Contract / Invariants (must remain true)
Behavior Changes (explicit)
Key Design Decisions
Risks & Mitigations
Tests
Added / Updated
Regression Focus (must fail if broken)
Manual Verification
pytest --nbmake docs/tutorials/staged-charts.ipynbpassespytest tests/test_manual_citations.py tests/test_notebook_ergonomics.pypassespytest tests/ -m "not slow": 2610 passed, 7 skippedmyst build --htmlwith mystmd 1.10.1: the page builds with its 14 plots; no new warningsNotes