feat(analysis): step 6 phase 2/3 — EF diagnostics compile + plot scripts#379
Conversation
|
I can't find the script that compiles |
@WesIngwersen I pushed The folder ID is the part after /folders/ in your Drive URL. |
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds rebuild_run_index_from_drive.py — lists Google Sheets in a diagnostics Drive folder and parses each title into (approach, baseline, sheet_id, year?, scenario?) rows for ef_run_index.csv. Closes the manual- flow gap: users who triggered diagnostics via the GH Actions UI can now auto-build the run index instead of hand-typing sheet IDs. Title regex handles both formats currently in use: Manual: [DATE, BASELINE based, A matrix with APPROACH] EFs diagnostics Dispatch: [DATE, YEAR, BASELINE based, A matrix with APPROACH, SCENARIO] EFs diagnostics Also rewords the FileNotFoundError in compile_ef_diagnostics.py to point at the new script as the auto-rebuild path, with hand-write as a fallback. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
81eed45 to
ddb35d7
Compare

cc:
Closes:
What changed? Why?
Step 6 / Phase 2 + Phase 3 of epic #337. Two new scripts under
bedrock/analysis/a_matrix_time_series/:compile_ef_diagnostics.py— readsoutput/results/ef_run_index.csvfor the(approach, baseline, sheet_id)triples produced by Phase 1 diagnostics runs. PullsN_and_diffsandD_and_diffsfrom each Sheet viaread_sheet_tab, joins them on the sector index, and writes:output/results/ef_comparison.xlsx— one tab per(approach, baseline)plussummary_vs_ceda/summary_vs_useeio(per-approachp50/p95/maxof|N_perc_diff|and|D_perc_diff|plusn_significantat a 10% threshold).output/results/ef_scatter_coords.parquet— long-format(approach, baseline, ef_kind, sector, x_baseline, y_approach)for Phase 3.ef_summary_vs_*tabs to the run-report Sheet (sheet ID fromlast_run_sheet_id.txt); skipped with a warning if missing.plot_ef_diagnostics.py— reads the parquet from above and produces, for each(baseline, ef_kind)pair, two 2×2 figures: scatter (ef_scatter_{baseline}_{ef_kind}.png) and per-sector %-diff histogram (ef_pct_hist_{baseline}_{ef_kind}.png). Histograms mirror thebaseline_snapshot_comparison/compare_B_Adomconvention: ±100% clip, 60 bins, vertical zero line, consistent xlim across panels and figures.Stop tracking the two embedded-headline PNGs that earlier PRs (#364, #365) force-added past the
*.pnggitignore (keysector_impact_heatmap.png,summary_a_rmse_ranking.png). They were tracked because of the embedded-PR-body pattern but kept dirtyinggit statusafter every Step 4/5 re-run. With them removed, every plot in the analysis dir is now treated as output.Testing
black --check,ruff check .,mypy bedrock(384 files) all clean.