Skip to content

Commit

Permalink
Merge pull request #73 from SciML/as/array-indexing-getu
Browse files Browse the repository at this point in the history
fix: fix array symbolics indexing with symbolic elsymtype
  • Loading branch information
AayushSabharwal authored May 3, 2024
2 parents 0da7156 + 3011f89 commit 367f6ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/parameter_indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ for (t1, t2) in [
end
end

function _getp(sys, ::ArraySymbolic, ::NotSymbolic, p)
function _getp(sys, ::ArraySymbolic, ::SymbolicTypeTrait, p)
if is_parameter(sys, p)
idx = parameter_index(sys, p)
return invoke(_getp, Tuple{Any, NotSymbolic, NotSymbolic, Any},
Expand Down Expand Up @@ -218,7 +218,7 @@ for (t1, t2) in [
end
end

function _setp(sys, ::ArraySymbolic, ::NotSymbolic, p)
function _setp(sys, ::ArraySymbolic, ::SymbolicTypeTrait, p)
if is_parameter(sys, p)
idx = parameter_index(sys, p)
return setp(sys, idx; run_hook = false)
Expand Down
4 changes: 2 additions & 2 deletions src/state_indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ for (t1, t2) in [
end
end

function _getu(sys, ::ArraySymbolic, ::NotSymbolic, sym)
function _getu(sys, ::ArraySymbolic, ::SymbolicTypeTrait, sym)
if is_variable(sys, sym)
idx = variable_index(sys, sym)
return getu(sys, idx)
Expand Down Expand Up @@ -233,7 +233,7 @@ for (t1, t2) in [
end
end

function _setu(sys, ::ArraySymbolic, ::NotSymbolic, sym)
function _setu(sys, ::ArraySymbolic, ::SymbolicTypeTrait, sym)
if is_variable(sys, sym)
idx = variable_index(sys, sym)
if idx isa AbstractArray
Expand Down

0 comments on commit 367f6ae

Please sign in to comment.