Skip to content

Commit

Permalink
added clean cooking carriers to the snakefile
Browse files Browse the repository at this point in the history
  • Loading branch information
Mwiche96 committed May 25, 2024
1 parent de4da14 commit 7b2e864
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +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
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
18 changes: 18 additions & 0 deletions scripts/base_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,24 @@ def _load_buses_from_osm(fp_buses):
# TODO: Drop NAN maybe somewhere else?
buses = buses.dropna(axis="index", subset=["x", "y", "country"])

# 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

return buses


Expand Down

0 comments on commit 7b2e864

Please sign in to comment.