From 718c61a390bae89788aedab978ff19e7f299d779 Mon Sep 17 00:00:00 2001 From: robbybp Date: Mon, 11 Mar 2024 15:33:21 -0600 Subject: [PATCH] use get_vars_from_components rather than identify_variables_in_components --- pyomo/util/subsystems.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pyomo/util/subsystems.py b/pyomo/util/subsystems.py index 69b2f3fd4f8..7db9831c0d0 100644 --- a/pyomo/util/subsystems.py +++ b/pyomo/util/subsystems.py @@ -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 @@ -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)