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

create a bus for every unique coordinate, not only substations #922

Merged
merged 3 commits into from
Feb 16, 2024
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
5 changes: 5 additions & 0 deletions doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ Release Notes
Upcoming Release
================

* Regions are assigned to all buses with unique coordinates in the network with
a preference given to substations. Previously, only substations had assigned
regions, but this could lead to issues when a high spatial resolution was
applied.

* The default configuration ``config/config.default.yaml`` is now automatically
used as a base configuration file and no longer copied to
``config/config.yaml`` on first use. The file ``config/config.yaml`` should be
Expand Down
1 change: 1 addition & 0 deletions scripts/base_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ def prefer_voltage(x, which):
for b, df in product(("bus0", "bus1"), (n.lines, n.links)):
has_connections_b |= ~df.groupby(b).under_construction.min()

buses["onshore_bus"] = onshore_b
buses["substation_lv"] = (
lv_b & onshore_b & (~buses["under_construction"]) & has_connections_b
)
Expand Down
8 changes: 7 additions & 1 deletion scripts/build_bus_regions.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,13 @@ def voronoi_partition_pts(points, outline):
c_b = n.buses.country == country

onshore_shape = country_shapes[country]
onshore_locs = n.buses.loc[c_b & n.buses.substation_lv, ["x", "y"]]
onshore_locs = (
n.buses.loc[c_b & n.buses.onshore_bus]
.sort_values(
by="substation_lv", ascending=False
) # preference for substations
.drop_duplicates(subset=["x", "y"], keep="first")[["x", "y"]]
)
onshore_regions.append(
gpd.GeoDataFrame(
{
Expand Down
1 change: 1 addition & 0 deletions scripts/simplify_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,7 @@ def cluster(
"symbol",
"tags",
"under_construction",
"onshore_bus",
"substation_lv",
"substation_off",
"geometry",
Expand Down
Loading