Repository navigation
Restore the SciML common interface on using JumpProcesses - #635
Merged
Merged
Conversation
`fdfd104` ("Allow intentional public reexports in QA", #623) replaced
`@reexport using DiffEqBase` with a plain `using DiffEqBase`, but the
`reexports_allow` list it introduced only covered the five names JumpProcesses
already exported on its own (`init`, `solve`, `solve!`, `neighbors`,
`outdegree`). Everything else that `using JumpProcesses` used to bring into
scope was dropped, so `DiscreteProblem`, `ODEProblem`, `SDEProblem`, `remake`,
the callbacks, the ensemble types and the integrator interface all became
`UndefVarError`s for downstream users.
The same commit is its own evidence: it had to add `using SciMLBase` (and
`Pkg.add("SciMLBase")`) to seven documentation pages and `SciMLBase`/
`DiffEqBase` imports to ~25 test files purely to keep them working.
Following the rule "reexport what is normal documented use, but not whole
dependencies" (SciML/Sundials.jl#553), add an explicit `export` list instead of
the blanket reexport:
* the problem/function/solution types a `JumpProblem` wraps -- `DiscreteProblem`,
`DiscreteFunction`, `ODEProblem`, `ODEFunction`, `ODESolution`, `SDEProblem`,
`SDEFunction`, `remake`, `NullParameters`;
* the callbacks -- `CallbackSet`, `ContinuousCallback`, `DiscreteCallback`,
`VectorContinuousCallback`;
* the ensemble interface -- `EnsembleProblem`, `EnsembleSolution`,
`EnsembleSummary`, `EnsembleAnalysis` and the four ensemble algorithms;
* the integrator interface a jump `affect!` drives -- `add_tstop!`,
`add_saveat!`, `savevalues!`, `set_proposed_dt!`, `set_t!`, `set_u!`,
`reinit!`, `step!`, `terminate!`, `u_modified!`,
`derivative_discontinuity!`;
* `ReturnCode` and `successful_retcode`.
The names are now imported from their owner `SciMLBase` rather than through
DiffEqBase's re-export, the allow-list in `test/qa.jl` is kept in sync with the
`export` block, and the documentation pages go back to the documented
`using JumpProcesses`.
Restoring previously exported names is additive, so this is not breaking.
Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Claude <[email protected]>
Claude-Session: https://claude.ai/code/session_01Rmh6B9eoW3N8oCbuuVPVxJ
Add a "Reexported SciML common interface" section to docs/src/api.md listing the names `using JumpProcesses` provides on top of its own API, grouped by role (problems, functions, solutions, ensemble algorithms, solving, integrator interface, return status, callbacks) with SciMLBase named as their owner and links to the upstream documentation for each group. The section states the boundary explicitly -- everything else from SciMLBase must be imported from SciMLBase directly -- and notes that `SSAStepper` only supports `DiscreteCallback`s, so the continuous callbacks are re-exported for the ODE/SDE integrators a `JumpProblem` can be paired with. The docs list, the `export` block in src/JumpProcesses.jl and the `REEXPORTED_API` tuple in test/qa.jl are now the same list in three places, so a future QA sweep can see the surface is deliberate. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Claude <[email protected]> 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
fdfd104("Allow intentional public reexports in QA", #623) replacedwith a plain
using DiffEqBase. Thereexports_allowlist that commitintroduced only covered the five names JumpProcesses already exported itself:
Everything else that
using JumpProcessesused to put in scope silentlydisappeared from the public surface:
DiscreteProblem,ODEProblem,SDEProblem,remake, the callbacks, the ensemble types, and the integratorfunctions a jump
affect!calls. The package's own tests never noticed becausethe same commit added explicit
using SciMLBase/using DiffEqBaselines tothem.
Evidence used to pick the names
using SciMLBase(and
Pkg.add("SciMLBase")) to seven documentation pages --simple_poisson_process.md,discrete_stochastic_example.md,jump_diffusion.md,point_process_simulation.md,spatial.md,faq.md,advanced_point_process.md-- andSciMLBase/DiffEqBaseimports to ~25 files under
test/. Those additions are a direct list of namesthat used to come from the reexport.
Coretest group startedfailing with
UndefVarErrorforDiscreteProblemandEnsembleProblem, which ithad been getting from
using JumpProcesses. Fix Core test failure: import DiscreteProblem/EnsembleProblem from SciMLBase MomentClosure.jl#111 is aworkaround that imports those two names from SciMLBase directly. That is this bug,
observed in the wild.
docs/src/**/*.mdandtest/**/*.jlagainstsetdiff(names(DiffEqBase), names(JumpProcesses))(193 names lost). Hits indocs:
ContinuousCallback,DiscreteCallback,DiscreteProblem,EnsembleProblem,ODEProblem,ODESolution,SDEProblem,remake. Hitsin tests additionally:
CallbackSet,DiscreteFunction,EnsembleSerial,EnsembleThreads,ODEFunction,ReturnCode,add_tstop!,derivative_discontinuity!,reinit!,savevalues!,set_u!,step!,terminate!.Following the rule from SciML/Sundials.jl#553 -- reexport what normal
documented use needs, not whole dependencies -- this restores an explicit list
rather than the blanket reexport. The remaining ~155 DiffEqBase/SciMLBase names
(BVP/DAE/DDE/SDDE/optimization/nonlinear problem classes, traits, function
wrappers, internals) stay out.
Restored names
(
init,solve,solve!,neighbors,outdegreewere already exported andare unchanged.)
Each is imported from its owner
SciMLBaserather than through DiffEqBase'sre-export, and
test/qa.jl'sreexports_allowlist is kept in sync with theexportblock so it cannot drift.The documentation pages go back to the documented
using JumpProcesses.Documentation
docs/src/api.mdgains a Reexported SciML common interface section listing thenames grouped by role -- problems / functions / solutions / ensemble algorithms /
solving / integrator interface / return status / callbacks -- with SciMLBase named as
their owner and links to the upstream docs for each group. It closes with the explicit
boundary line, and notes that
SSAStepperonly supportsDiscreteCallbacks so thecontinuous callbacks are there for the ODE/SDE integrators a
JumpProblempairs with.The docs list, the
exportblock insrc/JumpProcesses.jland theREEXPORTED_APItuple in
test/qa.jlare now the same list in three places.Why this is not breaking
Every name here was exported by
using JumpProcessesbeforefdfd104.Restoring previously-exported names is additive -- no existing code changes
meaning. Per the release process, no version bump is included here.
What was verified
julia --project=. -e 'using JumpProcesses'loads, and all restored names arepresent in
names(JumpProcesses).ConstantRateJump+DiscreteProblem+JumpProblem+solve(..., SSAStepper()), plusEnsembleProblem/EnsembleSerialandremake) runs from a bareusing JumpProcesses.test/qa.jlwas run locally: "No unapproved public reexports" passes, asdo
all_explicit_imports_via_owners,all_qualified_accesses_via_owners,all_explicit_imports_are_public, Aqua and the public-API-documentationchecks. The one erroring check,
all_qualified_accesses_are_public, flagsBase.Iterators.filter/mapatsrc/spatial/topology.jl:128-- untouched bythis PR and failing on master the same way with the ExplicitImports version
resolved locally.
CI covers it. This PR deliberately touches only
src/,docs/and theREEXPORTED_APIconstant intest/qa.jl, to stay out of the way of thein-flight InterfaceI test work.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Rmh6B9eoW3N8oCbuuVPVxJ