Skip to content

Commit

Permalink
update retcode from symbol (#288)
Browse files Browse the repository at this point in the history
* update retcode from symbol

* Add tests

* Bump the version number

---------

Co-authored-by: David Widmann <[email protected]>
  • Loading branch information
kaitlyn-loftus and devmotion authored Apr 18, 2024
1 parent 7997eda commit 1ad28dd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
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 @@ 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
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

2 comments on commit 1ad28dd

@devmotion
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/105189

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v5.47.2 -m "<description of version>" 1ad28ddc2eae05a5cba7b31b6ab702d9fb0e59a4
git push origin v5.47.2

Please sign in to comment.