Skip to content

Commit 1ad28dd

Browse files
update retcode from symbol (#288)
* update retcode from symbol * Add tests * Bump the version number --------- Co-authored-by: David Widmann <[email protected]>
1 parent 7997eda commit 1ad28dd

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "DelayDiffEq"
22
uuid = "bcd4f6db-9728-5f36-b5f7-82caef46ccdb"
33
authors = ["Chris Rackauckas <[email protected]>"]
4-
version = "5.47.1"
4+
version = "5.47.2"
55

66
[deps]
77
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"

src/integrators/interface.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ function DiffEqBase.last_step_failed(integrator::DDEIntegrator)
256256
end
257257

258258
# terminate integration
259-
function DiffEqBase.terminate!(integrator::DDEIntegrator, retcode = :Terminated)
259+
function DiffEqBase.terminate!(integrator::DDEIntegrator, retcode = ReturnCode.Terminated)
260260
integrator.sol = DiffEqBase.solution_new_retcode(integrator.sol, retcode)
261261
integrator.opts.tstops.valtree = typeof(integrator.opts.tstops.valtree)()
262262
nothing

test/integrators/events.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ end
3434

3535
# discrete callback
3636
@testset "discrete" begin
37+
# Automatic absolute tolerances
3738
cb = AutoAbstol()
3839

3940
sol1 = solve(prob, alg, callback = cb)
@@ -42,6 +43,11 @@ end
4243

4344
@test sol3.errors[:L2] < 1.4e-3
4445
@test sol3.errors[:L∞] < 4.1e-3
46+
47+
# Terminate early
48+
cb = DiscreteCallback((u, t, integrator) -> t == 4, terminate!)
49+
sol = @test_logs solve(prob, alg; callback = cb, tstops = [4.0])
50+
@test sol.t[end] == 4
4551
end
4652

4753
@testset "save discontinuity" begin

0 commit comments

Comments
 (0)