From 755831f461a390f00a00e1d62a08f7ca6674d084 Mon Sep 17 00:00:00 2001 From: "gintautas.poderys" Date: Mon, 14 Oct 2024 15:28:34 +0300 Subject: [PATCH] bugfix: set load to zero if no loads found in island --- emf/loadflow_tool/model_merger/merge_functions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emf/loadflow_tool/model_merger/merge_functions.py b/emf/loadflow_tool/model_merger/merge_functions.py index ebaed80..624ac33 100644 --- a/emf/loadflow_tool/model_merger/merge_functions.py +++ b/emf/loadflow_tool/model_merger/merge_functions.py @@ -467,9 +467,9 @@ def generate_merge_report(merged_model, input_models, merge_data): island['slack_bus_region'] = '' network_balance = {"generation_p": float(generation_by_component.loc[island['connected_component_num']].p), - "load_p": float(load_by_component.loc[island['connected_component_num']].p), + "load_p": float(load_by_component.loc[island['connected_component_num']].p) if island['connected_component_num'] in load_by_component.index else float(0), "generation_q": float(generation_by_component.loc[island['connected_component_num']].q), - "load_q": float(load_by_component.loc[island['connected_component_num']].q), + "load_q": float(load_by_component.loc[island['connected_component_num']].q) if island['connected_component_num'] in load_by_component.index else float(0), "buses": int(buses_by_component.loc[island['connected_component_num']]), "branches": int(branches_by_component.loc[island['connected_component_num']]), }