grid-parity-exchange / Egret

Tools for building power systems optimization problems
Other
131 stars 51 forks source link

Eliminating Pyomo 6 deprecation warning #232

Closed bknueven closed 3 years ago

bknueven commented 3 years ago

IndexedComponent.itervalues() was deprecated in Pyomo 6; this PR eliminates calls to it from Egret. I believe this implementation should have the same performance on older versions of Pyomo, while bypassing creating an itermediate list like the value method does in older (and current) versions of Pyomo.

One incongruity I caught in current Pyomo: the keys(), values(), and items() methods on IndexedComponent document returning an iterator, but instead return a list.