Merge pull request #1029 from PyPSA/Climact-feature/fix-add-land-use-constraint-m
Climact feature/fix add land use constraint m
This commit is contained in:
commit
a835f505c8
@ -184,8 +184,11 @@ Upcoming Release
|
|||||||
|
|
||||||
* Fix custom busmap read in `cluster_network`.
|
* Fix custom busmap read in `cluster_network`.
|
||||||
|
|
||||||
|
* Fix p_nom_min of renewables generators for myopic approach and add check of existing capacities in `add_land_use_constraint_m`.
|
||||||
|
|
||||||
* Add documentation section for how to contribute documentation
|
* Add documentation section for how to contribute documentation
|
||||||
|
|
||||||
|
|
||||||
PyPSA-Eur 0.10.0 (19th February 2024)
|
PyPSA-Eur 0.10.0 (19th February 2024)
|
||||||
=====================================
|
=====================================
|
||||||
|
|
||||||
|
@ -159,6 +159,9 @@ def _add_land_use_constraint_m(n, planning_horizons, config):
|
|||||||
current_horizon = snakemake.wildcards.planning_horizons
|
current_horizon = snakemake.wildcards.planning_horizons
|
||||||
|
|
||||||
for carrier in ["solar", "onwind", "offwind-ac", "offwind-dc"]:
|
for carrier in ["solar", "onwind", "offwind-ac", "offwind-dc"]:
|
||||||
|
extendable_i = (n.generators.carrier == carrier) & n.generators.p_nom_extendable
|
||||||
|
n.generators.loc[extendable_i, "p_nom_min"] = 0
|
||||||
|
|
||||||
existing = n.generators.loc[n.generators.carrier == carrier, "p_nom"]
|
existing = n.generators.loc[n.generators.carrier == carrier, "p_nom"]
|
||||||
ind = list(
|
ind = list(
|
||||||
{i.split(sep=" ")[0] + " " + i.split(sep=" ")[1] for i in existing.index}
|
{i.split(sep=" ")[0] + " " + i.split(sep=" ")[1] for i in existing.index}
|
||||||
@ -180,6 +183,19 @@ def _add_land_use_constraint_m(n, planning_horizons, config):
|
|||||||
sel_p_year
|
sel_p_year
|
||||||
].rename(lambda x: x[:-4] + current_horizon)
|
].rename(lambda x: x[:-4] + current_horizon)
|
||||||
|
|
||||||
|
# check if existing capacities are larger than technical potential
|
||||||
|
existing_large = n.generators[
|
||||||
|
n.generators["p_nom_min"] > n.generators["p_nom_max"]
|
||||||
|
].index
|
||||||
|
if len(existing_large):
|
||||||
|
logger.warning(
|
||||||
|
f"Existing capacities larger than technical potential for {existing_large},\
|
||||||
|
adjust technical potential to existing capacities"
|
||||||
|
)
|
||||||
|
n.generators.loc[existing_large, "p_nom_max"] = n.generators.loc[
|
||||||
|
existing_large, "p_nom_min"
|
||||||
|
]
|
||||||
|
|
||||||
n.generators.p_nom_max.clip(lower=0, inplace=True)
|
n.generators.p_nom_max.clip(lower=0, inplace=True)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user