Skip to content

remove OrdinaryDiffEq dependency #309

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
29 changes: 26 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
name = "DelayDiffEq"
uuid = "bcd4f6db-9728-5f36-b5f7-82caef46ccdb"
authors = ["Chris Rackauckas <[email protected]>"]
version = "5.53.0"
version = "6.0.0"

[deps]
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
FastBroadcast = "7034ab61-46d4-4ed7-9d0f-46aef9175898"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
OrdinaryDiffEqCore = "bbf590c4-e513-4bbe-9b18-05decba2e5d8"
OrdinaryDiffEqDefault = "50262376-6c5a-4cf5-baba-aaf4f84d72d7"
OrdinaryDiffEqDifferentiation = "4302a76b-040a-498a-8c04-15b101fed76b"
OrdinaryDiffEqFunctionMap = "d3585ca7-f5d3-4ba6-8057-292ed1abd90f"
OrdinaryDiffEqNonlinearSolve = "127b3ac7-2247-4354-8eb6-78cf4e7c58e8"
OrdinaryDiffEqRosenbrock = "43230ef6-c299-4910-a778-202eb28ce4ce"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Expand All @@ -25,12 +26,14 @@ SymbolicIndexingInterface = "2efcf032-c050-4f8e-a9bb-153293bab1f5"

[compat]
ArrayInterface = "7"
DDEProblemLibrary = "0.1.2"
DataStructures = "0.18"
DiffEqBase = "6.122"
OrdinaryDiffEq = "6.69"
FastBroadcast = "0.3.5"
OrdinaryDiffEqCore = "1.9.0"
OrdinaryDiffEqDefault = "1.1.0"
OrdinaryDiffEqDifferentiation = "1.6.0"
OrdinaryDiffEqFunctionMap = "1.1.1"
OrdinaryDiffEqNonlinearSolve = "1.6.0"
OrdinaryDiffEqRosenbrock = "1.2.0"
RecursiveArrayTools = "2, 3"
Expand All @@ -40,3 +43,23 @@ SimpleNonlinearSolve = "0.1, 1, 2"
SimpleUnPack = "1"
SymbolicIndexingInterface = "0.3.36"
julia = "1.10"

[extras]
DDEProblemLibrary = "f42792ee-6ffc-4e2a-ae83-8ee2f22de800"
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
DiffEqCallbacks = "459566f4-90b8-5000-8ac3-15dfb0a30def"
DiffEqDevTools = "f3b72e0c-5b89-59e1-b016-84e28bfd966d"
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
OrdinaryDiffEqTsit5 = "b1df2697-797e-41e3-8120-5422d3b24e4a"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"

[targets]
test = ["DDEProblemLibrary", "DiffEqBase", "DiffEqCallbacks", "DiffEqDevTools", "FiniteDiff", "ForwardDiff", "LinearAlgebra", "LinearSolve", "OrdinaryDiffEq", "OrdinaryDiffEqTsit5", "Random", "RecursiveArrayTools", "SafeTestsets", "Test", "Unitful"]
17 changes: 10 additions & 7 deletions src/DelayDiffEq.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
module DelayDiffEq

using Reexport
import OrdinaryDiffEqCore, OrdinaryDiffEqNonlinearSolve, OrdinaryDiffEqDifferentiation, OrdinaryDiffEqRosenbrock
@reexport using OrdinaryDiffEq

using DataStructures
using LinearAlgebra
using Logging
Expand All @@ -15,17 +11,24 @@ import ArrayInterface
import SimpleNonlinearSolve
import SymbolicIndexingInterface as SII

using DiffEqBase: AbstractDDEAlgorithm, AbstractDDEIntegrator, AbstractODEIntegrator,
using DiffEqBase: DiffEqBase, AbstractDDEAlgorithm, AbstractDDEIntegrator, AbstractODEIntegrator,
DEIntegrator, AbstractDDEProblem

using DiffEqBase: @..
using FastBroadcast
using Reexport
@reexport using DiffEqBase

import OrdinaryDiffEqCore, OrdinaryDiffEqNonlinearSolve, OrdinaryDiffEqDifferentiation, OrdinaryDiffEqRosenbrock
using OrdinaryDiffEqCore: CompositeAlgorithm, AutoSwitch
using OrdinaryDiffEqFunctionMap: FunctionMap
using OrdinaryDiffEqRosenbrock: RosenbrockMutableCache
using OrdinaryDiffEqNonlinearSolve: NLNewton, NLAnderson, NLFunctional, AbstractNLSolverCache,
FastConvergence, Convergence, SlowConvergence, VerySlowConvergence, Divergence
using OrdinaryDiffEqRosenbrock: RosenbrockMutableCache

import SciMLBase

export DDEProblem

export Discontinuity, MethodOfSteps

