Repository navigation
Restore the documented SciML common interface as explicit exports - #124
Merged
Merged
Conversation
`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
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.
What broke
d732fae("Require documented ODEInterface wrapper API", #116) removed@reexport using DiffEqBasefromsrc/ODEInterfaceDiffEq.jl.That reexport was this package's common-interface surface. Without it,
using ODEInterfaceDiffEqno longer bringsODEProblem,solve,ReturnCodeor thecallbacks into scope, so the README's own Lorenz example fails with
UndefVarError:Before this PR
names(ODEInterfaceDiffEq)was 11 entries: the algorithms andnothing else. CI stayed green because the same commit added
using DiffEqBasetotest/callbacks.jl— which is itself direct evidence that those names used tocome 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
exportlist.Evidence used to pick the names
README.md— the only usage example,using ODEInterface, ODEInterfaceDiffEqthen
ODEProblem+solve+ solution indexing.test/—test/callbacks.jlhadusing DiffEqBaseadded by the strippingcommit; the other test files use
ODEProblem,ODEFunction,ReturnCode,successful_retcode,ContinuousCallbackafterusing ODEInterfaceDiffEq, DiffEqBase.src/— which integrator hooks and DAE-initialization algorithms this packageactually implements methods for (
src/integrator_utils.jl,src/initialize.jl). Names with no method here are excluded: they erroridentically 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(noinitialize_dae!method here), integrator hooks with noODEInterfaceIntegratormethod (
add_tstop!,reinit!,get_du,check_error, …), and theSDE/DDE/BVP/optimization surface DiffEqBase carried along — ~160 names that stay
dropped.
Every name is imported from its owning module (SciMLBase, except
DefaultInitwhich DiffEqBase owns), so each stays documented upstream.
Drift protection
test/qa/qa.jldeclares the same list viareexports_allow, and a new testsetasserts every approved name is both in
names(ODEInterfaceDiffEq)and actuallyin scope from
using ODEInterfaceDiffEq.Semver
Non-breaking. This only re-adds names that
using ODEInterfaceDiffEqprovidedbefore
d732fae; no existing name changes meaning and nothing is removed. Minorbump. 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 ODEInterfaceDiffEqthen the README-shapedODEProblem+solve+successful_retcodeflow 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.filteratsrc/solve.jl:338); it reproduces identically onmasterwith the SciMLTesting version installed here (2.11 vs. the 2.4 pinnedin
test/qa/Project.toml) and is unrelated to this change.🤖 Generated with Claude Code
https://claude.ai/code/session_01Rmh6B9eoW3N8oCbuuVPVxJ