Repository navigation
Expand file tree
/
Copy pathTaskfile.yml
More file actions
419 lines (378 loc) · 16.9 KB
/
Copy pathTaskfile.yml
File metadata and controls
419 lines (378 loc) · 16.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
version: "3"
# Common development tasks. Run `task --list` to see them.
tasks:
refresh-releases:
desc: >
Pull the published per-release outbreak-size estimates from the
tagged results releases into data/released_estimates.csv. Needs the
`gh` CLI authenticated against the repo.
cmds:
- julia --project=scripts scripts/refresh_releases.jl {{.CLI_ARGS}}
release-notes:
desc: >
Print the release notes for the version in Project.toml, taken from the
newest section of docs/src/news.md. This is what an `@release` comment
publishes, so the notes can be read before anything is cut. Pass
`-- next patch` to see the following version, or `-- open patch` to
write the bump and the new section locally.
cmds:
- julia --project=scripts scripts/release_notes.jl
{{if .CLI_ARGS}}{{.CLI_ARGS}}{{else}}notes{{end}}
download-sitreps:
desc: >
Download the MVE situation-report PDFs from the INSP site (insp.cd,
the source of truth) into data/sitrep_pdfs/ (git-ignored) for direct
scanning. Skips reports already present, so it fetches only new
sitreps.
cmds:
- julia --project=scripts scripts/download_sitreps.jl {{.CLI_ARGS}}
confirm-data:
desc: >
Cross-check the hand-scanned confirmed-case and confirmed-death
totals in data/insp_sitrep_scanned.csv against the INRB-UMIE national
cumulative series. Reports the dates each source carries alone and
exits non-zero on any disagreement the script does not already
document as a mirror transcription error.
cmds:
- julia --project=scripts scripts/confirm_insp_data.jl {{.CLI_ARGS}}
province-tableau1:
desc: >
Regenerate the [province_confirmed_history] and [province_death_history]
blocks for data/observations.toml by scanning Tableau 1 of the INSP
situation reports (per-province confirmed cases and deaths). Fails
unless the per-province figures sum exactly to the national
confirmed_case_history and confirmed_death_history on every date. The
deaths column is what makes the per-province ascertainment identifiable.
Needs the PDFs (`task download-sitreps`) and pdftotext.
cmds:
- julia --project=scripts scripts/scan_province_tableau1.jl {{.CLI_ARGS}}
zone-tableau2:
desc: >
Regenerate the [zone_confirmed_history] and [zone_death_history]
blocks for data/observations.toml by scanning Tableau 2 of the INSP
situation reports (per-health-zone confirmed cases and deaths within
each province). Fails unless the zone rows plus the unallocated row
sum exactly to the committed province_confirmed_history and
province_death_history on every date; a vintage whose zone rows do
not sum to its own printed province row is reported and left out.
Needs the PDFs (`task download-sitreps`) and pdftotext.
cmds:
- julia --project=scripts scripts/scan_zone_tableau2.jl {{.CLI_ARGS}}
confirm-zone-data:
desc: >
Cross-check the [zone_confirmed_history] and [zone_death_history]
blocks against the INRB-UMIE per-zone cumulative CSVs and list every
disagreement. The mirror is a second transcription, not a gate, so
this always exits zero; see data/README.md for the known artefacts.
cmds:
- julia --project=scripts scripts/confirm_zone_data.jl {{.CLI_ARGS}}
health-zones:
desc: >
Rebuild data/health_zones.csv and src/assets/health_zones.geojson from the
INRB-UMIE health-zone GeoJSON (pass its path). Python standard library
only.
cmds:
- python3 scripts/build_health_zones.py {{.CLI_ARGS}}
province-centres:
desc: >
Print the PROVINCE_SOURCE_CENTRES literal for src/constants.jl from the
INRB-UMIE health-zone GeoJSON (pass its path). Python standard library
only.
cmds:
- python3 scripts/build_province_centres.py {{.CLI_ARGS}}
province-lab-data:
desc: >
Regenerate the [province_lab_daily_history] block for
data/observations.toml by scanning section 4.3 (Laboratoire) of the
INSP situation-report PDFs for the per-province samples analysed and
positives. Validates that the per-province analysed counts sum exactly
to the national tests_analysed_daily_history on every date (they are an
exact partition of it) and exits non-zero on any disagreement. Needs
the PDFs (`task download-sitreps`) and pdftotext.
cmds:
- julia --project=scripts scripts/scan_province_lab.jl {{.CLI_ARGS}}
onset-digitise:
desc: >
Digitise the symptom-onset epidemic-curve figure of every CONFIG
vintage into data/onset_curve_scanned.csv with the Julia reference
(scripts/digitize_onset_curve.jl). Incremental: opens only the PDFs
of vintages the file does not hold yet. Pass `-- --rebuild` after
changing the digitiser to re-read them all. Needs the PDFs
(`task download-sitreps`) and poppler.
cmds:
- julia scripts/digitize_onset_curve.jl data/sitrep_pdfs
data/onset_curve_scanned.csv {{.CLI_ARGS}}
onset-port-check:
desc: >
Rebuild the onset curve with both the Julia reference and the Python
port into a temporary directory and check that the two files and the
committed data/onset_curve_scanned.csv are byte-identical. Needs the
PDFs, poppler and uv.
cmds:
- |
set -e
tmp=$(mktemp -d)
julia scripts/digitize_onset_curve.jl data/sitrep_pdfs \
"$tmp/julia.csv" --rebuild
uv run --no-project scripts/digitize_onset_curve.py \
data/sitrep_pdfs "$tmp/python.csv" --rebuild
cmp "$tmp/julia.csv" "$tmp/python.csv"
cmp "$tmp/julia.csv" data/onset_curve_scanned.csv
rm -r "$tmp"
echo "reference, port and committed file are identical"
onset-cross-check:
desc: >
Compare every digitised onset block with the INRB-UMIE dashboard's
national onset curve from the snapshot nearest its report date
(data/onset_dashboard_history.csv). Prints one row per block with
the totals, the correlation and the mean absolute daily difference
on settled dates and on the last 14 days, and exits non-zero when a
settled-date difference exceeds 2 cases per day. Pass `-- --latest N`
for the N newest blocks.
cmds:
- uv run --no-project scripts/compare_onset_sources.py {{.CLI_ARGS}}
onset-audit:
desc: >
Audit the digitised onset curve against the figures it was read
from. Writes data/onset_curve_figures.csv (one row per vintage: the
figure's page, image size and md5, the pixel scales, the printed n,
the digitised total, the gap and any reprint) and
output/onset_curve_audit.md (the gap table, the settled-bar checks
between consecutive snapshots and the worst vintages). Exits
non-zero when a gap is past 2.1% or a pair aligns off shift 0.
Needs the PDFs (`task download-sitreps`), poppler and tesseract.
cmds:
- julia --project=scripts scripts/audit_onset_curve.jl {{.CLI_ARGS}}
benchmark:
desc: >
Run the per-component AD gradient benchmark suite and save the results
to results.json (pass another path to change it). Times one
log-density evaluation and one gradient per model component per AD
backend. Set BVD_BENCH_JOINT=true to add the full bvd_joint, which
costs ~18 min of cold compile on its own, and BVD_BENCH_ENZYME=true
to add the Enzyme backend, which did not finish inside a 90 minute
CI job. The health-zone model and its kernels run by default;
BVD_BENCH_ZONE=false leaves them out.
cmds:
- julia --project=benchmark -e 'using Pkg; Pkg.instantiate()'
- julia --project=benchmark benchmark/run.jl {{.CLI_ARGS}}
benchmark-rules:
desc: >
Time every component with the hand-written Mooncake rules loaded and again
without them. Run this when the AD backend is upgraded: if the gap has
closed, delete the rules in src/mooncake_rules.jl. The rules are
selected by a load-time preference, so each
arm is its own process.
cmds:
- julia --project=benchmark -e 'using Pkg; Pkg.instantiate()'
- >
julia --project=benchmark -e 'using Preferences, UUIDs;
set_preferences!(UUID("7c2a1f8e-9d4b-4a16-bf3e-1f5c8c3a90e2"),
"mooncake_rules" => false; force = true)'
- julia --project=benchmark benchmark/rules_ab.jl
- >
julia --project=benchmark -e 'using Preferences, UUIDs;
set_preferences!(UUID("7c2a1f8e-9d4b-4a16-bf3e-1f5c8c3a90e2"),
"mooncake_rules" => true; force = true)'
- julia --project=benchmark benchmark/rules_ab.jl
benchmark-compile:
desc: >
Measure the cold AD-compile cost of each model component, one fresh
process each, and save it to compile.json (pass another path to change
it). This is the cost `task benchmark` cannot see: Mooncake builds the
reverse rule when the log-density function is constructed, which is
about 87% of a component's cold build and 969 s of the full joint's
1095 s. Set BVD_BENCH_JOINT=true to add the joint.
cmds:
- julia --project=benchmark -e 'using Pkg; Pkg.instantiate()'
- julia --project=benchmark benchmark/compile.jl {{.CLI_ARGS}}
benchmark-pair:
desc: >
Reproduce the CI comparison locally: benchmark two revisions of this
repository in one process and write the PR comment. Usage:
task benchmark-pair -- <base-rev> <head-rev>. Worktrees go under
.benchmark-worktrees/ and results under benchmark-results/. Costs
roughly twice a single `task benchmark`.
cmds:
- ./scripts/run_benchmark_pair.sh {{.CLI_ARGS}}
docs:
desc: >
Build the full docs site locally: render every literate page from the
cached fits and assemble the Vitepress site.
The render never fits: a missing fit fails naming its key, so run
`task fetch-fits` or `task fit-all` first. Set BVD_FIT_STRICT=false to
fit inline instead, or BVD_REFIT=all to refit. deploydocs is a no-op
outside CI.
cmds:
- BVD_DOCS_STAGE=all julia --project=docs docs/make.jl {{.CLI_ARGS}}
docs-main:
desc: >
Render the national estimates page
(docs/src/estimates/national.md) from the cached fits, without
assembling the site. Fast iteration on the main page.
cmds:
- BVD_DOC_PAGE=estimates/national julia --project=docs docs/execute.jl
{{.CLI_ARGS}}
docs-comparisons:
desc: >
Render the comparisons page (docs/src/comparisons.md) from the
cached fits, without assembling the site.
cmds:
- BVD_DOC_PAGE=comparisons julia --project=docs docs/execute.jl
{{.CLI_ARGS}}
docs-zone:
desc: >
Render the health-zone estimates page (docs/src/estimates/zone.md) from the
cached fits, without assembling the site.
cmds:
- BVD_DOC_PAGE=estimates/zone julia --project=docs docs/execute.jl
{{.CLI_ARGS}}
test-tables:
desc: Run the docs large-table sort and parse tests under Node.
cmds:
- node --test docs/test/table_sort.test.mjs
fetch-fits:
desc: >
Download the fits from the latest successful docs CI run into
logs/fit_cache, so a local render loads them instead of fitting.
Canonical local build: `task fetch-fits && task docs`. Pass a run id to
pull a specific build, or set BVD_FIT_REF to pull from another branch.
A fit is loaded only when the working tree's model source and data match
the commit that produced it; change either and `task fit-all` is needed.
Needs the `gh` CLI authenticated against the repo.
cmds:
- ./scripts/fetch_fits.sh {{.CLI_ARGS}}
fit:
desc: >
Run and cache a single model fit by id (BVD_FIT_ID), matching one CI
matrix job. List ids with `julia --project=docs docs/fits/list.jl`
(BVD_FIT_STAGE=dependent lists the fits melded from a cached parent,
which must be fitted first).
Example: BVD_FIT_ID=deaths task fit. Threads match the CI fit job, so
the fit's two chains run in parallel.
cmds:
- julia -t 4 --project=docs docs/fits/one.jl {{.CLI_ARGS}}
smoke-joint:
desc: >
Short multi-chain fit of the headline joint at the production sampler
settings, printing each chain's start, step size, depth-cap share,
divergences, R-hat, worst mixers and the parameters that have split
between chains before. Run before pushing a model change.
SMOKE_CHAINS, SMOKE_WARMUP, SMOKE_DRAWS and SMOKE_MAX_DEPTH override
the defaults of 4, 150, 150 and 10.
cmds:
- julia -t 4 --project=docs scripts/smoke_joint.jl {{.CLI_ARGS}}
check-convergence:
desc: >
Decide whether the cached fits converged well enough to publish, the
same gate CI runs after the fit matrix. Reads the chains from
logs/fit_cache without refitting, prints the verdict, the headline
diagnostics and the parameters responsible, and exits non-zero on a
failure. Set BVD_CONVERGENCE_IDS to gate fits other than `joint`.
cmds:
- julia --project=docs docs/fits/check_convergence.jl {{.CLI_ARGS}}
fit-all:
desc: >
Fit and cache every model, then `task docs` renders from the cache
without refitting. Two parallel passes: the base fits, then the
dependent fits melded from a cached parent (the health-zone fits from
the joints). Canonical local full build: `task fit-all && task docs`.
`fit_parallel` runs threads / chains fits at once, so this takes all
available threads. Set JULIA_NUM_THREADS to cap it on a shared host.
cmds:
- julia -t "${JULIA_NUM_THREADS:-auto}" --project=docs docs/fits/all.jl
{{.CLI_ARGS}}
fit-dependent:
desc: >
Fit and cache only the dependent fits, those melded from a cached
parent (the health-zone `local` from `joint`, `local_frozen_validation`
from `frozen_validation`). The parents must already be cached; a
missing one is an error, not a refit.
cmds:
- BVD_FIT_STAGE=dependent julia --project=docs docs/fits/all.jl
{{.CLI_ARGS}}
format:
desc: >
Run Runic over src/, test/, docs/, scripts/, benchmark/ and ext/.
cmds:
- ./scripts/run_formatter.sh
lint:
desc: Alias for format.
cmds:
- task: format
test:
desc: Run the full test suite.
cmds:
- julia --project=. -e 'using Pkg; Pkg.test()'
test-quick:
desc: Run the test suite without the quality (Aqua/JET/format) checks.
cmds:
- julia --project=. -e 'using Pkg; Pkg.test(; test_args = ["skip_quality"])'
test-dashboard:
desc: Run the dashboard map's date logic tests under Node.
cmds:
- node --test docs/test/zone_map_timeline.test.js
tensorboard:
desc: >
Launch TensorBoard on the per-fit logs from a dev/report build in this
worktree. Fit logging is on by default (`BVD_FIT_LOG` unset → `all`), so
a build writes `logs/tensorboard/<fit>/` and `logs/<fit>.log` without
any flag; `BVD_FIT_LOG=none` turns it off (the CI render jobs do this,
and the CI fit jobs use `progress`).
Run this in the same directory you built from. Pins Python 3.12 and
`setuptools<81` because newer setuptools drops `pkg_resources`, which
TensorBoard still imports. Needs `uv`.
cmds:
- uvx --python 3.12 --with 'setuptools<81' --from tensorboard
tensorboard --logdir logs/tensorboard {{.CLI_ARGS}}
# ---- Paper ----------------------------------------------------------------
# Paper rendering is decoupled from the fits and the docs build: it depends
# only on the committed sources under paper/ and the figures and quoted
# numbers written into paper/ from a pinned release. Editing prose or
# references re-renders without refitting anything.
paper:
desc: Render the preprint to PDF and HTML
cmds:
- task: paper-html
- task: paper-pdf
paper-pdf:
desc: Render the preprint to PDF only
dir: paper
sources:
- "**/*.qmd"
- "**/*.bib"
- "**/*.yml"
- "figures/**"
- "generated/**"
cmds:
- quarto render main.qmd --to pdf
- quarto render si.qmd --to pdf
paper-html:
desc: Render the preprint to HTML only
dir: paper
sources:
- "**/*.qmd"
- "**/*.bib"
- "**/*.yml"
- "figures/**"
- "generated/**"
cmds:
- quarto render main.qmd --to html
- quarto render si.qmd --to html
paper-site:
desc: >
Render the preprint and its Supporting Information to self-contained
HTML under docs/src/public/paper/, where the report site serves them
at /paper/
dir: paper
cmds:
- quarto render main.qmd --to html -M embed-resources:true
- quarto render si.qmd --to html -M embed-resources:true
- mkdir -p ../docs/src/public/paper
- mv main.html ../docs/src/public/paper/index.html
- mv si.html ../docs/src/public/paper/si.html
paper-preview:
desc: Live-preview the preprint in the browser while editing
dir: paper
cmds:
- quarto preview main.qmd