include("discontinuity_type.jl")
Expand Down
4 changes: 2 additions & 2 deletions src/integrators/type.jl
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ mutable struct DDEIntegrator{algType, IIP, uType, tType, P, eigenType, tTypeNoUn
end

function (integrator::DDEIntegrator)(t, deriv::Type = Val{0}; idxs = nothing)
OrdinaryDiffEq.current_interpolant(t, integrator, idxs, deriv)
OrdinaryDiffEqCore.current_interpolant(t, integrator, idxs, deriv)
end

function (integrator::DDEIntegrator)(val::AbstractArray, t::Union{Number, AbstractArray},
deriv::Type = Val{0}; idxs = nothing)
OrdinaryDiffEq.current_interpolant!(val, t, integrator, idxs, deriv)
OrdinaryDiffEqCore.current_interpolant!(val, t, integrator, idxs, deriv)
end

function SII.get_history_function(integrator::DDEIntegrator)
Expand Down
17 changes: 0 additions & 17 deletions test/Project.toml

This file was deleted.

1 change: 1 addition & 0 deletions test/integrators/cache.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using DelayDiffEq, Test
using OrdinaryDiffEq
using Random
Random.seed!(213)

Expand Down
2 changes: 1 addition & 1 deletion test/integrators/events.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using DelayDiffEq, DDEProblemLibrary, DiffEqDevTools, DiffEqCallbacks
using Test
using Test, OrdinaryDiffEqTsit5

const prob = prob_dde_constant_1delay_scalar
const alg = MethodOfSteps(Tsit5(); constrained = false)
Expand Down
2 changes: 1 addition & 1 deletion test/integrators/initialization.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using DelayDiffEq
using LinearAlgebra
using Test
using Test, OrdinaryDiffEq

@testset "CheckInit" begin
u0_good = [0.99, 0.01, 0.0]
Expand Down
2 changes: 1 addition & 1 deletion test/integrators/iterator.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using DelayDiffEq, DDEProblemLibrary
using Test
using Test, OrdinaryDiffEq

const prob = prob_dde_constant_1delay_scalar

Expand Down
2 changes: 1 addition & 1 deletion test/integrators/reinit.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using DelayDiffEq, DDEProblemLibrary, RecursiveArrayTools
using Test
using Test, OrdinaryDiffEq

const prob_ip = prob_dde_constant_1delay_ip
const prob_scalar = prob_dde_constant_1delay_scalar
Expand Down
4 changes: 2 additions & 2 deletions test/integrators/residual_control.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using DelayDiffEq, DDEProblemLibrary
using Test
using Test, OrdinaryDiffEq

const alg = MethodOfSteps(RK4(); constrained = false)
const alg = MethodOfSteps(Tsit5(); constrained = false)
const prob = prob_dde_constant_1delay_scalar

# reference solution with delays specified
Expand Down
2 changes: 1 addition & 1 deletion test/integrators/retcode.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using DelayDiffEq, DDEProblemLibrary
using Test
using Test, OrdinaryDiffEq

const prob = prob_dde_constant_1delay_ip

Expand Down
2 changes: 1 addition & 1 deletion test/integrators/rosenbrock.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using DelayDiffEq, DDEProblemLibrary
using Test
using Test, OrdinaryDiffEq

const prob_ip = prob_dde_constant_1delay_ip
const prob_scalar = prob_dde_constant_1delay_scalar
Expand Down
2 changes: 1 addition & 1 deletion test/integrators/sdirk.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using DelayDiffEq, DDEProblemLibrary
using Test
using Test, OrdinaryDiffEq

const prob_ip = prob_dde_constant_1delay_ip
const prob_scalar = prob_dde_constant_1delay_scalar
Expand Down
2 changes: 1 addition & 1 deletion test/integrators/unique_times.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using DelayDiffEq, DDEProblemLibrary
using Test
using Test, OrdinaryDiffEqTsit5

const prob = prob_dde_constant_1delay_long_ip

Expand Down
2 changes: 1 addition & 1 deletion test/integrators/verner.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using DelayDiffEq, DDEProblemLibrary
using Test
using Test, OrdinaryDiffEq

# simple problems
@testset "simple problems" begin
Expand Down
2 changes: 1 addition & 1 deletion test/interface/ad.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using DelayDiffEq

using OrdinaryDiffEqTsit5
import FiniteDiff
import ForwardDiff

Expand Down
7 changes: 4 additions & 3 deletions test/interface/backwards.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using DelayDiffEq
using OrdinaryDiffEqTsit5
using Test

h(p, t) = 1.0
Expand All @@ -12,7 +13,7 @@ f_analytic(u₀, ::typeof(h), p, t) = t < 1 ? (t^2 - 1) / 2 : t - 1
const dde_f = DDEFunction(f, analytic = f_analytic)

@testset "Without lags" begin
sol = solve(DDEProblem(dde_f, h, tspan), MethodOfSteps(RK4()))
sol = solve(DDEProblem(dde_f, h, tspan), MethodOfSteps(Tsit5()))
@test sol.errors[:l∞] < 1.2e-12 # 1.2e-16
end

Expand Down Expand Up @@ -53,12 +54,12 @@ end
@testset "dt and dtmax" begin
prob = DDEProblem(dde_f, h, tspan)

dde_int = init(prob, MethodOfSteps(RK4()); dt = 0.1, dtmax = 0.5)
dde_int = init(prob, MethodOfSteps(Tsit5()); dt = 0.1, dtmax = 0.5)
@test dde_int.dt == -0.1
@test dde_int.opts.dtmax == -0.5

sol1 = solve!(dde_int)
sol2 = solve(prob, MethodOfSteps(RK4()); dt = -0.1, dtmax = -0.5)
sol2 = solve(prob, MethodOfSteps(Tsit5()); dt = -0.1, dtmax = -0.5)
@test sol1.t == sol2.t
@test sol1.u == sol2.u
end
4 changes: 3 additions & 1 deletion test/interface/composite_solution.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using DelayDiffEq, DDEProblemLibrary
using OrdinaryDiffEqCore, OrdinaryDiffEqTsit5, OrdinaryDiffEqRosenbrock
using OrdinaryDiffEqCore: CompositeAlgorithm
using Test

@testset "integrator" begin
Expand All @@ -22,7 +24,7 @@ end

@testset "issue #148" begin
alg = MethodOfSteps(Tsit5())
compositealg = MethodOfSteps(CompositeAlgorithm((Tsit5(), RK4()), integrator -> 1))
compositealg = MethodOfSteps(CompositeAlgorithm((Tsit5(), Tsit5()), integrator -> 1))

prob = DDEProblem((du, u, h, p, t) -> (du[1] = -h(p, t - 1)[1]; nothing),
[1.0], (p, t) -> [1.0], (0.0, 5.0))
Expand Down
2 changes: 1 addition & 1 deletion test/interface/constrained.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DelayDiffEq, DDEProblemLibrary
using DelayDiffEq, DDEProblemLibrary, OrdinaryDiffEq
using Test

# Check that numerical solutions approximate analytical solutions,
Expand Down
2 changes: 1 addition & 1 deletion test/interface/dependent_delays.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DelayDiffEq, DDEProblemLibrary
using DelayDiffEq, DDEProblemLibrary, OrdinaryDiffEq
using Test

const alg = MethodOfSteps(BS3())
Expand Down
2 changes: 1 addition & 1 deletion test/interface/discontinuities.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DelayDiffEq, DDEProblemLibrary
using DelayDiffEq, DDEProblemLibrary, OrdinaryDiffEq
using Test

const prob = prob_dde_constant_2delays_ip
Expand Down
2 changes: 1 addition & 1 deletion test/interface/fpsolve.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DelayDiffEq, DDEProblemLibrary, DiffEqDevTools
using DelayDiffEq, DDEProblemLibrary, DiffEqDevTools, OrdinaryDiffEq
using LinearAlgebra
using Test

Expand Down
2 changes: 1 addition & 1 deletion test/interface/history_function.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DelayDiffEq
using DelayDiffEq, OrdinaryDiffEq
using Test

# check constant extrapolation with problem with vanishing delays at t = 0
Expand Down
2 changes: 1 addition & 1 deletion test/interface/jacobian.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DelayDiffEq
using DelayDiffEq, OrdinaryDiffEq
using Test

@testset "in-place" begin
Expand Down
1 change: 1 addition & 0 deletions test/interface/mass_matrix.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using DelayDiffEq
using DiffEqDevTools
using OrdinaryDiffEq
using LinearAlgebra
using Test

Expand Down
2 changes: 1 addition & 1 deletion test/interface/parameters.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DelayDiffEq
using DelayDiffEq, OrdinaryDiffEqTsit5
using Test

# Test parameterized delayed logistic equation
Expand Down
1 change: 1 addition & 0 deletions test/interface/save_idxs.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using DelayDiffEq
using OrdinaryDiffEq
using Test

# out-of-place problem
Expand Down
2 changes: 1 addition & 1 deletion test/interface/saveat.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DelayDiffEq, DDEProblemLibrary
using DelayDiffEq, DDEProblemLibrary, OrdinaryDiffEqTsit5
using Test

const prob = prob_dde_constant_1delay_long_ip
Expand Down
2 changes: 1 addition & 1 deletion test/interface/unconstrained.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DelayDiffEq, DDEProblemLibrary
using DelayDiffEq, DDEProblemLibrary, OrdinaryDiffEq
using Test

# Check that numerical solutions approximate analytical solutions,
Expand Down
2 changes: 1 addition & 1 deletion test/interface/units.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DelayDiffEq, DDEProblemLibrary, Unitful
using DelayDiffEq, DDEProblemLibrary, Unitful, OrdinaryDiffEq
using Test

using DDEProblemLibrary: remake_dde_constant_u0_tType
Expand Down
Loading