From 955082ea87cac99fa8d93f7e56df6238435b644c Mon Sep 17 00:00:00 2001 From: ChrisRackauckas Date: Sun, 23 Aug 2026 18:09:33 +0000 Subject: [PATCH 1/2] Restore the documented SciML common interface as explicit exports `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 Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01Rmh6B9eoW3N8oCbuuVPVxJ --- src/ODEInterfaceDiffEq.jl | 28 ++++++++++++++++++++++++++-- test/qa/qa.jl | 28 ++++++++++++++++++++++++++-- 2 files changed, 52 insertions(+), 4 deletions(-) diff --git a/src/ODEInterfaceDiffEq.jl b/src/ODEInterfaceDiffEq.jl index dd76cda..d2a630a 100644 --- a/src/ODEInterfaceDiffEq.jl +++ b/src/ODEInterfaceDiffEq.jl @@ -11,11 +11,25 @@ module ODEInterfaceDiffEq import SciMLStructures using DataStructures: BinaryMaxHeap, BinaryMinHeap, counter using LinearAlgebra: I - using SciMLBase: CallbackSet, ReturnCode, VectorContinuousCallback, check_keywords, - warn_compat + using SciMLBase: check_keywords, warn_compat using SciMLLogging: SciMLLogging, @SciMLMessage import DiffEqBase: initialize!, savevalues! + # The SciML common interface that ODEInterfaceDiffEq reexports (see the second + # `export` below), so that `using ODEInterfaceDiffEq` on its own is enough to build + # an ODE problem, solve it with one of the ODEInterface solvers, drive the + # integrator from a callback, and inspect the result -- which is exactly what the + # README example does. The integrator functions listed here are the ones this + # package implements methods for. Every name stays owned and documented upstream. + using SciMLBase: CallbackSet, CheckInit, ContinuousCallback, DECallback, DEIntegrator, + DEStats, 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, set_proposed_dt!, solve, solve!, step!, + successful_retcode, terminate!, u_modified! + using DiffEqBase: DefaultInit + const warnkeywords = ( :save_idxs, :d_discontinuities, :unstable_check, :tstops, :calck, :progress, :dense, :save_start, @@ -49,4 +63,14 @@ module ODEInterfaceDiffEq export ODEInterfaceAlgorithm, dopri5, dop853, odex, seulex, radau, radau5, rodas, ddeabm, ddebdf + # Reexported SciML common interface; approved via `reexports_allow` in test/qa/qa.jl. + export 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! + end # module diff --git a/test/qa/qa.jl b/test/qa/qa.jl index ef209f7..4a70103 100644 --- a/test/qa/qa.jl +++ b/test/qa/qa.jl @@ -1,3 +1,27 @@ -using ODEInterfaceDiffEq, SciMLTesting +using ODEInterfaceDiffEq, SciMLTesting, Test -run_qa(ODEInterfaceDiffEq) +# The SciML common interface ODEInterfaceDiffEq deliberately reexports so that +# `using ODEInterfaceDiffEq` is enough to build and solve an ODE problem, as the README +# example does. Owned and documented upstream; kept in sync with the reexport `export` +# block in src/ODEInterfaceDiffEq.jl. +const REEXPORTS = ( + :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!, +) + +run_qa(ODEInterfaceDiffEq; reexports_allow = REEXPORTS) + +@testset "Reexport surface" begin + # Every approved reexport must actually be reachable from `using ODEInterfaceDiffEq`, + # so the allow-list cannot drift into approving names the package no longer provides. + @testset "$name" for name in REEXPORTS + @test name in names(ODEInterfaceDiffEq) + @test isdefined(@__MODULE__, name) + end +end From 75df51d98f41d005e3571d754ca29863e031ba1e Mon Sep 17 00:00:00 2001 From: ChrisRackauckas Date: Sun, 23 Aug 2026 18:32:46 +0000 Subject: [PATCH 2/2] Document the reexported SciML common interface 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 Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01Rmh6B9eoW3N8oCbuuVPVxJ --- docs/src/index.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/docs/src/index.md b/docs/src/index.md index b10015e..5fd80ae 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -12,3 +12,32 @@ rodas ddeabm ddebdf ``` + +## Reexported SciML common interface + +`using ODEInterfaceDiffEq` also brings in the parts of the SciML common interface needed +to build a problem, solve it with one of the solvers above, and inspect the result, so +they do not have to be imported separately. These names are owned and documented by +[SciMLBase](https://docs.sciml.ai/SciMLBase/stable/) and +[DiffEqBase](https://docs.sciml.ai/DiffEqDocs/stable/) — `DefaultInit` comes from +DiffEqBase, everything else from SciMLBase: + + - Problems: `ODEProblem`, `EnsembleProblem` + - Functions: `ODEFunction` + - Solutions: `ODESolution`, `EnsembleSolution`, `EnsembleSummary`, `DEStats` + - Ensemble algorithms: `EnsembleSerial`, `EnsembleThreads`, `EnsembleDistributed`, + `EnsembleSplitThreads`, and the `EnsembleAnalysis` module + - Solving: `solve`, `solve!`, `init`, `step!`, `remake` + - Integrator interface: `DEIntegrator`, `savevalues!`, `change_t_via_interpolation!`, + `get_tmp_cache`, `set_proposed_dt!`, `u_modified!`, `terminate!` + - Return status: `ReturnCode`, `successful_retcode` + - Callbacks: `ContinuousCallback`, `DiscreteCallback`, `VectorContinuousCallback`, + `CallbackSet`, `DECallback` + - Initialization algorithms: `DefaultInit`, `NoInit`, `CheckInit`, `OverrideInit` + - `NullParameters` + +The integrator functions listed above are exactly the ones ODEInterfaceDiffEq implements +methods for, and the initialization algorithms are exactly the ones it implements +`initialize_dae!` for. `BrownFullBasicInit` and `ShampineCollocationInit` are +deliberately not reexported, since they have no method here. Anything else from SciMLBase +or DiffEqBase must be imported from that package directly.