From cc3c3754d8b4cf692e4ec3cb316ee876c3cfda74 Mon Sep 17 00:00:00 2001 From: Bernard Knueven Date: Thu, 27 May 2021 17:16:58 -0600 Subject: [PATCH] eliminating Pyomo 6 deprecation warning --- egret/common/lazy_ptdf_utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/egret/common/lazy_ptdf_utils.py b/egret/common/lazy_ptdf_utils.py index f942579f..1b69ea94 100644 --- a/egret/common/lazy_ptdf_utils.py +++ b/egret/common/lazy_ptdf_utils.py @@ -818,16 +818,16 @@ def uc_instance_binary_relaxer(model, solver): for ivar in _binary_var_generator(model): ivar.domain = pyo.UnitInterval if persistent_solver: - for var in ivar.itervalues(): - solver.update_var(var) + for k in ivar: + solver.update_var(ivar[k]) def uc_instance_binary_enforcer(model, solver): persistent_solver = isinstance(solver, PersistentSolver) for ivar in _binary_var_generator(model): ivar.domain = pyo.Binary if persistent_solver: - for var in ivar.itervalues(): - solver.update_var(var) + for k in ivar: + solver.update_var(ivar[k]) def _load_pf_slacks(solver, m, t_subset): ## ensure the slack variables are loaded