Skip to content

Update docs for SciMLBase v3#850

Merged
ChrisRackauckas merged 3 commits intoSciML:masterfrom
ChrisRackauckas-Claude:sciml-base-v3-compat
Apr 13, 2026
Merged

Update docs for SciMLBase v3#850
ChrisRackauckas merged 3 commits intoSciML:masterfrom
ChrisRackauckas-Claude:sciml-base-v3-compat

Conversation

@ChrisRackauckas-Claude
Copy link
Copy Markdown
Contributor

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)

  • Constructor signature: EnsembleProblem(prob::DEProblem; output_func = (sol, i) -> …, prob_func = (prob, i, repeat) -> …)prob::AbstractDEProblem, (sol, ctx), (prob, ctx).
  • All prob_func(prob, i, repeat) function definitions in the @example blocks (random ICs, multithreading, pre-determined ICs, SDE parameter study, reduction/convergence example — 6 sites) → prob_func(prob, ctx).
  • All output_func(sol, i) definitions → output_func(sol, ctx).
  • Inline references to i / repeat inside the example bodies → ctx.sim_id / ctx.repeat.
  • Prose walkthrough of the prob_func and output_func semantics rewritten to describe the EnsembleContext fields (ctx.sim_id, ctx.repeat, ctx.rng, ctx.sim_seed, ctx.master_rng) instead of the old positional i / repeat.
  • One last(sol) usage in the convergence example replaced with sol.u[end] — single-int indexing on non-scalar timeseries solutions changed semantics in v3, so last(sol) (which falls back to iterating) is no longer reliably the final state vector.

docs/src/basics/common_solver_opts.md

  • solve(prob::SciMLBase.DEProblem,…)solve(prob::SciMLBase.AbstractDEProblem,…). The bare DEProblem type alias was removed in v3; AbstractDEProblem is the supported abstract supertype.

docs/src/features/ensemble.md (constructor signature)

  • EnsembleProblem(prob::DEProblem; …)prob::AbstractDEProblem (same rationale as above).

docs/src/basics/integrator.md

  • Added derivative_discontinuity! to the stepping-controls @docs block alongside u_modified!. SciMLBase v3 renames u_modified!derivative_discontinuity! with an @deprecate shim, 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.md

  • DE.u_modified!(integrator, false)DE.derivative_discontinuity!(integrator, false) in the AutoAbstolAffect example. Calls the preferred v3 name; on v2 this symbol doesn't exist, which is consistent with the bumped compat floor.

docs/Project.toml

  • SciMLBase = "2.81.0""2.81.0, 3.1".

Known limitations

  • Doc build will fail at Pkg.resolve until upstream unblocks. SciMLBase 3.1 requires RecursiveArrayTools v4, but OrdinaryDiffEq in the registry still pins RAT ≤ 3.54. Every @example block 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.
  • Ensemble examples are now v3-only. v3 removed the 2-arg vs 3-arg arity detection for 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.
  • Not tested locally for the same resolution reason. CI on this PR is the only venue where the rebuilt docs can be exercised.

Context

Part of a courtesy sweep across the SciMLBase v3 reverse-dependency tree. Related PRs:

cc @ChrisRackauckas

🤖 Generated with Claude Code

ChrisRackauckas and others added 2 commits April 13, 2026 00:18
- 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>
@ChrisRackauckas ChrisRackauckas merged commit a07d9dd into SciML:master Apr 13, 2026
1 of 3 checks passed
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.

2 participants