Skip to content

Commit 5721444

Browse files
Merge pull request #260 from SciML/scimlbase
update SciMLBase bound for function unwrapping
2 parents 282c90a + bded05b commit 5721444

File tree

3 files changed

+8
-39
lines changed

3 files changed

+8
-39
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ PoissonRandom = "0.4"
3333
RandomNumbers = "1.3"
3434
RecursiveArrayTools = "2"
3535
Reexport = "0.2, 1.0"
36-
SciMLBase = "1.35.1"
36+
SciMLBase = "1.51"
3737
StaticArrays = "0.10, 0.11, 0.12, 1.0"
3838
TreeViews = "0.3"
3939
UnPack = "1.0.2"

src/coupling.jl

Lines changed: 6 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,8 @@ function cat_problems(prob::DiffEqBase.AbstractODEProblem,
2121
prob_control::DiffEqBase.AbstractODEProblem)
2222
l = length(prob.u0) # add l_c = length(prob_control.u0)
2323

24-
if isdefined(SciMLBase, :unwrapped_f)
25-
_f = SciMLBase.unwrapped_f(prob.f)
26-
else
27-
_f = prob.f
28-
end
29-
30-
if isdefined(SciMLBase, :unwrapped_f)
31-
_f_control = SciMLBase.unwrapped_f(prob_control.f)
32-
else
33-
_f_control = prob_control.f
34-
end
24+
_f = SciMLBase.unwrapped_f(prob.f)
25+
_f_control = SciMLBase.unwrapped_f(prob_control.f)
3526

3627
new_f = function (du, u, p, t)
3728
_f(@view(du[1:l]), u.u, p, t)
@@ -47,17 +38,8 @@ function cat_problems(prob::DiscreteProblem, prob_control::DiffEqBase.AbstractOD
4738
@warn("Coupling to DiscreteProblem with nontrivial f. Note that, unless scale_by_time=true, the meaning of f will change when using an ODE/SDE/DDE/DAE solver.")
4839
end
4940

50-
if isdefined(SciMLBase, :unwrapped_f)
51-
_f = SciMLBase.unwrapped_f(prob.f)
52-
else
53-
_f = prob.f
54-
end
55-
56-
if isdefined(SciMLBase, :unwrapped_f)
57-
_f_control = SciMLBase.unwrapped_f(prob_control.f)
58-
else
59-
_f_control = prob_control.f
60-
end
41+
_f = SciMLBase.unwrapped_f(prob.f)
42+
_f_control = SciMLBase.unwrapped_f(prob_control.f)
6143

6244
new_f = function (du, u, p, t)
6345
_f(@view(du[1:l]), u.u, p, t)
@@ -86,17 +68,8 @@ function cat_problems(prob::DiffEqBase.AbstractSDEProblem,
8668
prob_control::DiffEqBase.AbstractODEProblem)
8769
l = length(prob.u0)
8870

89-
if isdefined(SciMLBase, :unwrapped_f)
90-
_f = SciMLBase.unwrapped_f(prob.f)
91-
else
92-
_f = prob.f
93-
end
94-
95-
if isdefined(SciMLBase, :unwrapped_f)
96-
_f_control = SciMLBase.unwrapped_f(prob_control.f)
97-
else
98-
_f_control = prob_control.f
99-
end
71+
_f = SciMLBase.unwrapped_f(prob.f)
72+
_f_control = SciMLBase.unwrapped_f(prob_control.f)
10073

10174
new_f = function (du, u, p, t)
10275
_f(@view(du[1:l]), u.u, p, t)

src/problem.jl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,7 @@ function extend_problem(prob::DiffEqBase.AbstractDiscreteProblem, jumps; rng = D
227227
end
228228

229229
function extend_problem(prob::DiffEqBase.AbstractODEProblem, jumps; rng = DEFAULT_RNG)
230-
if isdefined(SciMLBase, :unwrapped_f)
231-
_f = SciMLBase.unwrapped_f(prob.f)
232-
else
233-
_f = prob.f
234-
end
230+
_f = SciMLBase.unwrapped_f(prob.f)
235231

236232
jump_f = let _f = _f
237233
function jump_f(du::ExtendedJumpArray, u::ExtendedJumpArray, p, t)

0 commit comments

Comments
 (0)