Skip to content

Restore the SciML common interface on using MATLABDiffEq - #97

Merged
ChrisRackauckas merged 1 commit into
masterfrom
restore-common-interface-reexports
Aug 23, 2026
Merged

ChrisRackauckas merged 1 commit into
masterfrom
restore-common-interface-reexports

Conversation

@ChrisRackauckas

Copy link
Copy Markdown
Member

What broke

Document MATLAB solver API and enable strict QA (4fdd039, #94) removed @reexport using DiffEqBase from src/MATLABDiffEq.jl to satisfy the strict QA reexport check. Nothing replaced it, so using MATLABDiffEq no longer brings ODEProblem, solve, ReturnCode, remake or the solution types into scope.

That is exactly the README's documented workflow:

using MATLABDiffEq, ParameterizedFunctions
prob = ODEProblem(f, u0, tspan)
sol = solve(prob, MATLABDiffEq.ode45())

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 export list of the interface a MATLABDiffEq user actually works with, following the SciML/Sundials.jl#553 pattern.

Evidence used to pick the names

  1. The stripping commit itself. 4fdd039 rewrote both README examples from using MATLABDiffEq, ParameterizedFunctions to using MATLAB, MATLABDiffEq, ParameterizedFunctions, SciMLBase, and wrote the new docs/src/index.md example as using MATLABDiffEq, SciMLBase with the instruction "Load SciMLBase for the problem and solve interfaces". Rewriting the documentation to work around the missing names is direct evidence of what the reexport was providing.
  2. src/MATLABDiffEq.jl: __solve is defined only for AbstractODEProblem, builds a DEStats from the MATLAB counters, and errors on callbacks ("Callbacks are not supported in MATLABDiffEq.jl").

Restored (17 names)

group names
ODE problem / solution ODEProblem, ODEFunction, ODESolution, DEStats, NullParameters
solve solve, remake
retcodes ReturnCode, successful_retcode
ensembles EnsembleProblem, EnsembleSolution, EnsembleSummary, EnsembleAnalysis, EnsembleSerial, EnsembleThreads, EnsembleDistributed, EnsembleSplitThreads

Deliberately left out: DAE/SDE/DDE and every other non-ODE problem type (__solve is defined here only for AbstractODEProblem; ode15i names MATLAB's implicit solver but is still reached through an ODEProblem), the callbacks (__solve errors on them), and the integrator interface (init/step!/solve!/reinit! — this package implements __solve only). Those names error identically before and after this PR.

The MATLAB algorithms are unchanged: still @public but not exported, so still written qualified as MATLABDiffEq.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

  • New docs/src/api.md with 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 into docs/make.jl.
  • Both README examples go back to using MATLABDiffEq, ParameterizedFunctions; docs/src/index.md goes back to a bare using MATLABDiffEq, with a pointer to the API page.

Drift protection

The list is declared through reexports_allow in test/qa/qa.jl, and a new Reexport surface testset asserts every approved name is in names(MATLABDiffEq) and actually in scope from that file's using MATLABDiffEq. The docs list, the export block 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 MATLABDiffEq cannot even load there (MATLAB.jl: "MATLAB is not properly installed"). I could not run run_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:

  • All three lists — the export block in src/MATLABDiffEq.jl, the REEXPORTS tuple in test/qa/qa.jl, and the docs list in docs/src/api.md — are byte-for-byte the same 17 names (checked with a script across all five wrapper PRs).
  • Every one of the 17 names is defined, is in names(SciMLBase), and has a docstring in SciMLBase — so none of them can trip the strict-QA public-API-docstring check and no api_docs_kwargs = (; ignore = ...) entry is needed.
  • src/MATLABDiffEq.jl, test/qa/qa.jl and docs/make.jl all parse.
  • Runic reports all three already clean.
  • None of the 17 collide with MATLABDiffEq's own @public names (MATLABAlgorithm, ode23, ode45, ode113, ode23s, ode23t, ode23tb, ode15s, ode15i).
  • The identical import-and-export shape — including using SciMLBase: solve — passes strict SciMLTesting 2.4 QA with no suppressions in the sibling PR Restore the SciML common interface on using DASKR DASKR.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

`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
ChrisRackauckas force-pushed the restore-common-interface-reexports branch from 3c71498 to a8c2d98 Compare August 23, 2026 19:14
@ChrisRackauckas
ChrisRackauckas merged commit 803fb57 into master Aug 23, 2026
10 checks passed
@ChrisRackauckas
ChrisRackauckas deleted the restore-common-interface-reexports branch August 23, 2026 22:05
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