Skip to content

Commit

Permalink
add grid_equivalent kwarg
Browse files Browse the repository at this point in the history
  • Loading branch information
SteffenMeinecke committed Jan 10, 2024
1 parent 1c6781f commit ea93e96
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions pandapower/grid_equivalents/get_equivalent.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ def get_equivalent(net, eq_type, boundary_buses, internal_buses,

if return_internal:
logger.debug("Merging of internal and equivalent network begins.")
if len(kwargs.get("central_controller_types", [])):
net_internal.controller.drop([idx for idx in net_internal.controller.index if any([

Check warning on line 263 in pandapower/grid_equivalents/get_equivalent.py

View check run for this annotation

Codecov / codecov/patch

pandapower/grid_equivalents/get_equivalent.py#L263

Added line #L263 was not covered by tests
isinstance(net_internal.controller.object.at[idx], central_controller_type) for
central_controller_type in kwargs["central_controller_types"]])], inplace=True)
net_eq = merge_internal_net_and_equivalent_external_net(
net_eq, net_internal, show_computing_time=show_computing_time,
calc_volt_angles=calculate_voltage_angles)
Expand Down
3 changes: 2 additions & 1 deletion pandapower/toolbox/grid_modification.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ def select_subnet(net, buses, include_switch_buses=False, include_results=False,
buses_to_add.add(fb)
buses |= buses_to_add

if keep_everything_else:
if keep_everything_else: # Info: keep_everything_else might help to keep controllers but
# does not help if a part of controllers should be kept
p2 = copy.deepcopy(net)
if not include_results:
clear_result_tables(p2)
Expand Down

0 comments on commit ea93e96

Please sign in to comment.