grid-parity-exchange / Egret

Tools for building power systems optimization problems
Other
126 stars 50 forks source link

Refactoring _lazy_ptdf_uc_solve_loop into component functions #224

Closed bknueven closed 3 years ago

bknueven commented 3 years ago

This PR simply refactors the 100-line function which controls a lazy-ptdf pass to call several new functions for its main components to make the existing functionality more modular.

Bigger question: there's now ~300 lines of lazy PTDF logic in unit_commitment.py that should probably be in its own file, and probably be further refactored. There's also the function _lazy_ptdf_dcopf_solve_loop in dcopf.py and the files egret/common/lazy_ptdf_utils.py and the file egret/data/ptdf_utils.py. Should we organize Egret's PTDF functionality into its own (top-level) directory?

Also makes some unrelated changes to the Prescient CI tests because Prescient's dependencies are not currently reliably installed via pip https://github.com/grid-parity-exchange/Prescient/pull/92.