From c5ca8f4c20ada5c987f36f4bba247f19069166d7 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Tue, 12 Apr 2022 16:11:06 +0200 Subject: [PATCH 1/2] fix: squeeze IDEES dataframe at correct location --- scripts/build_industry_sector_ratios.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build_industry_sector_ratios.py b/scripts/build_industry_sector_ratios.py index 16c9de9e..c8cac055 100644 --- a/scripts/build_industry_sector_ratios.py +++ b/scripts/build_industry_sector_ratios.py @@ -79,10 +79,10 @@ def load_idees_data(sector, country="EU28"): index_col=0, header=0, usecols=usecols, - ).squeeze('columns') + ) for k, v in sheets.items(): - idees[k] = idees.pop(v) + idees[k] = idees.pop(v).squeeze() return idees From cdd56288ff73eb6626b7377f1170ba585c5ff939 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Tue, 12 Apr 2022 16:21:09 +0200 Subject: [PATCH 2/2] fix EU bus location with new config setting --- config.default.yaml | 3 +++ scripts/plot_network.py | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/config.default.yaml b/config.default.yaml index 5340682b..8e39affe 100644 --- a/config.default.yaml +++ b/config.default.yaml @@ -388,6 +388,9 @@ plotting: color_geomap: ocean: white land: whitesmoke + eu_node_location: + x: -5.5 + y: 46. costs_max: 1000 costs_threshold: 1 energy_max: 20000 diff --git a/scripts/plot_network.py b/scripts/plot_network.py index 1a56cc4b..4a1bc6d0 100644 --- a/scripts/plot_network.py +++ b/scripts/plot_network.py @@ -115,7 +115,9 @@ def plot_map(network, components=["links", "stores", "storage_units", "generator costs = costs.stack() # .sort_index() # hack because impossible to drop buses... - n.buses.loc["EU gas", ["x", "y"]] = n.buses.loc["DE0 0", ["x", "y"]] + eu_location = snakemake.config["plotting"].get("eu_node_location", dict(x=-5.5, y=46)) + n.buses.loc["EU gas", "x"] = eu_location["x"] + n.buses.loc["EU gas", "y"] = eu_location["y"] n.links.drop(n.links.index[(n.links.carrier != "DC") & ( n.links.carrier != "B2B")], inplace=True) @@ -524,7 +526,9 @@ def plot_map_without(network): # hack because impossible to drop buses... if "EU gas" in n.buses.index: - n.buses.loc["EU gas", ["x", "y"]] = n.buses.loc["DE0 0", ["x", "y"]] + eu_location = snakemake.config["plotting"].get("eu_node_location", dict(x=-5.5, y=46)) + n.buses.loc["EU gas", "x"] = eu_location["x"] + n.buses.loc["EU gas", "y"] = eu_location["y"] to_drop = n.links.index[(n.links.carrier != "DC") & (n.links.carrier != "B2B")] n.links.drop(to_drop, inplace=True)