docs: skip BlackJAXNUTS example when blackjax absent (Python matrix)#89
Merged
Merged
Conversation
The Python Version Matrix installs the NumPy-only stack, so scripts/searches/mcmc.py failed with ModuleNotFoundError on the optional blackjax backend. Add a find_spec guard that skips the blackjax section gracefully (print + exit 0) when it is not installed; the example runs in full under the release stack. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The PyAutoBuild Python Version Matrix installs the NumPy-only stack, so
scripts/searches/mcmc.pyfailed withModuleNotFoundError: No module named 'blackjax'— theBlackJAXNUTSsection needs the optional blackjax package (ships viaautofit[optional]).Adds an
importlib.util.find_spec("blackjax")guard before the NUTS section that skips it gracefully (prints a message andsys.exit(0)) when blackjax is absent. TheEmceeandZeussections above run normally; under the full release stack the whole example runs unchanged.Verification
Ran against a clean 2026.7.9.1 venv (with emcee/zeus, without blackjax): Emcee and Zeus run, then the NUTS section prints the skip message and exits 0.
Scripts Changed
scripts/searches/mcmc.py— backend-absent guard on the NUTS section only. Notebook regenerates from the script on the release build.🤖 Generated with Claude Code