Skip to content

Commit

Permalink
use get_vars_from_components rather than identify_variables_in_compon…
Browse files Browse the repository at this point in the history
…ents
  • Loading branch information
Robbybp committed Mar 11, 2024
1 parent eb913fb commit 718c61a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pyomo/util/subsystems.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from pyomo.core.base.objective import Objective
from pyomo.core.base.external import ExternalFunction
from pyomo.core.expr.visitor import StreamBasedExpressionVisitor
from pyomo.core.expr.visitor import identify_variables_in_components
from pyomo.core.expr.numeric_expr import ExternalFunctionExpression
from pyomo.core.expr.numvalue import native_types, NumericValue
from pyomo.util.vars_from_expressions import get_vars_from_components
Expand Down Expand Up @@ -133,11 +132,8 @@ def create_subsystem_block(constraints, variables=None, include_fixed=False):
block.vars = Reference(variables)
block.cons = Reference(constraints)
var_set = ComponentSet(variables)
#input_vars = get_vars_from_components(
# block, Constraint, include_fixed=include_fixed
#)
input_vars = identify_variables_in_components(
constraints, include_fixed=include_fixed
input_vars = get_vars_from_components(
block, Constraint, include_fixed=include_fixed
)
input_vars = [var for var in input_vars if var not in var_set]
block.input_vars = Reference(input_vars)
Expand Down

0 comments on commit 718c61a

Please sign in to comment.