Skip to content

Commit 612afcf

Browse files
Accept stochastic caches in nlsolve!
The nonlinear solve helper is shared with StochasticDiffEq, whose integrator caches implement the common public SciMLBase.DECache contract rather than OrdinaryDiffEqCache. Accept that shared contract while retaining the wrong-slot guard. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Claude <[email protected]> Claude-Session: https://chatgpt.com/codex/tasks/01a03c36-0ac6-7311-82e4-20b12ea6f040
1 parent 724ffe9 commit 612afcf

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎lib/OrdinaryDiffEqNonlinearSolve/Project.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "OrdinaryDiffEqNonlinearSolve"
22
uuid = "127b3ac7-2247-4354-8eb6-78cf4e7c58e8"
33
authors = ["Chris Rackauckas <[email protected]>", "Yingbo Ma <[email protected]>"]
4-
version = "2.9.1"
4+
version = "2.9.2"
55

66
[deps]
77
CommonSolve = "38540f10-b2f7-11e9-35d8-d573e4eb0ff2"

‎lib/OrdinaryDiffEqNonlinearSolve/src/nlsolve.jl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ function nlsolve!(
115115
# Checking the type, not just `nothing`: passing something else entirely
116116
# in this slot went unnoticed because `update_W!` happens not to read it
117117
# on the out-of-place path.
118-
cache isa Union{OrdinaryDiffEqCore.OrdinaryDiffEqCache, Nothing} ||
118+
cache isa Union{SciMLBase.DECache, Nothing} ||
119119
throw(
120120
ArgumentError(
121121
"`nlsolve!` expects the integrator cache in its third argument, got a " *

‎lib/StochasticDiffEq/test/events_test.jl‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ affect2!(integrator) = integrator.u[4] = integrator.u[4] - params.gSyn; # Inhibi
113113
cb = ContinuousCallback(condition2, affect2!, nothing);
114114
prob = SDEProblem(HM_neuron!, HM_noise!, x0, (0.0, 1999.9), params);
115115
sol = solve(prob, ImplicitEM(), reltol = 1.0e-4, abstol = 1.0e-6, dense = true, callback = cb);
116+
@test SciMLBase.successful_retcode(sol)
116117
sol = solve(prob, SKenCarp(), reltol = 1.0e-4, abstol = 1.0e-6, dense = true, callback = cb);
118+
@test SciMLBase.successful_retcode(sol)
117119

118120
using DiffEqCallbacks
119121

0 commit comments

Comments
 (0)