Merge branch 'master' of github.com:PyPSA/pypsa-eur

This commit is contained in:
Fabian Neumann 2024-05-20 11:54:20 +02:00
commit 6c9fc50a1c
2 changed files with 10 additions and 8 deletions

View File

@ -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()

View File

@ -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/"