Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jul 16, 2024
1 parent 27b175f commit cd00635
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scripts/gsp_dno_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def join_two_rows_together(x, y, gdf):
gdf.loc[gdf.index == x.name, "geometry"] = geom.geometry
gdf.loc[gdf.index == x.name, "gsp_ids"] += "," + str(y.gsp_id)
gdf.loc[gdf.index == x.name, "installed_capacity_mw"] += y.installed_capacity_mw

# drop row
print(f"dropping {y.name}")
gdf = gdf.drop(y.name)
Expand Down Expand Up @@ -73,8 +73,8 @@ def join_two_rows_together(x, y, gdf):
j = j + 1

# save to csv
gsp = shape_gpd[['GSPGroup','gsp_ids',"installed_capacity_mw"]]
gsp.to_csv('gsp_dno_mapping.csv',index=False)
gsp = shape_gpd[["GSPGroup", "gsp_ids", "installed_capacity_mw"]]
gsp.to_csv("gsp_dno_mapping.csv", index=False)

# lets plot it
shape_gpd.reset_index(inplace=True, drop=True)
Expand All @@ -86,7 +86,8 @@ def join_two_rows_together(x, y, gdf):
go.Choroplethmapbox(
geojson=shapes_dict,
locations=shape_gpd.index.values,
z=shape_gpd['installed_capacity_mw'].values, colorscale="Viridis",
z=shape_gpd["installed_capacity_mw"].values,
colorscale="Viridis",
)
)

Expand All @@ -95,5 +96,4 @@ def join_two_rows_together(x, y, gdf):
fig.show(renderer="browser")

# save html
fig.write_html('gsp_dno_mapping.html')

fig.write_html("gsp_dno_mapping.html")

0 comments on commit cd00635

Please sign in to comment.