From 263221b70a4071afe95a6642f58871c16a924992 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 25 May 2024 08:54:53 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- Snakefile | 2 +- scripts/base_network.py | 52 +++++++++++++++++++++++++++++------------ 2 files changed, 38 insertions(+), 16 deletions(-) diff --git a/Snakefile b/Snakefile index ee2dc01b1..1e9c21be7 100644 --- a/Snakefile +++ b/Snakefile @@ -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", diff --git a/scripts/base_network.py b/scripts/base_network.py index 98aec0ec8..7b560ed51 100644 --- a/scripts/base_network.py +++ b/scripts/base_network.py @@ -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