Restore the SciML common interface on using MATLABDiffEq - #97
Merged
Merged
Conversation
`Document MATLAB solver API and enable strict QA` (4fdd039, #94) dropped `@reexport using DiffEqBase` from src/MATLABDiffEq.jl. That reexport was the only thing putting `ODEProblem`, `solve`, `ReturnCode` and the rest of the common interface into scope, so the README's documented workflow using MATLABDiffEq, ParameterizedFunctions prob = ODEProblem(f, u0, tspan) sol = solve(prob, MATLABDiffEq.ode45()) stopped working with `UndefVarError`. The same commit is its own best evidence: it had to rewrite both README examples to `using MATLAB, MATLABDiffEq, ParameterizedFunctions, SciMLBase` and to write the new docs/src/index.md example as `using MATLABDiffEq, SciMLBase`. Papering over the documentation is not the same as keeping the interface. Rather than restore the blanket reexport (420 names, most of them for equation classes MATLAB's ODE suite cannot solve), export exactly the interface a user works with: * the problem, function and solution types for ODEs, the only class `__solve` accepts here: `ODEProblem`, `ODEFunction`, `ODESolution`, plus `DEStats` and `NullParameters`; * `solve` and `remake`; * `ReturnCode` and `successful_retcode`; * the ensemble types, which drive `solve` generically. Deliberately left out: DAE/SDE/DDE and every other non-ODE problem type, the callbacks (`__solve` errors with "Callbacks are not supported in MATLABDiffEq.jl"), and the integrator interface (MATLABDiffEq implements `__solve` only). Those names error identically before and after. The MATLAB algorithms themselves stay `@public` but unexported, so they are still written qualified as `MATLABDiffEq.ode45()`. Restore both README examples to `using MATLABDiffEq, ParameterizedFunctions` and the docs/src/index.md example to a bare `using MATLABDiffEq`. Document the reexported surface on a new rendered API page, docs/src/api.md, grouped by role with SciMLBase named and linked as the owner of every name, a closing boundary line, and the reasoning for each deliberate omission. Wire the page into docs/make.jl. The list is declared through `reexports_allow` in test/qa/qa.jl and covered by a test that every approved name is in `names(MATLABDiffEq)` and actually in scope from `using MATLABDiffEq`, so the docs list, the `export` block and the allow-list cannot drift apart. Adding back names that used to be exported is not breaking. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rmh6B9eoW3N8oCbuuVPVxJ
ChrisRackauckas
force-pushed
the
restore-common-interface-reexports
branch
from
August 23, 2026 19:14
3c71498 to
a8c2d98
Compare
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
Document MATLAB solver API and enable strict QA(4fdd039, #94) removed@reexport using DiffEqBasefromsrc/MATLABDiffEq.jlto satisfy the strict QA reexport check. Nothing replaced it, sousing MATLABDiffEqno longer bringsODEProblem,solve,ReturnCode,remakeor the solution types into scope.That is exactly the README's documented workflow:
What this does
Per "we should be reexporting what is normal documented use, but not whole dependencies", this does not restore the blanket reexport (420 names). It adds an explicit
exportlist of the interface a MATLABDiffEq user actually works with, following theSciML/Sundials.jl#553pattern.Evidence used to pick the names
using MATLABDiffEq, ParameterizedFunctionstousing MATLAB, MATLABDiffEq, ParameterizedFunctions, SciMLBase, and wrote the newdocs/src/index.mdexample asusing MATLABDiffEq, SciMLBasewith the instruction "LoadSciMLBasefor the problem and solve interfaces". Rewriting the documentation to work around the missing names is direct evidence of what the reexport was providing.src/MATLABDiffEq.jl:__solveis defined only forAbstractODEProblem, builds aDEStatsfrom the MATLAB counters, and errors on callbacks ("Callbacks are not supported in MATLABDiffEq.jl").Restored (17 names)
ODEProblem,ODEFunction,ODESolution,DEStats,NullParameterssolve,remakeReturnCode,successful_retcodeEnsembleProblem,EnsembleSolution,EnsembleSummary,EnsembleAnalysis,EnsembleSerial,EnsembleThreads,EnsembleDistributed,EnsembleSplitThreadsDeliberately left out: DAE/SDE/DDE and every other non-ODE problem type (
__solveis defined here only forAbstractODEProblem;ode15inames MATLAB's implicit solver but is still reached through anODEProblem), the callbacks (__solveerrors on them), and the integrator interface (init/step!/solve!/reinit!— this package implements__solveonly). Those names error identically before and after this PR.The MATLAB algorithms are unchanged: still
@publicbut not exported, so still written qualified asMATLABDiffEq.ode45(). This PR only restores the common interface around them, which is what the README's "They are public but not exported, so use qualified names" note has always assumed.Docs
docs/src/api.mdwith a Reexported SciML common interface section: names grouped by role, SciMLBase named and linked as the owner of each one, a reminder that the algorithms stay qualified, a closing boundary line ("anything else from SciMLBase must be imported from SciMLBase directly"), and the reasoning for each omission. Wired intodocs/make.jl.using MATLABDiffEq, ParameterizedFunctions;docs/src/index.mdgoes back to a bareusing MATLABDiffEq, with a pointer to the API page.Drift protection
The list is declared through
reexports_allowintest/qa/qa.jl, and a newReexport surfacetestset asserts every approved name is innames(MATLABDiffEq)and actually in scope from that file'susing MATLABDiffEq. The docs list, theexportblock and the allow-list are the same list in three places.Semver
Restoring names that used to be exported is not breaking — no name changes meaning and nothing is removed. No version bump here; a separate release pass handles versions.
Verification — please read
MATLAB is not installed on the machine this was prepared on, so
using MATLABDiffEqcannot even load there (MATLAB.jl: "MATLAB is not properly installed"). I could not runrun_qa,Pkg.test()or a Documenter build for this package, and I am not going to claim otherwise. CI is the first real check.What I did verify statically:
exportblock insrc/MATLABDiffEq.jl, theREEXPORTStuple intest/qa/qa.jl, and the docs list indocs/src/api.md— are byte-for-byte the same 17 names (checked with a script across all five wrapper PRs).names(SciMLBase), and has a docstring in SciMLBase — so none of them can trip the strict-QA public-API-docstring check and noapi_docs_kwargs = (; ignore = ...)entry is needed.src/MATLABDiffEq.jl,test/qa/qa.jlanddocs/make.jlall parse.Runicreports all three already clean.@publicnames (MATLABAlgorithm,ode23,ode45,ode113,ode23s,ode23t,ode23tb,ode15s,ode15i).using SciMLBase: solve— passes strict SciMLTesting 2.4 QA with no suppressions in the sibling PR Restore the SciML common interface onusing DASKRDASKR.jl#116, which I was able to run end to end (Quality Assurance 21/21,Pkg.test()green).🤖 Generated with Claude Code
https://claude.ai/code/session_01Rmh6B9eoW3N8oCbuuVPVxJ