Skip to content

Commit

Permalink
fix: properly namespace array variables passed to subcomponents
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSabharwal committed Sep 20, 2024
1 parent 7ccd5ab commit ac88d49
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ModelingToolkit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ import Symbolics: rename, get_variables!, _solve, hessian_sparsity,
ParallelForm, SerialForm, MultithreadedForm, build_function,
rhss, lhss, prettify_expr, gradient,
jacobian, hessian, derivative, sparsejacobian, sparsehessian,
substituter, scalarize, getparent, hasderiv, hasdiff
substituter, scalarize, getparent, hasderiv, hasdiff, Arr

import DiffEqBase: @add_kwonly
export independent_variables, unknowns, parameters, full_parameters, continuous_events,
Expand Down
1 change: 1 addition & 0 deletions src/systems/abstractsystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,7 @@ end

apply_to_variables(f::F, ex) where {F} = _apply_to_variables(f, ex)
apply_to_variables(f::F, ex::Num) where {F} = wrap(_apply_to_variables(f, unwrap(ex)))
apply_to_variables(f::F, ex::Arr) where {F} = wrap(_apply_to_variables(f, unwrap(ex)))
function _apply_to_variables(f::F, ex) where {F}
if isvariable(ex)
return f(ex)
Expand Down

0 comments on commit ac88d49

Please sign in to comment.