From 72e3e1e716d748ad69137ddac52580b5edcb7f93 Mon Sep 17 00:00:00 2001 From: Darryl Date: Mon, 18 Apr 2022 16:39:14 -0600 Subject: [PATCH] Clean up some key checking Co-authored-by: bknueven <30801372+bknueven@users.noreply.github.com> --- prescient/simulator/oracle_manager.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/prescient/simulator/oracle_manager.py b/prescient/simulator/oracle_manager.py index 57e3ec4c..8a4652dc 100644 --- a/prescient/simulator/oracle_manager.py +++ b/prescient/simulator/oracle_manager.py @@ -325,14 +325,11 @@ def _report_sced_stats(self, ops_stats: OperationsStats): if ops_stats.over_generation!= 0.0: print("Over-generation reported at t=%d - total=%12.2f" % (1, ops_stats.over_generation)) - try: - for res in ops_stats.reserve_products: - if ops_stats.reserve_shortfalls[res] != 0.0: - print("Reserve shortfall reported at t=%2d: %12.2f" % (1, ops_stats.reserve_shortfalls[res])) - print("Quick start generation capacity available at t=%2d: %12.2f" % (1, ops_stats.available_quickstart)) - print("") - except Exception as ex: - print(ex) + for res in ops_stats.reserve_products: + if res in ops_stats.reserve_shortfalls and ops_stats.reserve_shortfalls[res] != 0.0: + print("Reserve shortfall reported at t=%2d: %12.2f" % (1, ops_stats.reserve_shortfalls[res])) + print("Quick start generation capacity available at t=%2d: %12.2f" % (1, ops_stats.available_quickstart)) + print("") if ops_stats.renewables_curtailment > 0: print("Renewables curtailment reported at t=%d - total=%12.2f" % (1, ops_stats.renewables_curtailment))