Skip to content

Commit

Permalink
Fix for an empty list
Browse files Browse the repository at this point in the history
  • Loading branch information
ekatef committed May 3, 2023
1 parent b01438c commit 2ad4a37
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/simplify_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,8 @@ def aggregate_to_substations(n, aggregation_strategies=dict(), buses_i=None):
dist.loc[incarrier_b, ~incarrier_b] = np.inf

busmap = n.buses.index.to_series()
busmap.loc[buses_i] = dist.idxmin(1)
if dist:
busmap.loc[buses_i] = dist.idxmin(1)

bus_strategies, generator_strategies = get_aggregation_strategies(
aggregation_strategies
Expand Down

0 comments on commit 2ad4a37

Please sign in to comment.