Skip to content

Commit 2e4fa26

Browse files
committed
fixup! refactor: make LabelledArrays an extension
1 parent ed29f63 commit 2e4fa26

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

ext/MTKLabelledArraysExt.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,13 @@ function ModelingToolkit.define_vars(u::Union{SLArray, LArray}, t)
66
[_defvar(x)(t) for x in LabelledArrays.symnames(typeof(u))]
77
end
88

9+
function ModelingToolkit.define_params(p::Union{SLArray, LArray}, names = nothing)
10+
if names === nothing
11+
[toparam(variable(x)) for x in LabelledArrays.symnames(typeof(p))]
12+
else
13+
varnames_length_check(p, names)
14+
[toparam(variable(names[i])) for i in eachindex(p)]
15+
end
16+
end
17+
918
end

src/systems/diffeqs/modelingtoolkitize.jl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -180,15 +180,6 @@ function define_params(p::AbstractDict, names = nothing)
180180
end
181181
end
182182

183-
function define_params(p::Union{SLArray, LArray}, names = nothing)
184-
if names === nothing
185-
[toparam(variable(x)) for x in LabelledArrays.symnames(typeof(p))]
186-
else
187-
varnames_length_check(p, names)
188-
[toparam(variable(names[i])) for i in eachindex(p)]
189-
end
190-
end
191-
192183
function define_params(p::Tuple, names = nothing)
193184
if names === nothing
194185
tuple((toparam(variable(, i)) for i in eachindex(p))...)

0 commit comments

Comments
 (0)