Update docs for SciMLBase v3#850
Merged
ChrisRackauckas merged 3 commits intoSciML:masterfrom Apr 13, 2026
Merged
Conversation
- Extend docs/Project.toml SciMLBase compat to `"2.81.0, 3.1"`. - Port the ensemble tutorial to the new v3 API: `prob_func(prob, ctx)` and `output_func(sol, ctx)` in all example and signature blocks, with prose rewritten to describe `ctx.sim_id` / `ctx.repeat` instead of the old positional `i` / `repeat` arguments. One `last(sol)` usage was replaced with `sol.u[end]` since single-int indexing on non-scalar timeseries solutions changed semantics in v3. - Replace `SciMLBase.DEProblem` → `SciMLBase.AbstractDEProblem` in `common_solver_opts.md` (bare `DEProblem` type alias was removed in v3). - Replace `prob::DEProblem` → `prob::AbstractDEProblem` in the `EnsembleProblem` constructor signature in `ensemble.md`. - Add `derivative_discontinuity!` to the stepping-controls `@docs` block in `integrator.md` alongside `u_modified!` (which remains via v3's `@deprecate` shim, so both docstrings resolve). - Update the AutoAbstolAffect example in `callback_functions.md` to call `DE.derivative_discontinuity!` instead of `DE.u_modified!`. The ensemble `@example` blocks now require SciMLBase v3 at build time because v3 removed the 2-arg/3-arg arity detection; a doc build that resolves to SciMLBase v2 will error on those blocks. This matches the direction of the ecosystem-wide migration. Note: local doc builds cannot currently be run because `Pkg.resolve()` fails for any env containing SciMLBase 3.1 — OrdinaryDiffEq in the registry still pins `RecursiveArrayTools ≤ 3.54` while SciMLBase 3.1 requires RAT v4. CI on this PR will reproduce that resolution error until upstream OrdinaryDiffEq releases a RAT-v4-compatible version. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
The ensemble tutorial's @example blocks use the v3 prob_func(prob, ctx) / output_func(sol, ctx) signatures, which cannot run against SciMLBase v2 since v3 removed the 2-arg/3-arg arity detection. Bump the docs compat floor from "2.81.0, 3.1" to "3.1" to make that requirement explicit and avoid the resolver picking a version that would fail at build time. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.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
Ports the user-facing documentation to the SciMLBase v3 API, as a companion to the ecosystem-wide v3 compat sweep.
docs/src/features/ensemble.md(main surface)EnsembleProblem(prob::DEProblem; output_func = (sol, i) -> …, prob_func = (prob, i, repeat) -> …)→prob::AbstractDEProblem,(sol, ctx),(prob, ctx).prob_func(prob, i, repeat)function definitions in the@exampleblocks (random ICs, multithreading, pre-determined ICs, SDE parameter study, reduction/convergence example — 6 sites) →prob_func(prob, ctx).output_func(sol, i)definitions →output_func(sol, ctx).i/repeatinside the example bodies →ctx.sim_id/ctx.repeat.prob_funcandoutput_funcsemantics rewritten to describe theEnsembleContextfields (ctx.sim_id,ctx.repeat,ctx.rng,ctx.sim_seed,ctx.master_rng) instead of the old positionali/repeat.last(sol)usage in the convergence example replaced withsol.u[end]— single-int indexing on non-scalar timeseries solutions changed semantics in v3, solast(sol)(which falls back to iterating) is no longer reliably the final state vector.docs/src/basics/common_solver_opts.mdsolve(prob::SciMLBase.DEProblem,…)→solve(prob::SciMLBase.AbstractDEProblem,…). The bareDEProblemtype alias was removed in v3;AbstractDEProblemis the supported abstract supertype.docs/src/features/ensemble.md(constructor signature)EnsembleProblem(prob::DEProblem; …)→prob::AbstractDEProblem(same rationale as above).docs/src/basics/integrator.mdderivative_discontinuity!to the stepping-controls@docsblock alongsideu_modified!. SciMLBase v3 renamesu_modified!→derivative_discontinuity!with an@deprecateshim, so both docstrings resolve; including both gives users a pointer to the new name without breaking lookups from v2 documentation.docs/src/features/callback_functions.mdDE.u_modified!(integrator, false)→DE.derivative_discontinuity!(integrator, false)in theAutoAbstolAffectexample. Calls the preferred v3 name; on v2 this symbol doesn't exist, which is consistent with the bumped compat floor.docs/Project.tomlSciMLBase = "2.81.0"→"2.81.0, 3.1".Known limitations
Pkg.resolveuntil upstream unblocks. SciMLBase 3.1 requiresRecursiveArrayToolsv4, butOrdinaryDiffEqin the registry still pins RAT ≤ 3.54. Every@exampleblock that touches ODE/SDE/DDE solve will fail at env instantiation until OrdinaryDiffEq releases a RAT-v4-compatible version. Re-running docs CI after that should go green.prob_func/output_func, so the new syntax in these examples will error if a doc build resolves to SciMLBase v2. The compat entry"2.81.0, 3.1"therefore becomes effectively "v3-only at build time" for the ensemble page — consider tightening to"3.1"if you'd rather make that explicit.Context
Part of a courtesy sweep across the SciMLBase v3 reverse-dependency tree. Related PRs:
u_modified!→derivative_discontinuity!viaisdefinedshim (reference pattern for the rename).DEProblem→AbstractDEProblem, ensemble port, non-scalarsol[i]→sol.u[i].u_modified!hot paths on existing compat PRs at CompatHelper: bump compat for SciMLBase to 3, (keep existing compat) trixi-framework/Trixi.jl#2918, #2919; CompatHelper: bump compat for SciMLBase to 3, (keep existing compat) trixi-framework/TrixiParticles.jl#1134; Update SciMLBase requirement from 2.6 to 2.6, 3.1 WIAS-PDELib/VoronoiFVM.jl#266; CompatHelper: bump compat for SciMLBase to 3, (keep existing compat) TuringLang/Turing.jl#2802.cc @ChrisRackauckas
🤖 Generated with Claude Code