Skip to content

Commit c496552

Browse files
committed
make dynamic_rule always take the nested f
1 parent 5a7b780 commit c496552

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "DynamicalSystemsBase"
22
uuid = "6e36e845-645a-534a-86f2-f5d4aa5a06b4"
33
repo = "https://github.com/JuliaDynamics/DynamicalSystemsBase.jl.git"
4-
version = "3.12.1"
4+
version = "3.12.2"
55

66
[deps]
77
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"

ext/src/CoupledSDEs.jl

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -160,16 +160,6 @@ StateSpaceSets.dimension(::CoupledSDEs{IIP,D}) where {IIP,D} = D
160160
DynamicalSystemsBase.current_state(ds::CoupledSDEs) = current_state(ds.integ)
161161
DynamicalSystemsBase.isdeterministic(ds::CoupledSDEs) = false
162162

163-
function DynamicalSystemsBase.dynamic_rule(ds::CoupledSDEs)
164-
# with remake it can happen that we have nested SDEFunctions
165-
# sciml integrator deals with this internally well
166-
f = ds.integ.f
167-
while hasfield(typeof(f), :f)
168-
f = f.f
169-
end
170-
return f
171-
end
172-
173163
function DynamicalSystemsBase.set_state!(ds::CoupledSDEs, u::AbstractArray)
174164
(set_state!(ds.integ, u); ds)
175165
end

src/core_systems/continuous_time_ode.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,15 @@ function SciMLBase.reinit!(ds::ContinuousTimeDynamicalSystem, u::AbstractArray =
150150
end
151151

152152
# `DEIntegrator` stuff
153-
dynamic_rule(integ::DEIntegrator) = integ.f.f
153+
function dynamic_rule(integ::DEIntegrator)
154+
# with remake it can happen that we have nested SDEFunctions
155+
# sciml integrator deals with this internally well
156+
f = integ.f
157+
while hasfield(typeof(f), :f)
158+
f = f.f
159+
end
160+
return f
161+
end
154162
current_parameters(integ::DEIntegrator) = integ.p
155163
initial_state(integ::DEIntegrator) = integ.sol.prob.u0
156164
current_state(ds::CoupledODEs) = current_state(ds.integ)

0 commit comments

Comments
 (0)