Improve agg_p_nom_minmax file management

This commit is contained in:
Thomas Gilon 2024-04-19 17:41:50 +02:00
parent ed83f1fb4a
commit e90b37e6d7
4 changed files with 37 additions and 38 deletions

View File

@ -760,10 +760,7 @@ solving:
agg_p_nom_limits:
agg_offwind: false
include_existing: false
years:
2030: data/agg_p_nom_minmax.csv
2040: data/agg_p_nom_minmax.csv
2050: data/agg_p_nom_minmax.csv
file: data/agg_p_nom_minmax.csv
constraints:
CCL: false

View File

@ -1,31 +1,32 @@
country,carrier,min,max
DE,onwind,0.1,
DE,offwind-ac,0.1,
DE,offwind-dc,0.1,
DE,solar,0.2,
LU,onwind,,
LU,solar,,
NL,onwind,,
NL,offwind-ac,,
NL,offwind-dc,,
NL,solar,,
GB,onwind,,
GB,offwind-ac,,
GB,offwind-dc,,
GB,solar,,
IE,onwind,,
IE,offwind-ac,,
IE,offwind-dc,,
IE,solar,,
FR,onwind,,
FR,offwind-ac,,
FR,offwind-dc,,
FR,solar,,
DK,onwind,,
DK,offwind-ac,,
DK,offwind-dc,,
DK,solar,,
BE,onwind,,
BE,offwind-ac,,
BE,offwind-dc,,
BE,solar,,
,,2030,2030,2040,2040,2050,2050
country,carrier,min,max,min,max,min,max
DE,onwind,0.1,,0.1,,0.1,
DE,offwind-ac,0.1,,0.1,,0.1,
DE,offwind-dc,0.1,,0.1,,0.1,
DE,solar,0.2,,0.2,,0.2,
LU,onwind,,,,,,
LU,solar,,,,,,
NL,onwind,,,,,,
NL,offwind-ac,,,,,,
NL,offwind-dc,,,,,,
NL,solar,,,,,,
GB,onwind,,,,,,
GB,offwind-ac,,,,,,
GB,offwind-dc,,,,,,
GB,solar,,,,,,
IE,onwind,,,,,,
IE,offwind-ac,,,,,,
IE,offwind-dc,,,,,,
IE,solar,,,,,,
FR,onwind,,,,,,
FR,offwind-ac,,,,,,
FR,offwind-dc,,,,,,
FR,solar,,,,,,
DK,onwind,,,,,,
DK,offwind-ac,,,,,,
DK,offwind-dc,,,,,,
DK,solar,,,,,,
BE,onwind,,,,,,
BE,offwind-ac,,,,,,
BE,offwind-dc,,,,,,
BE,solar,,,,,,
1 country carrier min 2030 max 2030 2040 2040 2050 2050
2 DE country onwind carrier 0.1 min max min max min max
3 DE DE offwind-ac onwind 0.1 0.1 0.1 0.1
4 DE DE offwind-dc offwind-ac 0.1 0.1 0.1 0.1
5 DE DE solar offwind-dc 0.2 0.1 0.1 0.1
6 LU DE onwind solar 0.2 0.2 0.2
7 LU LU solar onwind
8 NL LU onwind solar
9 NL NL offwind-ac onwind
10 NL NL offwind-dc offwind-ac
11 NL NL solar offwind-dc
12 GB NL onwind solar
13 GB GB offwind-ac onwind
14 GB GB offwind-dc offwind-ac
15 GB GB solar offwind-dc
16 IE GB onwind solar
17 IE IE offwind-ac onwind
18 IE IE offwind-dc offwind-ac
19 IE IE solar offwind-dc
20 FR IE onwind solar
21 FR FR offwind-ac onwind
22 FR FR offwind-dc offwind-ac
23 FR FR solar offwind-dc
24 DK FR onwind solar
25 DK DK offwind-ac onwind
26 DK DK offwind-dc offwind-ac
27 DK DK solar offwind-dc
28 BE DK onwind solar
29 BE BE offwind-ac onwind
30 BE BE offwind-dc offwind-ac
31 BE BE solar offwind-dc
32 BE solar

View File

@ -17,7 +17,7 @@ options,,,
agg_p_nom_limits,,,Configure per carrier generator nominal capacity constraints for individual countries if ``'CCL'`` is in ``{opts}`` wildcard.
-- agg_offwind,bool,"{'true','false'}",Aggregate together all the types of offwind when writing the constraint. Default is false.
-- include_existing,bool,"{'true','false'}",Take existing capacities into account when writing the constraint. Default is false.
-- years,-,Dictionary with planning horizons as key and path as value,Reference to ``.csv`` file for each planning horizon. Defaults to ``data/agg_p_nom_minmax.csv``.
-- file,file,path,Reference to ``.csv`` file specifying per carrier generator nominal capacity constraints for individual countries and planning horizons. Defaults to ``data/agg_p_nom_minmax.csv``.
constraints ,,,
-- CCL,bool,"{'true','false'}",Add minimum and maximum levels of generator nominal capacity per carrier for individual countries. These can be specified in the file linked at ``electricity: agg_p_nom_limits`` in the configuration. File defaults to ``data/agg_p_nom_minmax.csv``.
-- EQ,bool/string,"{'false',`n(c| )``; i.e. ``0.5``-``0.7c``}",Require each country or node to on average produce a minimal share of its total consumption itself. Example: ``EQ0.5c`` demands each country to produce on average at least 50% of its consumption; ``EQ0.5`` demands each node to produce on average at least 50% of its consumption.

1 Unit Values Description
17 agg_p_nom_limits Configure per carrier generator nominal capacity constraints for individual countries if ``'CCL'`` is in ``{opts}`` wildcard.
18 -- agg_offwind bool {'true','false'} Aggregate together all the types of offwind when writing the constraint. Default is false.
19 -- include_existing bool {'true','false'} Take existing capacities into account when writing the constraint. Default is false.
20 -- years -- file - file Dictionary with planning horizons as key and path as value path Reference to ``.csv`` file for each planning horizon. Defaults to ``data/agg_p_nom_minmax.csv``. Reference to ``.csv`` file specifying per carrier generator nominal capacity constraints for individual countries and planning horizons. Defaults to ``data/agg_p_nom_minmax.csv``.
21 constraints
22 -- CCL bool {'true','false'} Add minimum and maximum levels of generator nominal capacity per carrier for individual countries. These can be specified in the file linked at ``electricity: agg_p_nom_limits`` in the configuration. File defaults to ``data/agg_p_nom_minmax.csv``.
23 -- EQ bool/string {'false',`n(c| )``; i.e. ``0.5``-``0.7c``} Require each country or node to on average produce a minimal share of its total consumption itself. Example: ``EQ0.5c`` demands each country to produce on average at least 50% of its consumption; ``EQ0.5`` demands each node to produce on average at least 50% of its consumption.

View File

@ -422,8 +422,9 @@ def add_CCL_constraints(n, config):
agg_p_nom_limits: data/agg_p_nom_minmax.csv
"""
agg_p_nom_minmax = pd.read_csv(
config["solving"]["agg_p_nom_limits"]["years"][int(snakemake.wildcards.planning_horizons)], index_col=[0, 1]
)
config["solving"]["agg_p_nom_limits"]["file"],
index_col=[0, 1], header=[0, 1]
)[snakemake.wildcards.planning_horizons]
logger.info("Adding generation capacity constraints per carrier and country")
p_nom = n.model["Generator-p_nom"]