Skip to content

Commit 3e33d96

Browse files
feat: support get_cmap(::OptimizationSystem)
1 parent 5fb0eff commit 3e33d96

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/utils.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,12 @@ end
739739

740740
function get_cmap(sys, exprs = nothing)
741741
#Inject substitutions for constants => values
742-
cs = collect_constants([collect(get_eqs(sys)); get_observed(sys)]) #ctrls? what else?
742+
buffer = []
743+
has_eqs(sys) && append!(buffer, collect(get_eqs(sys)))
744+
has_observed(sys) && append!(buffer, collect(get_observed(sys)))
745+
has_op(sys) && push!(buffer, get_op(sys))
746+
has_constraints(sys) && append!(buffer, get_constraints(sys))
747+
cs = collect_constants(buffer) #ctrls? what else?
743748
if !empty_substitutions(sys)
744749
cs = [cs; collect_constants(get_substitutions(sys).subs)]
745750
end

0 commit comments

Comments
 (0)