From ce14cd664767dd65738bf28d7119d41ead55350c Mon Sep 17 00:00:00 2001 From: Parisra <102019906+Parisra@users.noreply.github.com> Date: Thu, 16 May 2024 17:06:28 +0200 Subject: [PATCH 1/3] Update plot_summary.py -Add 2022 emissions to plot carbon budget -Add UK emissions to the previous numbers --- scripts/plot_summary.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/plot_summary.py b/scripts/plot_summary.py index 8d983ce9..c8449027 100644 --- a/scripts/plot_summary.py +++ b/scripts/plot_summary.py @@ -477,9 +477,10 @@ def plot_carbon_budget_distribution(input_eurostat, options): ) emissions = historical_emissions(countries) # add other years https://sdi.eea.europa.eu/data/0569441f-2853-4664-a7cd-db969ef54de0 - emissions.loc[2019] = 2.971372 - emissions.loc[2020] = 2.691958 - emissions.loc[2021] = 2.869355 + emissions.loc[2019] = 3.414362 + emissions.loc[2020] = 3.092434 + emissions.loc[2021] = 3.290418 + emissions.loc[2022] = 3.213025 if snakemake.config["foresight"] == "myopic": path_cb = "results/" + snakemake.params.RDIR + "/csvs/" From ac48fdaaf43c4ca200efd913af3e6773ec5cd501 Mon Sep 17 00:00:00 2001 From: Philipp Glaum Date: Fri, 17 May 2024 14:46:20 +0200 Subject: [PATCH 2/3] base_network.py: connect new tyndp links only to closest AC bus --- scripts/base_network.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/base_network.py b/scripts/base_network.py index 870fcf19..b811f625 100644 --- a/scripts/base_network.py +++ b/scripts/base_network.py @@ -272,14 +272,15 @@ def _add_links_from_tyndp(buses, links, links_tyndp, europe_shape): if links_tyndp.empty: return buses, links - tree = spatial.KDTree(buses[["x", "y"]]) + tree_buses = buses.query("carrier=='AC'") + tree = spatial.KDTree(tree_buses[["x", "y"]]) _, ind0 = tree.query(links_tyndp[["x1", "y1"]]) - ind0_b = ind0 < len(buses) - links_tyndp.loc[ind0_b, "bus0"] = buses.index[ind0[ind0_b]] + ind0_b = ind0 < len(tree_buses) + links_tyndp.loc[ind0_b, "bus0"] = tree_buses.index[ind0[ind0_b]] _, ind1 = tree.query(links_tyndp[["x2", "y2"]]) - ind1_b = ind1 < len(buses) - links_tyndp.loc[ind1_b, "bus1"] = buses.index[ind1[ind1_b]] + ind1_b = ind1 < len(tree_buses) + links_tyndp.loc[ind1_b, "bus1"] = tree_buses.index[ind1[ind1_b]] links_tyndp_located_b = ( links_tyndp["bus0"].notnull() & links_tyndp["bus1"].notnull() From b890149d39aa05cd91d52d792a2b395e5aae06cb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 18 May 2024 12:22:28 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- scripts/plot_summary.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/plot_summary.py b/scripts/plot_summary.py index c8449027..39fbba03 100644 --- a/scripts/plot_summary.py +++ b/scripts/plot_summary.py @@ -477,9 +477,9 @@ def plot_carbon_budget_distribution(input_eurostat, options): ) emissions = historical_emissions(countries) # add other years https://sdi.eea.europa.eu/data/0569441f-2853-4664-a7cd-db969ef54de0 - emissions.loc[2019] = 3.414362 - emissions.loc[2020] = 3.092434 - emissions.loc[2021] = 3.290418 + emissions.loc[2019] = 3.414362 + emissions.loc[2020] = 3.092434 + emissions.loc[2021] = 3.290418 emissions.loc[2022] = 3.213025 if snakemake.config["foresight"] == "myopic":