Skip to content

Commit d85da48

Browse files
Restore DelayDiffEq 6.1 DEOptions compatibility
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
1 parent fd3f95b commit d85da48

5 files changed

Lines changed: 61 additions & 0 deletions

File tree

docs/src/api/ordinarydiffeqcore.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ own page, and solver-author hooks are documented separately in the
77
## Integrator objects
88

99
```@docs
10+
OrdinaryDiffEqCore.DEOptions
1011
OrdinaryDiffEqCore.ODEIntegrator
1112
```
1213

lib/OrdinaryDiffEqCore/src/integrators/type.jl

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,46 @@ function DEOptions{
104104
)
105105
end
106106

107+
# Legacy constructor for packages that construct DEOptions with delta and
108+
# save_noise, but without stage_limiter! or step_limiter!.
109+
function DEOptions{
110+
absType, relType, QT, tType, F1, F2, F3, F4, F5, F6,
111+
F7, tstopsType, discType, ECType, SType, MI, tcache, savecache,
112+
disccache, verbType, DType,
113+
}(
114+
maxiters, save_everystep, adaptive, abstol, reltol,
115+
failfactor, dtmax, dtmin, internalnorm, internalopnorm,
116+
save_idxs, tstops, saveat, d_discontinuities,
117+
tstops_cache, saveat_cache, d_discontinuities_cache, userdata,
118+
progress, progress_steps, progress_name, progress_message, progress_id,
119+
timeseries_errors, dense_errors, delta,
120+
dense, save_on, save_start, save_end, save_noise, save_discretes,
121+
save_end_user, callback, isoutofdomain, unstable_check,
122+
verbose, calck, force_dtmin, advance_to_tstop, stop_at_next_tstop,
123+
) where {
124+
absType, relType, QT, tType, F1, F2, F3, F4, F5, F6,
125+
F7, tstopsType, discType, ECType, SType, MI, tcache, savecache,
126+
disccache, verbType, DType,
127+
}
128+
return DEOptions{
129+
absType, relType, QT, tType, F1, F2, F3, F4, F5, F6,
130+
F7, tstopsType, discType, ECType, SType, MI, tcache, savecache,
131+
disccache, verbType, DType, typeof(trivial_limiter!),
132+
typeof(trivial_limiter!),
133+
}(
134+
maxiters, save_everystep, adaptive, abstol, reltol,
135+
failfactor, dtmax, dtmin, internalnorm, internalopnorm,
136+
save_idxs, tstops, saveat, d_discontinuities,
137+
tstops_cache, saveat_cache, d_discontinuities_cache, userdata,
138+
progress, progress_steps, progress_name, progress_message, progress_id,
139+
timeseries_errors, dense_errors, delta,
140+
trivial_limiter!, trivial_limiter!, dense, save_on, save_start, save_end,
141+
save_noise, save_discretes, save_end_user, callback, isoutofdomain,
142+
unstable_check, verbose, calck, force_dtmin, advance_to_tstop,
143+
stop_at_next_tstop,
144+
)
145+
end
146+
107147
"""
108148
ODEIntegrator
109149

test/Downstream/Project.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[deps]
22
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
33
DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
4+
DelayDiffEq = "bcd4f6db-9728-5f36-b5f7-82caef46ccdb"
45
DynamicQuantities = "06fc5a27-2a28-4c7c-a15d-362465fb6821"
56
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
67
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
@@ -14,6 +15,7 @@ OrdinaryDiffEqRosenbrock = "43230ef6-c299-4910-a778-202eb28ce4ce"
1415
OrdinaryDiffEqSDIRK = "2d112036-d095-4a1e-ab9a-08536f3ecdbf"
1516
OrdinaryDiffEqSSPRK = "669c94d9-1f4b-4b64-b377-1aa079aa2388"
1617
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
18+
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
1719
SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283"
1820
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
1921
StochasticDiffEq = "789caeaf-c7a9-5a7d-9973-96adeb23e2a0"
@@ -22,6 +24,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2224
[compat]
2325
ADTypes = "1.16"
2426
DifferentiationInterface = "0.6.54, 0.7"
27+
DelayDiffEq = "=6.1.0"
2528
DynamicQuantities = "1.8"
2629
Enzyme = "0.13.180"
2730
FiniteDiff = "2.27"
@@ -35,6 +38,7 @@ OrdinaryDiffEqRosenbrock = "2"
3538
OrdinaryDiffEqSDIRK = "2"
3639
OrdinaryDiffEqSSPRK = "2"
3740
SafeTestsets = "0.1, 1"
41+
SciMLBase = "3.39"
3842
SciMLTesting = "2.1"
3943
StaticArrays = "1"
4044
StochasticDiffEq = "7"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using DelayDiffEq
2+
using SciMLBase: DDEProblem, init, solve!, successful_retcode
3+
using Test
4+
5+
@testset "DelayDiffEq 6.1.0 DEOptions layout" begin
6+
f(du, u, h, p, t) = (du[1] = p * u[1] * (1 - h(p, t - 1; idxs = 1)))
7+
h(p, t; idxs = nothing) = 0.1
8+
prob = DDEProblem(f, [0.1], h, (0.0, 2.0), 0.3; constant_lags = [1])
9+
10+
@test Base.pkgversion(DelayDiffEq) == v"6.1.0"
11+
integrator = init(prob)
12+
@test hasproperty(integrator.opts, :stage_limiter!)
13+
@test hasproperty(integrator.opts, :step_limiter!)
14+
@test successful_retcode(solve!(integrator))
15+
end

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ end
167167
function downstream_group()
168168
is_APPVEYOR && return
169169
activate_downstream_env()
170+
@time @safetestset "DelayDiffEq Compatibility" include("Downstream/delaydiffeq_compatibility.jl")
170171
@time @safetestset "Measurements Tests" include("Downstream/measurements.jl")
171172
@time @safetestset "Time derivative Tests" include("Downstream/time_derivative_test.jl")
172173
return @time @safetestset "DynamicQuantities + Measurements Tests" include("Downstream/dynamicquantities_measurements.jl")

0 commit comments

Comments
 (0)