Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix printing of reserve requirements #166

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion prescient/engine/data_extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ def get_total_demand(self, sced: OperationsModel) -> float:
pass

@abstractmethod
def get_reserve_requirement(self, sced: OperationsModel) -> float:
def get_reserve_requirement(self, sced: OperationsModel,
reserve_id: ReserveIdentifier) -> float:
pass

@abstractmethod
Expand Down
11 changes: 8 additions & 3 deletions prescient/engine/egret/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,14 @@ def _print_sced_info(self,
sced_data_extractor.get_load_demand(sced_instance,l)))

print("")
print(("%-" + str(max_bus_label_length) + "s %12.2f") %
("Reserve requirement:",
sced_data_extractor.get_reserve_requirement(sced_instance)))
max_res_scope_length = max(
(len(res.scope) for res in sced_data_extractor.get_reserve_products(sced_instance)),
default=None
)
if max_res_scope_length is not None:
print("Reserve requirement:")
for res in sced_data_extractor.get_reserve_products(sced_instance):
print(f" {res.scope:<{max_res_scope_length}} {sced_data_extractor.get_reserve_requirement(sced_instance, res):12.2f}")

total_max_nondispatchable_power = {b : 0. for b in buses}
total_min_nondispatchable_power = {b : 0. for b in buses}
Expand Down