Skip to content

Commit e3d9875

Browse files
committed
use nameof and operation to get symbols
1 parent 31aadff commit e3d9875

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/systems/diffeqs/abstractodesystem.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ function DiffEqBase.ODEFunction{iip}(sys::AbstractODESystem, dvs = states(sys),
163163
tgrad = _tgrad === nothing ? nothing : _tgrad,
164164
mass_matrix = _M,
165165
jac_prototype = sparse ? similar(sys.jac[],Float64) : nothing,
166-
syms = Symbol.(states(sys)))
166+
syms = nameof.(operation.(states(sys))))
167167
end
168168

169169
"""
@@ -225,7 +225,7 @@ function ODEFunctionExpr{iip}(sys::AbstractODESystem, dvs = states(sys),
225225
tgrad = tgrad,
226226
mass_matrix = M,
227227
jac_prototype = $jp_expr,
228-
syms = $(Symbol.(states(sys))))
228+
syms = $(nameof.(operation.(states(sys)))))
229229
end
230230
!linenumbers ? striplines(ex) : ex
231231
end

src/systems/diffeqs/sdesystem.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ function DiffEqBase.SDEFunction{iip}(sys::SDESystem, dvs = sys.states, ps = sys.
196196
Wfact = _Wfact === nothing ? nothing : _Wfact,
197197
Wfact_t = _Wfact_t === nothing ? nothing : _Wfact_t,
198198
mass_matrix = _M,
199-
syms = Symbol.(sys.states))
199+
syms = nameof.(operation.(states(sys))))
200200
end
201201

202202
function DiffEqBase.SDEFunction(sys::SDESystem, args...; kwargs...)
@@ -269,7 +269,7 @@ function SDEFunctionExpr{iip}(sys::SDESystem, dvs = states(sys),
269269
Wfact = Wfact,
270270
Wfact_t = Wfact_t,
271271
mass_matrix = M,
272-
syms = $(Symbol.(states(sys))),kwargs...)
272+
syms = $(nameof.(operation.(states(sys)))),kwargs...)
273273
end
274274
!linenumbers ? striplines(ex) : ex
275275
end

src/systems/jumps/jumpsystem.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ function DiffEqBase.DiscreteProblem(sys::JumpSystem, u0map, tspan::Tuple,
197197
p = parammap
198198
end
199199
f = DiffEqBase.DISCRETE_INPLACE_DEFAULT
200-
df = DiscreteFunction(f, syms=Symbol.(states(sys)))
200+
df = DiscreteFunction{true,true}(f, syms=nameof.(operation.(states(sys))))
201201
DiscreteProblem(df, u0, tspan, p; kwargs...)
202202
end
203203

@@ -230,7 +230,7 @@ function DiscreteProblemExpr(sys::JumpSystem, u0map, tspan::Tuple,
230230
u0 = $u0
231231
p = $p
232232
tspan = $tspan
233-
df = DiscreteFunction(f, syms=$(Symbol.(states(sys))))
233+
df = DiscreteFunction{true,true}(f, syms=$(nameof.(operation.(states(sys)))))
234234
DiscreteProblem(df, u0, tspan, p; kwargs...)
235235
end
236236
end

0 commit comments

Comments
 (0)