From 4ea7400385a7499d58c62778adbd917eb41fadf8 Mon Sep 17 00:00:00 2001 From: kaitlyn-loftus Date: Thu, 18 Apr 2024 14:48:33 -0400 Subject: [PATCH 1/3] update retcode from symbol --- src/integrators/interface.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/integrators/interface.jl b/src/integrators/interface.jl index edd016f..2732e06 100644 --- a/src/integrators/interface.jl +++ b/src/integrators/interface.jl @@ -256,7 +256,7 @@ function DiffEqBase.last_step_failed(integrator::DDEIntegrator) end # terminate integration -function DiffEqBase.terminate!(integrator::DDEIntegrator, retcode = :Terminated) +function DiffEqBase.terminate!(integrator::DDEIntegrator, retcode = ReturnCode.Terminated) integrator.sol = DiffEqBase.solution_new_retcode(integrator.sol, retcode) integrator.opts.tstops.valtree = typeof(integrator.opts.tstops.valtree)() nothing From 18b563e7bbf9896aad30d8d0c38b563c1f5b4bd1 Mon Sep 17 00:00:00 2001 From: David Widmann Date: Thu, 18 Apr 2024 22:10:30 +0200 Subject: [PATCH 2/3] Add tests --- test/integrators/events.jl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/integrators/events.jl b/test/integrators/events.jl index f6966c7..75d3807 100644 --- a/test/integrators/events.jl +++ b/test/integrators/events.jl @@ -34,6 +34,7 @@ end # discrete callback @testset "discrete" begin + # Automatic absolute tolerances cb = AutoAbstol() sol1 = solve(prob, alg, callback = cb) @@ -42,6 +43,11 @@ end @test sol3.errors[:L2] < 1.4e-3 @test sol3.errors[:L∞] < 4.1e-3 + + # Terminate early + cb = DiscreteCallback((u, t, integrator) -> t == 4, terminate!) + sol = @test_logs solve(prob, alg; callback = cb, tstops = [4.0]) + @test sol.t[end] == 4 end @testset "save discontinuity" begin From efdd263fa41768e3192d1d99c064b8e35ba6f001 Mon Sep 17 00:00:00 2001 From: David Widmann Date: Thu, 18 Apr 2024 22:10:47 +0200 Subject: [PATCH 3/3] Bump the version number --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index e3d7cd8..a87677f 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "DelayDiffEq" uuid = "bcd4f6db-9728-5f36-b5f7-82caef46ccdb" authors = ["Chris Rackauckas "] -version = "5.47.1" +version = "5.47.2" [deps] ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"