Skip to content

Commit 658a916

Browse files
Modify argument to discrete constraint reformulation function
1 parent f1fd189 commit 658a916

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

pyomo/contrib/pyros/util.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -2344,7 +2344,7 @@ def check_time_limit_reached(timing_data, config):
23442344

23452345

23462346
def _reformulate_eq_con_scenario_uncertainty(
2347-
working_model, discrete_set, ss_eq_con, ss_eq_con_index, ss_var_id_to_dr_expr_map
2347+
model_data, discrete_set, ss_eq_con, ss_eq_con_index, ss_var_id_to_dr_expr_map
23482348
):
23492349
"""
23502350
Reformulate a second-stage equality constraint that
@@ -2359,21 +2359,22 @@ def _reformulate_eq_con_scenario_uncertainty(
23592359
23602360
Parameters
23612361
----------
2362-
working_model : ConcreteModel
2363-
Mostly preprocessed working model.
2362+
model_data : ModelData
2363+
Model data object, with mostly preprocessed working model.
23642364
discrete_set : UncertaintySet
23652365
Uncertainty set with scenario-based geometry.
23662366
ss_eq_con : ConstraintData
23672367
Second-stage equality constraint to be reformulated.
23682368
Expected to be a member of
2369-
``working_model.second_stage.equality_cons``.
2369+
``model_data.working_model.second_stage.equality_cons``.
23702370
ss_eq_con_index : hashable
23712371
Index of the equality constraint in
2372-
``working_model.second_stage.equality_cons``.
2372+
``model_data.working_model.second_stage.equality_cons``.
23732373
ss_var_id_to_dr_expr_map : dict
23742374
Mapping from object IDs of second-stage variables to
23752375
corresponding decision rule expressions.
23762376
"""
2377+
working_model = model_data.working_model
23772378
con_expr_after_dr_substitution = replace_expressions(
23782379
expr=ss_eq_con.expr, substitution_map=ss_var_id_to_dr_expr_map
23792380
)
@@ -2654,7 +2655,7 @@ def reformulate_state_var_independent_eq_cons(model_data):
26542655
if coefficient_matching_applicable:
26552656
if config.uncertainty_set.geometry.name == "DISCRETE_SCENARIOS":
26562657
_reformulate_eq_con_scenario_uncertainty(
2657-
working_model=working_model,
2658+
model_data=model_data,
26582659
ss_eq_con=con,
26592660
ss_eq_con_index=con_idx,
26602661
discrete_set=config.uncertainty_set,

0 commit comments

Comments
 (0)