Fix docs build: import EnsembleProblem/EnsembleThreads in shapley.md - #266
Merged
ChrisRackauckas merged 1 commit intoAug 26, 2026
Merged
Conversation
The shapley.md tutorial's @example block uses EnsembleProblem and EnsembleThreads but never imports them, unlike parallelized_gsa.md and juliacon21.md which explicitly import via `using SciMLBase: EnsembleProblem, EnsembleThreads`. With SciMLBase v3, these names are no longer transitively brought into scope by OrdinaryDiffEq's re-exports, so the doc build fails with UndefVarError: EnsembleThreads not defined, which cascades into UndefVarError: shapley_effects not defined in the following blocks. Co-authored-by: Cursor <cursoragent@cursor.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
Fixes the failing Documentation CI build (see failing run).
Root cause: The
@example shapleyblock indocs/src/tutorials/shapley.mdusesEnsembleProblemandEnsembleThreadsbut never imports them. Other tutorials (parallelized_gsa.md,juliacon21.md) explicitly import these viausing SciMLBase: EnsembleProblem, EnsembleThreads, butshapley.mdwas missing this import. WithSciMLBasev3, these names are no longer transitively brought into scope throughOrdinaryDiffEq's re-exports, so the doc build fails with:which then cascades into
UndefVarError: shapley_effects not definedin the subsequent example blocks that depend on it, terminating themakedocsbuild with a[:example_block]error.Fix: Add the missing
using SciMLBase: EnsembleProblem, EnsembleThreadsimport to the first code block ofshapley.md, matching the pattern already used elsewhere in the docs.Test plan
docs/environment locally and reproduced the exact failure (UndefVarError: EnsembleThreads not defined) with the import missing.shapley.mdexample code (same imports, ODE/NN setup,batched_loss_n_ode, and agsa(..., Shapley(...))call with reducedn_perms/n_var/n_outerfor speed) — confirmsEnsembleProblem/EnsembleThreadsresolve correctly andshapley_effectscomputes successfully end-to-end.docs/make.jl(the untouched tutorial as written trains a Neural ODE for 300 iterations and computes Shapley effects withn_outerup to 100, which is prohibitively slow for local verification), but the fix is a one-line addition identical to the working pattern used in two other tutorials in this same repo.Made with Cursor