Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update retcode from symbol #288

Merged
merged 3 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "DelayDiffEq"
uuid = "bcd4f6db-9728-5f36-b5f7-82caef46ccdb"
authors = ["Chris Rackauckas <[email protected]>"]
version = "5.47.1"
version = "5.47.2"

[deps]
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
Expand Down
2 changes: 1 addition & 1 deletion src/integrators/interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@
end

# terminate integration
function DiffEqBase.terminate!(integrator::DDEIntegrator, retcode = :Terminated)
function DiffEqBase.terminate!(integrator::DDEIntegrator, retcode = ReturnCode.Terminated)

Check warning on line 259 in src/integrators/interface.jl

View check run for this annotation

Codecov / codecov/patch

src/integrators/interface.jl#L259

Added line #L259 was not covered by tests
integrator.sol = DiffEqBase.solution_new_retcode(integrator.sol, retcode)
integrator.opts.tstops.valtree = typeof(integrator.opts.tstops.valtree)()
nothing
Expand Down
6 changes: 6 additions & 0 deletions test/integrators/events.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ end

# discrete callback
@testset "discrete" begin
# Automatic absolute tolerances
cb = AutoAbstol()

sol1 = solve(prob, alg, callback = cb)
Expand All @@ -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
Expand Down
Loading