Skip to content

Commit

Permalink
apply patch
Browse files Browse the repository at this point in the history
  • Loading branch information
bknueven committed Mar 7, 2024
1 parent 4ee719c commit e8b4593
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyomo/contrib/appsi/cmodel/src/expression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1548,7 +1548,10 @@ appsi_operator_from_pyomo_expr(py::handle expr, py::handle var_map,
break;
}
case param: {
res = param_map[expr_types.id(expr)].cast<std::shared_ptr<Node>>();
if (expr.attr("parent_component")().attr("mutable").cast<bool>())
res = param_map[expr_types.id(expr)].cast<std::shared_ptr<Node>>();
else
res = std::make_shared<Constant>(expr.attr("value").cast<double>());
break;
}
case product: {
Expand Down

0 comments on commit e8b4593

Please sign in to comment.