Skip to content

Commit

Permalink
refactor: add edge case for parameter_index
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSabharwal committed Nov 28, 2023
1 parent ea7bf1a commit f245c52
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/systems/abstractsystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@ function SymbolicIndexingInterface.is_parameter(sys::AbstractSystem, sym::Symbol
end

function SymbolicIndexingInterface.parameter_index(sys::AbstractSystem, sym)
if unwrap(sym) isa Int
return unwrap(sym)
end
idx = findfirst(isequal(sym), parameters(sys))
if idx === nothing && hasname(sym)
idx = parameter_index(sys, getname(sym))
Expand Down

0 comments on commit f245c52

Please sign in to comment.