Rerun the eleven docs notebooks left off the documentation site

Aperta
#2,842 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Documentazione
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
jupyter-notebook, markdown, python
Ambito
documentation

Direzione di ricerca

Start with the NOTEBOOKS_LEFT_OUT mapping in policyengine_uk/tests/code_health/test_docs_toc.py, which gives each notebook's reason, then open a small one such as docs/book/programs/gov/dcms/bbc/tv-licence.ipynb. Done means each notebook reruns in place with no error outputs or local paths, its Markdown figures match the parameters for the year it names, and it moves from NOTEBOOKS_LEFT_OUT into myst.yml. Two notebooks need the survey dataset, so they may need a maintainer.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

documentation

The fix for #2803 keeps eleven notebooks out of myst.yml, so the documentation site has no page for them. NOTEBOOKS_LEFT_OUT in policyengine_uk/tests/code_health/test_docs_toc.py names each with its reason. The current parameters or the law contradict the stored outputs of ten of them, and the eleventh needs survey data to check.

Notebook Reason in NOTEBOOKS_LEFT_OUT
docs/book/programs/gov/dcms/bbc/tv-licence.ipynb Its fee table stops at the 2021 fee, and a cell hard-codes that fee as the current value.
docs/book/programs/gov/dwp/PIP.ipynb Its enhanced mobility column shows the daily living standard rate, and its daily living table runs a year behind the parameters.
docs/book/programs/gov/dwp/universal-credit.ipynb Each stored amount sits a year earlier than the parameters give it.
docs/book/programs/gov/hmrc/child-benefit.ipynb Its 2022 table uses 2021 rates, and its code imports IndividualSim, which the package no longer has.
docs/book/programs/gov/hmrc/fuel-duty.ipynb Its stored schedule differs from the parameters from 2027.
docs/book/programs/gov/hmrc/income-tax.ipynb Its worked examples and dividend chart disagree with the model, and its allowance table reads each parameter's oldest value.
docs/book/programs/gov/hmrc/national-insurance.ipynb Its employer rate for 6 April 2022 and its secondary threshold disagree with the parameters.
docs/book/programs/gov/ofgem/energy-price-guarantee.ipynb Its price cap series predates the parameters' current figures.
docs/book/programs/gov/revenue_scotland/land-and-buildings-transaction-tax.ipynb Its second-homes line uses the supplement before 5 December 2024.
docs/book/programs/gov/wra/land-transaction-tax.ipynb Its chart shows main residential bands before 10 October 2022 and higher rates before 11 December 2024, and its code fails on a bracket whose latest threshold is null.
docs/book/validation/validation.ipynb Its chart comes from an old run that needs survey data to check.

What a rerun must check

For each notebook:

  • Fix the code so it runs on the current package. child-benefit.ipynb imports IndividualSim, income-tax.ipynb reads values_list[-1] (each parameter's oldest value), and land-transaction-tax.ipynb fails on a bracket whose latest threshold is null.
  • Rerun it in place, for example uv run --with nbconvert --with ipykernel --with ipywidgets jupyter nbconvert --to notebook --execute --inplace <path>, without changing uv.lock or pyproject.toml. Without ipywidgets, tqdm writes a stderr warning that holds the local site-packages path.
  • Decode every stored output and confirm that none holds an error output, a traceback, a stderr stream, a local path or a username.
  • Compare every figure that a Markdown cell states with the parameters, or a household simulation, for the year the cell names. Hard-coded figures in code cells (the TV licence fee, for example) need the same check.
  • Add the notebook to myst.yml and delete its entry from NOTEBOOKS_LEFT_OUT. test_docs_toc.py fails if both name a notebook, or if neither does.
  • validation.ipynb and cell 3 of energy-price-guarantee.ipynb need the survey dataset, so only someone with access to it can rerun them.

Other docs fixes

  • docs/book/usage/scenarios.md: two examples use parameter paths the model lacks, gov.hmrc.income_tax.personal_allowance and gov.dwp.universal_credit.standard_allowance.single.OVER_25, and Scenario raises ValueError on each. Point them at parameters the model has.
  • docs/book/programs/gov/dfe/extended-childcare-entitlement.ipynb shows its child-hours example table under "### 2. Income assessment" and its adult income example under "### 3. Work condition verification". Swap the two "Example table" blocks.
Lingua principale
Python
Stelle
53
Fork
34
Merge medio
3g 7h
PR unite (30g)
304

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PolicyEngine/policyengine-uk

Tutte le issue di PolicyEngine/policyengine-uk

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.