Commit 5d175eb
fix: populate NUTS samples_info keys under test-mode bypass (#1260)
`PYAUTO_TEST_MODE=2` skips the sampler in `_fit_bypass_test_mode`,
producing a samples_info stub with only `total_iterations`, `time`,
and `log_evidence`. Tutorial and downstream code that reads NUTS
diagnostics (`ess_min`, `num_samples`, `mean_acceptance`,
`n_divergent`, `n_logl_evals`) crashed with `KeyError`.
Add a `_test_mode_samples_info()` hook on `AbstractSearch`, merged
into the bypass `samples_info`. Override in `BlackJAXNUTS` to return
the diagnostic keys with NaN/0 placeholders — bypass mode never
ran the sampler, so honest empties propagate to the tutorial print.
Fixes the `autofit_workspace/scripts/searches/mcmc.py` smoke test.
Co-authored-by: Jammy2211 <JNightingale2211@gmail.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 7646624 commit 5d175eb
2 files changed
Lines changed: 34 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
858 | 858 | | |
859 | 859 | | |
860 | 860 | | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
861 | 867 | | |
862 | 868 | | |
863 | 869 | | |
864 | | - | |
865 | | - | |
866 | | - | |
867 | | - | |
868 | | - | |
| 870 | + | |
869 | 871 | | |
870 | 872 | | |
871 | 873 | | |
| |||
888 | 890 | | |
889 | 891 | | |
890 | 892 | | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
891 | 906 | | |
892 | 907 | | |
893 | 908 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
381 | 395 | | |
382 | 396 | | |
383 | 397 | | |
| |||
0 commit comments