Skip to content

Commit a02fb6e

Browse files
fixup! fixup! fix: fix callback codegen, observed eqs with non-scalarized symbolic arrays
1 parent 9b7bd13 commit a02fb6e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/systems/optimization/constraints_system.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,15 @@ function generate_canonical_form_lhss(sys)
226226
lhss = subs_constants([Symbolics.canonical_form(eq).lhs for eq in constraints(sys)])
227227
end
228228

229-
function get_cmap(sys::ConstraintsSystem)
229+
function get_cmap(sys::ConstraintsSystem, exprs = nothing)
230230
#Inject substitutions for constants => values
231231
cs = collect_constants([get_constraints(sys); get_observed(sys)]) #ctrls? what else?
232232
if !empty_substitutions(sys)
233233
cs = [cs; collect_constants(get_substitutions(sys).subs)]
234234
end
235+
if exprs !== nothing
236+
cs = [cs; collect_contants(exprs)]
237+
end
235238
# Swap constants for their values
236239
cmap = map(x -> x ~ getdefault(x), cs)
237240
return cmap, cs

0 commit comments

Comments
 (0)