Support SciMLBase v3: rename u_modified! → derivative_discontinuity!#300
Merged
ChrisRackauckas merged 4 commits intoSciML:masterfrom Apr 13, 2026
Merged
Conversation
SciMLBase v3 deprecates `u_modified!` in favor of `derivative_discontinuity!` (SciMLBase src/integrator_interface.jl:242 `@deprecate`). This renames all 13 callback call sites to the new name and extends SciMLBase compat to v3.1. Note: local test runs fail at Pkg resolution because OrdinaryDiffEq* still pins RecursiveArrayTools ≤ 3.54, which conflicts with SciMLBase 3.1's RAT v4 requirement. This PR is therefore intended to be merged after upstream OrdinaryDiffEq packages release RAT-v4-compatible versions; CI on this PR is the only venue where the combined environment can be exercised. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
SciMLBase v3 changes `sol[end]` on non-scalar ODEs to return the last scalar of the flat representation (`sol.u[end][end]`) rather than the final state vector. The manifold-projection examples index into the returned state vector with `[1]` and `[2]`, which only works against the state vector — use `sol.u[end]` explicitly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Rather than hard-bumping the SciMLBase compat minimum to v3, use an `@static if isdefined(SciMLBase, :derivative_discontinuity!)` guard that aliases to `u_modified!` when running against SciMLBase v2. This lets DiffEqCallbacks continue supporting v2 downstream packages while the ecosystem migrates. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Contributor
Author
This was referenced Apr 13, 2026
Open
Draft
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.
Summary
SciMLBasecompat to"2.54, 3.1"and bumpDiffEqCallbacksto4.14.0.u_modified!→derivative_discontinuity!across all 13 callback source files, the reexport insrc/DiffEqCallbacks.jl, andtest/preset_time.jl.u_modified!is@deprecate'd in SciMLBase v3 (src/integrator_interface.jl:242), so the previous name technically still works but emits a deprecation warning at every call site.Closes the intent of #299 (the dependabot compat bump), but does the rename work on top rather than only touching
Project.toml.Known limitation — please read before merging
Local
Pkg.resolve()fails on any environment that contains SciMLBase 3.1, becauseSciMLBase3.1 pinsRecursiveArrayTools = 4whileOrdinaryDiffEq/OrdinaryDiffEqVernerin the registry still pinRecursiveArrayTools ≤ 3.54. The CI on this PR will reproduce the same unsatisfiable resolution until upstreamOrdinaryDiffEq*packages release RAT-v4-compatible versions.That means:
Pkg.add/instantiatestep with anUnsatisfiable requirements detected for package RecursiveArrayToolserror, not at Julia runtime. OnceOrdinaryDiffEqreleases the RAT-v4 bump, re-running CI here should succeed without further edits.What is NOT in this PR
sol[end]references inREADME.md:63anddocs/src/projection.md:51are left alone. I could not verify in the SciMLBase v3.1 source that scalar integer indexing onAbstractTimeseriesSolutionactually changed behavior (no explicitBase.getindex(::AbstractTimeseriesSolution, ::Int)override is present), so rewriting docs based on an unverified claim would be premature.Test plan
test/preset_time.jlin particular, which was renamed too) still exercises the same code path under SciMLBase v3 without deprecation warnings.Pkg.add), triage before merging.🤖 Generated with Claude Code