pymc-labs / pymc-labs/CausalPy

Refresh pipeline_workflow.ipynb and report_demo.ipynb outputs after #819 lands

Open
#883 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation OSS_PRODUCT outputs
Dominant language
Python
Stars
1.2k
Forks
115
Avg merge
6d 1h
Merged PRs (30d)
11

Description

Summary

Re-execute the documentation notebooks that consume sensitivity checks via SensitivityAnalysis + GenerateReport so that the embedded HTML report shows the new auto-rendered check figures introduced in #819.

[!IMPORTANT]
Do not start work on this issue until #819 is merged and closed. This is a follow-up cleanup that depends on the new Check.plot() methods and the GenerateReport figure-rendering wiring landing on main first. Working on this in parallel will create merge conflicts in notebook outputs.

Background

PR #819 adds plot() staticmethods to PlaceboInSpace, PlaceboInTime, LeaveOneOut, and PriorSensitivity, and auto-populates CheckResult.figures inside each check's run(). GenerateReport then renders those figures (base64-encoded PNGs) into the HTML report. Existing pipeline-based notebooks do not need code changes, but their saved outputs were generated before this wiring existed, so the embedded report HTML in their cell outputs does not yet contain the new figures.

sc_pymc.ipynb is already re-executed as part of #819 and is therefore out of scope here.

Scope

Re-execute the following notebooks in the CausalPy conda environment and commit the refreshed outputs:

  • docs/source/notebooks/pipeline_workflow.ipynb — uses cp.checks.PlaceboInTime via SensitivityAnalysis + GenerateReport(include_plots=True).
  • docs/source/notebooks/report_demo.ipynb — same pattern as pipeline_workflow.

No code changes to these notebooks are expected. The point of the work is purely to refresh saved cell outputs so readers see the new figures the PR description promises.

Out of scope

  • staggered_did_pymc.ipynb and rkink_pymc.ipynb use PreTreatmentPlaceboCheck and BandwidthSensitivity, which #819 does not touch — no refresh needed.
  • The remaining notebooks that grep-match "placebo" only mention it in a generic disclaimer paragraph and do not invoke the check API.
  • Adding a dedicated example of the new direct-API Check.plot(result, ...) ergonomic to sensitivity_checks.md would be nice but should be tracked separately if pursued.

Acceptance criteria

  • pipeline_workflow.ipynb re-executed end-to-end in the CausalPy env; the embedded report HTML in its outputs shows the placebo-in-time figure.
  • report_demo.ipynb re-executed end-to-end; embedded report HTML shows the placebo-in-time figure.
  • $CONDA_EXE run -n CausalPy make html (run from docs/) builds cleanly.
  • prek run --all-files passes, including the validate-notebooks schema check.
  • No code edits to either notebook beyond what re-execution naturally produces in the JSON.

Notes for the implementer

  • Use a notebook-aware tool to re-execute (Jupyter Lab, VS Code notebook UI, or jupyter nbconvert --to notebook --execute --inplace) so the JSON stays valid against the nbformat schema.
  • Run inside the conda env per AGENTS.md: $CONDA_EXE run -n CausalPy jupyter nbconvert --to notebook --execute --inplace docs/source/notebooks/pipeline_workflow.ipynb.
  • If validate-notebooks fails afterward, follow the recovery steps in AGENTS.md (re-open and save in a notebook-aware editor, restore from main and reapply, etc.).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Wait until #819 is merged and closed, then re-execute docs/source/notebooks/pipeline_workflow.ipynb and docs/source/notebooks/report_demo.ipynb in the CausalPy environment using the notebook-aware command in the issue. Confirm their embedded HTML reports contain the placebo-in-time figure, then run the docs make html build and prek run --all-files; done means both notebooks validate and no unrelated edits appear.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
build-system, documentation, testing-qa
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.