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

PV rooftop plants in status quo sometimes have wrong bus ID #1124

Open
khelfen opened this issue Mar 22, 2023 · 0 comments
Open

PV rooftop plants in status quo sometimes have wrong bus ID #1124

khelfen opened this issue Mar 22, 2023 · 0 comments
Assignees
Labels
🐛 bug Something isn't working

Comments

@khelfen
Copy link
Contributor

khelfen commented Mar 22, 2023

At the moment the bus ID for PV rooftop plants in status quo is determined on the grid district boundaries. This is sometimes wrong as the bus IDs for buildings is determined by the zensus cell which always have one distinct bus ID determined by the centroid, but the boundaries usually do not match. This needs to be changed:

def add_bus_ids_sq(
buildings_gdf: gpd.GeoDataFrame,
) -> gpd.GeoDataFrame:
"""Add bus ids for status_quo units
Parameters
-----------
buildings_gdf : geopandas.GeoDataFrame
GeoDataFrame containing OSM buildings data with desaggregated PV
plants.
Returns
-------
geopandas.GeoDataFrame
GeoDataFrame containing OSM building data with bus_id per
generator.
"""
grid_districts_gdf = grid_districts(EPSG)
mask = buildings_gdf.scenario == "status_quo"
buildings_gdf.loc[mask, "bus_id"] = (
buildings_gdf.loc[mask]
.sjoin(grid_districts_gdf, how="left")
.index_right
)
return buildings_gdf

@khelfen khelfen added the 🐛 bug Something isn't working label Mar 22, 2023
@khelfen khelfen self-assigned this Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant