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 May 25, 2024
1 parent 7b2e864 commit 263221b
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ rule base_network:
hvdc_as_lines=config["electricity"]["hvdc_as_lines"],
countries=config["countries"],
base_network=config["base_network"],
cooking=config["cooking"]["stove"] # added link to config for cooking
cooking=config["cooking"]["stove"], # added link to config for cooking
input:
osm_buses="resources/" + RDIR + "base_network/all_buses_build_network.csv",
osm_lines="resources/" + RDIR + "base_network/all_lines_build_network.csv",
Expand Down
52 changes: 37 additions & 15 deletions scripts/base_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,43 @@ def _load_buses_from_osm(fp_buses):

# create a function to add the buses
stove = snakemake.params.cooking
x = [0,0,0,0,0,0]
y = [0,0,0,0,0,0]
geometry = ['NA','NA','NA','NA','NA','NA']
country = ['ZM','ZM','ZM','ZM','ZM','ZM']
tag_area = [0,0,0,0,0,0]
tag_substation = [0,0,0,0,0,0]
under_construction = [False,False,False,False,False,False]
symbol = ['substation','substation','substation','substation','substation','substation']
v_nom = [0,0,0,0,0,0]
substation_lv = [False,False,False,False,False,False]

stove_df = pd.DataFrame({'v_nom':v_nom, 'symbol':symbol, 'under_construction':under_construction, 'tag_substation':tag_substation, 'tag_area':tag_area,
'lon':y, 'lat':x, 'country':country, 'geometry':geometry, 'substation_lv':substation_lv, 'carrier':stove, 'x':x,'y':y})

buses = pd.concat([buses, stove_df], ignore_index=True) # what worked
x = [0, 0, 0, 0, 0, 0]
y = [0, 0, 0, 0, 0, 0]
geometry = ["NA", "NA", "NA", "NA", "NA", "NA"]
country = ["ZM", "ZM", "ZM", "ZM", "ZM", "ZM"]
tag_area = [0, 0, 0, 0, 0, 0]
tag_substation = [0, 0, 0, 0, 0, 0]
under_construction = [False, False, False, False, False, False]
symbol = [
"substation",
"substation",
"substation",
"substation",
"substation",
"substation",
]
v_nom = [0, 0, 0, 0, 0, 0]
substation_lv = [False, False, False, False, False, False]

stove_df = pd.DataFrame(
{
"v_nom": v_nom,
"symbol": symbol,
"under_construction": under_construction,
"tag_substation": tag_substation,
"tag_area": tag_area,
"lon": y,
"lat": x,
"country": country,
"geometry": geometry,
"substation_lv": substation_lv,
"carrier": stove,
"x": x,
"y": y,
}
)

buses = pd.concat([buses, stove_df], ignore_index=True) # what worked

return buses

Expand Down

0 comments on commit 263221b

Please sign in to comment.