Skip to content

fix: F1/F2 skip gracefully instead of crashing the whole Option A figure suite - #118

Merged
jc-macdonald merged 1 commit into
mainfrom
fix/option-a-figures-f1-f2-skip
Aug 20, 2026
Merged

fix: F1/F2 skip gracefully instead of crashing the whole Option A figure suite#118
jc-macdonald merged 1 commit into
mainfrom
fix/option-a-figures-f1-f2-skip

Conversation

@jc-macdonald

Copy link
Copy Markdown
Collaborator

Summary

option_a_figures.py's own documented usage (--fmt png, no args) has been silently broken since the Aug 17 prune commit that removed convergence_trace.py (moved to jcm-sci/vbpca-convergence). F1/F2 hard-depend on results/convergence_trace/sweep.json; _load_trace() raised SystemExit when it's missing, which killed main()'s figure loop before F3/F5/F7 ever ran. Every PNG checked into analysis/results/figures/optionA/ predates the prune and hasn't regenerated since.

Change

_load_trace() returns None (with a one-line console notice) instead of raising when the trace file is absent; fig_f1_knee/fig_f2_broadprior skip early on None. --only f3 f5 f7 already worked around this; now the full default invocation does too.

Verification

$ python -m analysis.trade_study.option_a_figures --fmt png
Generating F1 ...
  skipping -- convergence-trace data lives in jcm-sci/vbpca-convergence now, not found at analysis/results/convergence_trace/sweep.json
Generating F2 ...
  skipping -- ...
Generating F3 ...
  saved analysis/results/figures/optionA/figure_f3_coverage.png
Generating F5 ...
  saved analysis/results/figures/optionA/figure_f5_pareto.png
Generating F7 ...
  saved analysis/results/figures/optionA/figure_f7_regime_map.png
$ echo $?
0

F7 (recommended-config rank_mae over the (n, p) plane) is worth a look while reviewing -- it visually shows the RegimeSurrogate never trained on anything past p<=n-ish, corroborating #116's finding independently.

Test plan

  • just ci passes (this script isn't covered by mypy/pytest coverage gates, which only scope src/)
  • Manual run above, both with and without results/convergence_trace/ present

🤖 Generated with Claude Code

F1/F2 hard-depended on results/convergence_trace/sweep.json, whose
generator was deliberately removed in a prior prune (that
characterization paper now lives in jcm-sci/vbpca-convergence). The
missing-data check raised SystemExit, which killed main()'s loop
before F3/F5/F7 ever ran -- the whole documented `--fmt png` usage has
been silently broken since that prune, and every figure checked into
the repo is stale.

_load_trace() now returns None (with a one-line notice) instead of
raising when the file is absent; F1/F2 skip early on None, F3/F5/F7
(which have their own local data sources) are unaffected.
@jc-macdonald
jc-macdonald merged commit e40fe33 into main Aug 20, 2026
7 checks passed
@jc-macdonald
jc-macdonald deleted the fix/option-a-figures-f1-f2-skip branch August 20, 2026 16:09
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