Skip to content

Restore the documented SciML common interface as explicit exports - #124

Merged
ChrisRackauckas merged 2 commits into
masterfrom
restore-common-interface-exports
Aug 23, 2026
Merged

ChrisRackauckas merged 2 commits into
masterfrom
restore-common-interface-exports

Conversation

@ChrisRackauckas

Copy link
Copy Markdown
Member

What broke

d732fae ("Require documented ODEInterface wrapper API", #116) removed
@reexport using DiffEqBase from src/ODEInterfaceDiffEq.jl.

That reexport was this package's common-interface surface. Without it, using ODEInterfaceDiffEq no longer brings ODEProblem, solve, ReturnCode or the
callbacks into scope, so the README's own Lorenz example fails with
UndefVarError:

using ODEInterface, ODEInterfaceDiffEq
ODEInterface.loadODESolvers()
prob = ODEProblem(lorenz, u0, tspan)   # UndefVarError: `ODEProblem` not defined
sol = solve(prob, dopri5(), abstol = 1e-4)

Before this PR names(ODEInterfaceDiffEq) was 11 entries: the algorithms and
nothing else. CI stayed green because the same commit added using DiffEqBase to
test/callbacks.jl — which is itself direct evidence that those names used to
come from the reexport.

What this PR does

Per the org rule ("reexport what is normal documented use, but not whole
dependencies"), this follows SciML/Sundials.jl#553: not a restored blanket
reexport, but an explicit export list.

Evidence used to pick the names

  1. README.md — the only usage example, using ODEInterface, ODEInterfaceDiffEq
    then ODEProblem + solve + solution indexing.
  2. test/ — test/callbacks.jl had using DiffEqBase added by the stripping
    commit; the other test files use ODEProblem, ODEFunction, ReturnCode,
    successful_retcode, ContinuousCallback after using ODEInterfaceDiffEq, DiffEqBase.
  3. src/ — which integrator hooks and DAE-initialization algorithms this package
    actually implements methods for (src/integrator_utils.jl,
    src/initialize.jl). Names with no method here are excluded: they error
    identically before and after.

Restored names (36)

CallbackSet, CheckInit, ContinuousCallback, DECallback, DEIntegrator,
DEStats, DefaultInit, DiscreteCallback, EnsembleAnalysis,
EnsembleDistributed, EnsembleProblem, EnsembleSerial, EnsembleSolution,
EnsembleSplitThreads, EnsembleSummary, EnsembleThreads, NoInit,
NullParameters, ODEFunction, ODEProblem, ODESolution, OverrideInit,
ReturnCode, VectorContinuousCallback, change_t_via_interpolation!,
get_tmp_cache, init, remake, savevalues!, set_proposed_dt!, solve,
solve!, step!, successful_retcode, terminate!, u_modified!

Deliberately excluded: BrownFullBasicInit / ShampineCollocationInit (no
initialize_dae! method here), integrator hooks with no ODEInterfaceIntegrator
method (add_tstop!, reinit!, get_du, check_error, …), and the
SDE/DDE/BVP/optimization surface DiffEqBase carried along — ~160 names that stay
dropped.

Every name is imported from its owning module (SciMLBase, except DefaultInit
which DiffEqBase owns), so each stays documented upstream.

Drift protection

test/qa/qa.jl declares the same list via reexports_allow, and a new testset
asserts every approved name is both in names(ODEInterfaceDiffEq) and actually
in scope from using ODEInterfaceDiffEq.

Semver

Non-breaking. This only re-adds names that using ODEInterfaceDiffEq provided
before d732fae; no existing name changes meaning and nothing is removed. Minor
bump. Version intentionally not bumped here — a separate release pass handles it.

Verification run locally

  • Pkg.test() — full suite green (Core: algorithm, callbacks, initialization,
    jac, mass matrix, MTK initialization, saving).
  • using ODEInterfaceDiffEq then the README-shaped ODEProblem + solve +
    successful_retcode flow with no other import — works;
    names(ODEInterfaceDiffEq) goes 11 → 47.
  • test/qa/qa.jl — the reexport testset and "No unapproved public reexports"
    pass. One pre-existing error remains in all_qualified_accesses_are_public
    (Base.Iterators.filter at src/solve.jl:338); it reproduces identically on
    master with the SciMLTesting version installed here (2.11 vs. the 2.4 pinned
    in test/qa/Project.toml) and is unrelated to this change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Rmh6B9eoW3N8oCbuuVPVxJ

ChrisRackauckas and others added 2 commits August 23, 2026 18:09
`d732fae` ("Require documented ODEInterface wrapper API", #116) dropped
`@reexport using DiffEqBase` from `src/ODEInterfaceDiffEq.jl`. That reexport was
this package's entire common-interface surface: with it gone, `using
ODEInterfaceDiffEq` no longer brings `ODEProblem`, `solve`, `ReturnCode` or the
callbacks into scope, so the README's own Lorenz example -- `using ODEInterface,
ODEInterfaceDiffEq; prob = ODEProblem(lorenz, u0, tspan); solve(prob, dopri5())`
-- fails with `UndefVarError`. The package's tests never noticed because the same
commit added `using DiffEqBase` to `test/callbacks.jl`.

Rather than restore the blanket reexport (which put all 196 DiffEqBase names,
including problem types for equation classes ODEInterface cannot touch, into
every user's namespace), export exactly the names normal documented use needs:

  * the problem, function and solution types these solvers accept -- `ODEProblem`,
    `ODEFunction`, `ODESolution`, `NullParameters`;
  * `solve`/`init`/`solve!`/`step!`/`remake`;
  * the ensemble interface, which works through the generic `solve` path;
  * the callbacks, which this package implements (`src/integrator_utils.jl`):
    `CallbackSet`, `ContinuousCallback`, `DiscreteCallback`,
    `VectorContinuousCallback`, `DECallback`, `DEIntegrator`, `DEStats`;
  * the integrator functions this package actually defines methods for --
    `savevalues!`, `change_t_via_interpolation!`, `get_tmp_cache`, `u_modified!`,
    `set_proposed_dt!`, plus `terminate!`, which callbacks call;
  * `ReturnCode` and `successful_retcode`, used throughout the tests; and
  * the DAE initialization algorithms `src/initialize.jl` implements
    `initialize_dae!` for: `DefaultInit`, `NoInit`, `CheckInit`, `OverrideInit`.

Deliberately left out: `BrownFullBasicInit`/`ShampineCollocationInit` (no
`initialize_dae!` method here), the integrator hooks with no method for
`ODEInterfaceIntegrator` (`add_tstop!`, `reinit!`, `get_du`, `check_error`, ...),
and every SDE/DDE/BVP/optimization type DiffEqBase carried along.

Each name is imported from the module that owns it -- SciMLBase for all but
`DefaultInit`, which DiffEqBase owns -- so nothing changes about who documents
them. This only adds names back that `using ODEInterfaceDiffEq` used to provide,
so it is a minor bump, not a break.

`test/qa/qa.jl` declares the same list through `reexports_allow`, and a new
testset asserts every approved name is both in `names(ODEInterfaceDiffEq)` and in
scope from `using ODEInterfaceDiffEq`, so the allow-list cannot drift from the
exports.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rmh6B9eoW3N8oCbuuVPVxJ
A restored export that is not documented is only half the fix: a reader cannot
see what `using ODEInterfaceDiffEq` gives them or which package actually owns
each name, and the next QA sweep has no way to tell the reexport was deliberate.

Add a "Reexported SciML common interface" section to the rendered docs page,
grouped by role (problems, functions, solutions, ensembles, solving, integrator
interface, return status, callbacks, initialization algorithms), naming and
linking SciMLBase and DiffEqBase as the owners, and stating the boundary: the
integrator functions listed are exactly the ones this package implements methods
for, `BrownFullBasicInit`/`ShampineCollocationInit` are deliberately excluded,
and anything else must be imported from SciMLBase or DiffEqBase directly.

The docs list, the `export` block in src/ODEInterfaceDiffEq.jl and the
`REEXPORTS` tuple in test/qa/qa.jl are the same list in three places.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rmh6B9eoW3N8oCbuuVPVxJ
@ChrisRackauckas
ChrisRackauckas merged commit 2a82457 into master Aug 23, 2026
9 checks passed
@ChrisRackauckas
ChrisRackauckas deleted the restore-common-interface-exports branch August 23, 2026 22:04
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.

1 participant