remove adjust_transport_temporal_agg
This commit is contained in:
parent
5b5be71341
commit
1aa4f12c5e
@ -18,7 +18,6 @@ from _helpers import (
|
|||||||
update_config_from_wildcards,
|
update_config_from_wildcards,
|
||||||
)
|
)
|
||||||
from add_existing_baseyear import add_build_year_to_new_assets
|
from add_existing_baseyear import add_build_year_to_new_assets
|
||||||
from prepare_sector_network import adjust_transport_temporal_agg
|
|
||||||
from pypsa.descriptors import expand_series
|
from pypsa.descriptors import expand_series
|
||||||
from pypsa.io import import_components_from_dataframe
|
from pypsa.io import import_components_from_dataframe
|
||||||
from six import iterkeys
|
from six import iterkeys
|
||||||
@ -521,7 +520,6 @@ if __name__ == "__main__":
|
|||||||
segments = snakemake.params.time_resolution
|
segments = snakemake.params.time_resolution
|
||||||
if isinstance(segments, (int, float)):
|
if isinstance(segments, (int, float)):
|
||||||
n = apply_time_segmentation_perfect(n, segments, solver_name=solver_name)
|
n = apply_time_segmentation_perfect(n, segments, solver_name=solver_name)
|
||||||
adjust_transport_temporal_agg(n)
|
|
||||||
|
|
||||||
# adjust global constraints lv limit if the same for all years
|
# adjust global constraints lv limit if the same for all years
|
||||||
n = adjust_lvlimit(n)
|
n = adjust_lvlimit(n)
|
||||||
|
@ -3751,32 +3751,6 @@ def lossy_bidirectional_links(n, carrier, efficiencies={}):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def adjust_transport_temporal_agg(n):
|
|
||||||
|
|
||||||
engine_types = {
|
|
||||||
"fuel_cell": "land transport fuel cell",
|
|
||||||
"electric": "land transport EV",
|
|
||||||
"ice": "land transport oil",
|
|
||||||
}
|
|
||||||
|
|
||||||
p_set = n.loads_t.p_set.loc[:, n.loads.carrier == "land transport demand"]
|
|
||||||
|
|
||||||
for engine, carrier in engine_types.items():
|
|
||||||
share = get(options[f"land_transport_{engine}_share"], investment_year)
|
|
||||||
|
|
||||||
if share == 0:
|
|
||||||
continue
|
|
||||||
links_i = n.links[n.links.carrier == carrier].index
|
|
||||||
efficiency = n.links_t.efficiency.loc[:, links_i]
|
|
||||||
p_set.columns = efficiency.columns
|
|
||||||
p_nom = share * p_set.div(efficiency).max()
|
|
||||||
profile = p_set.div(efficiency) / p_set.div(efficiency).max()
|
|
||||||
|
|
||||||
n.links.loc[links_i, "p_nom"] = p_nom
|
|
||||||
n.links_t.p_max_pu[links_i] = profile
|
|
||||||
n.links_t.p_min_pu[links_i] = profile
|
|
||||||
|
|
||||||
|
|
||||||
# %%
|
# %%
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
if "snakemake" not in globals():
|
if "snakemake" not in globals():
|
||||||
@ -3881,8 +3855,6 @@ if __name__ == "__main__":
|
|||||||
resolution = snakemake.params.time_resolution
|
resolution = snakemake.params.time_resolution
|
||||||
n = set_temporal_aggregation(n, resolution, solver_name)
|
n = set_temporal_aggregation(n, resolution, solver_name)
|
||||||
|
|
||||||
adjust_transport_temporal_agg(n)
|
|
||||||
|
|
||||||
co2_budget = snakemake.params.co2_budget
|
co2_budget = snakemake.params.co2_budget
|
||||||
if isinstance(co2_budget, str) and co2_budget.startswith("cb"):
|
if isinstance(co2_budget, str) and co2_budget.startswith("cb"):
|
||||||
fn = "results/" + snakemake.params.RDIR + "/csvs/carbon_budget_distribution.csv"
|
fn = "results/" + snakemake.params.RDIR + "/csvs/carbon_budget_distribution.csv"
|
||||||
|
Loading…
Reference in New Issue
Block a user