Skip to content

Commit 4792076

Browse files
committed
name field via getter
1 parent c400c00 commit 4792076

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/systems/abstractsystem.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ end
194194
function SymbolicIndexingInterface.is_variable(sys::AbstractSystem, sym::Symbol)
195195
return any(isequal(sym), getname.(variable_symbols(sys))) ||
196196
count('', string(sym)) == 1 &&
197-
count(isequal(sym), Symbol.(sys.name, :₊, getname.(variable_symbols(sys)))) == 1
197+
count(isequal(sym), Symbol.(nameof(sys), :₊, getname.(variable_symbols(sys)))) == 1
198198
end
199199

200200
function SymbolicIndexingInterface.variable_index(sys::AbstractSystem, sym)
@@ -213,7 +213,7 @@ function SymbolicIndexingInterface.variable_index(sys::AbstractSystem, sym::Symb
213213
if idx !== nothing
214214
return idx
215215
elseif count('', string(sym)) == 1
216-
return findfirst(isequal(sym), Symbol.(sys.name, :₊, getname.(variable_symbols(sys))))
216+
return findfirst(isequal(sym), Symbol.(nameof(sys), :₊, getname.(variable_symbols(sys))))
217217
end
218218
return nothing
219219
end
@@ -236,7 +236,7 @@ end
236236
function SymbolicIndexingInterface.is_parameter(sys::AbstractSystem, sym::Symbol)
237237
return any(isequal(sym), getname.(parameter_symbols(sys))) ||
238238
count('', string(sym)) == 1 &&
239-
count(isequal(sym), Symbol.(sys.name, :₊, getname.(parameter_symbols(sys)))) == 1
239+
count(isequal(sym), Symbol.(nameof(sys), :₊, getname.(parameter_symbols(sys)))) == 1
240240
end
241241

242242
function SymbolicIndexingInterface.parameter_index(sys::AbstractSystem, sym)
@@ -255,7 +255,7 @@ function SymbolicIndexingInterface.parameter_index(sys::AbstractSystem, sym::Sym
255255
if idx !== nothing
256256
return idx
257257
elseif count('', string(sym)) == 1
258-
return findfirst(isequal(sym), Symbol.(sys.name, :₊, getname.(parameter_symbols(sys))))
258+
return findfirst(isequal(sym), Symbol.(nameof(sys), :₊, getname.(parameter_symbols(sys))))
259259
end
260260
return nothing
261261
end
@@ -656,7 +656,7 @@ function states(sys::AbstractSystem)
656656
end
657657
isempty(nonunique_states) && return nonunique_states
658658
# `Vector{Any}` is incompatible with the `SymbolicIndexingInterface`, which uses
659-
# `elsymtype = symbolic_type(eltype(_arg))`
659+
# `elsymtype = symbolic_type(eltype(_arg))`
660660
# which inappropriately returns `NotSymbolic()`
661661
if nonunique_states isa Vector{Any}
662662
nonunique_states = _nonum.(nonunique_states)

0 commit comments

Comments
 (0)