Skip to content

docs: example-rich guides, getting-started, datasets, and R map#11

Merged
ismayc merged 10 commits into
mainfrom
docs/examples-guides
Jun 19, 2026
Merged

docs: example-rich guides, getting-started, datasets, and R map#11
ismayc merged 10 commits into
mainfrom
docs/examples-guides

Conversation

@ismayc

@ismayc ismayc commented Jun 19, 2026

Copy link
Copy Markdown
Member

Makes the Read the Docs site much more accessible — moving from a single API page to an example-first structure modeled on top Python docs (polars-style getting-started + task guides) and the R moderndive pkgdown site.

New pages

  • Landing page — value proposition, feature list, install (+ [image] extra), and a 30-second worked example (the promotions permutation test).
  • Getting started — a complete first analysis end to end.
  • Guides (task-based, runnable examples, both plot engines throughout):
    • Sampling (rep_slice_sample, the bowl)
    • Bootstrapping & confidence intervals (percentile / SE / bias-corrected)
    • Hypothesis testing (permutation, point nulls, draw/simulate)
    • Regression (tidy tables, summaries, correlation, parallel-slopes & categorical-model plots, per-facet coefficient shading)
    • Theory-based inference (t_test/prop_test/chisq_test/assume, method="both" overlays)
    • Plotting — plotly/plotnine engines, shading, saving
  • Datasets — thematic tour of all 58 bundled datasets.
  • Coming from R — a function-by-function R → Python map (high value for moderndive/infer users), plus the key differences (pipe → methods, statsmodels models, plotly default, polars).

Quality

  • Every code block was executed against the package to confirm it runs and the shown outputs are accurate.
  • Docs build clean with -W (zero warnings); committed HTML rebuilt.

🤖 Generated with Claude Code

ismayc and others added 10 commits June 19, 2026 07:09
Expand the documentation from a single API page into an accessible, example-first
site (informed by top Python docs and the R moderndive pkgdown site):

- Rewritten landing page: value proposition, feature list, install (+ image
  extra), and a 30-second worked example.
- getting-started: an end-to-end first analysis.
- Task guides with runnable, verified examples (dual-engine plots throughout):
  sampling, bootstrapping & confidence intervals, hypothesis testing, regression
  (incl. per-facet coefficient shading and the model plots), theory-based
  inference, and a plotting/engines guide.
- datasets: a thematic tour of all 58 bundled datasets.
- coming-from-r: a function-by-function R -> Python map for moderndive/infer users.

Every code block was executed against the package to confirm it runs. Docs build
clean with -W (no warnings).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017CTL1QSTg1DmDUpqYuPEog
Pulls the fixed logo from the PR #10 branch so this docs branch doesn't ship the
old bottom-cropped hex regardless of PR merge order.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017CTL1QSTg1DmDUpqYuPEog
Switch the docs to myst-nb so every example runs at build time and its output
(DataFrames + plots) renders on the site:

- conf.py: myst_nb engine; execute {code-cell} blocks; prefer static image/png
  over plotly's heavy interactive html; strip kernel stderr.
- Plots render as static PNGs — plotnine via matplotlib, plotly via kaleido
  (renderer set to "png" in each page's hidden setup cell).
- doc extra: add myst-nb, ipykernel, kaleido. .readthedocs.yaml installs Chrome
  for kaleido (>=1.0 no longer bundles it) via a post_install job.
- Landing 30-second example now uses the spotify dataset (not promotions); the
  Coming-from-R pipeline example uses pennies (not mtcars), and its function map
  now lists only the genuine R->Python differences, noting the rest are identical.

Every page executes cleanly in the kernel and the build is warning-free under -W.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017CTL1QSTg1DmDUpqYuPEog
- Attach a `.specify()` method to polars and pandas DataFrames so you can write
  `md.load_pennies().specify(response="year")`, mirroring R's `df %>% specify(...)`.
  Registered on import; never overwrites an existing attribute.
- Add `geom_categorical_model` as an alias of `gg_categorical_model` so both R
  names are available and do the same thing.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017CTL1QSTg1DmDUpqYuPEog
Add tooling to catch when the upstream R packages change in ways the Python port
hasn't followed:

- tools/parity_probe.R dumps upstream structure (versions, exports, dataset
  dims/columns) as JSON.
- tools/check_parity.py compares it to the bundled datasets + a recorded
  manifest, reporting version bumps, added/removed exports, and missing or
  shape-changed datasets; exits non-zero on drift.
- tools/parity_manifest.json records the reviewed upstream snapshot (provenance).
- .github/workflows/parity-drift.yml runs this weekly against upstream main and
  opens/updates a GitHub issue on drift.
- tests/test_parity_manifest.py asserts bundled moderndive/infer datasets match
  the manifest dims, so a bad data regeneration fails CI.
- tools/README.md documents the data-refresh and parity processes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017CTL1QSTg1DmDUpqYuPEog
- Remove the promotions dataset from all examples and the dataset catalog (we're
  not using it going forward): getting-started and the hypothesis-testing guide
  now use the MythBusters yawn experiment / spotify; coming-from-r uses pennies.
- Add a worked "custom test statistic" example (a callable passed to
  calculate()) to the hypothesis-testing guide, bootstrapping a custom IQR.
- Use the new df.specify() flow in examples; note geom_categorical_model as a
  same-name function in the R map.
- Rebuilt HTML.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017CTL1QSTg1DmDUpqYuPEog
…tive)

- Convert examples from specify(df, ...) to df.specify(...) to mirror the R
  df %>% specify(...) pipeline more closely.
- Add a note (landing, getting-started, plotting guide) that documentation plots
  are static images while the default plotly engine is interactive when run.
- Rebuilt HTML.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017CTL1QSTg1DmDUpqYuPEog
# Conflicts:
#	doc/_build/html/.doctrees/api.doctree
#	doc/_build/html/.doctrees/environment.pickle
#	doc/_build/html/searchindex.js
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017CTL1QSTg1DmDUpqYuPEog
@ismayc ismayc merged commit 2bbf64f into main Jun 19, 2026
6 checks passed
@ismayc ismayc deleted the docs/examples-guides branch June 19, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant