generalize conventional attr handling through config
This commit is contained in:
parent
8349e85252
commit
9d997fbd79
@ -217,7 +217,8 @@ rule add_electricity:
|
||||
load='resources/load.csv',
|
||||
nuts3_shapes='resources/nuts3_shapes.geojson',
|
||||
**{f"profile_{tech}": f"resources/profile_{tech}.nc"
|
||||
for tech in config['renewable']}
|
||||
for tech in config['renewable']},
|
||||
**{"conventional_{carrier}_{attrs}": fn for carrier in config.get('conventional', {None: {}}).values() for fn in carrier.values() if str(fn).startswith("data/")},
|
||||
output: "networks/elec.nc"
|
||||
log: "logs/add_electricity.log"
|
||||
benchmark: "benchmarks/add_electricity"
|
||||
|
@ -187,7 +187,7 @@ renewable:
|
||||
|
||||
conventional:
|
||||
nuclear:
|
||||
energy_availability_factors: "data/nuclear-eafs.csv" # float of file name
|
||||
p_max_pu: "data/nuclear_p_max_pu.csv" # float of file name
|
||||
|
||||
lines:
|
||||
types:
|
||||
|
@ -171,7 +171,7 @@ Define and specify the ``atlite.Cutout`` used for calculating renewable potentia
|
||||
.. literalinclude:: ../config.default.yaml
|
||||
:language: yaml
|
||||
:start-at: hydro:
|
||||
:end-before: lines:
|
||||
:end-before: conventional:
|
||||
|
||||
.. csv-table::
|
||||
:header-rows: 1
|
||||
@ -180,6 +180,17 @@ Define and specify the ``atlite.Cutout`` used for calculating renewable potentia
|
||||
|
||||
.. _lines_cf:
|
||||
|
||||
``conventional``
|
||||
=============
|
||||
|
||||
Define additional generator attribute for conventional carrier types. If a scalar value is given it is applied to all generators. However if a string starting with "data/" is given, the value is interpreted as a path to a csv file with country specific values. Then, the values are read in and applied to all generators of the given carrier in the given country. Note that the value(s) overwrite the existing values in the corresponding section of the ``generators`` dataframe.
|
||||
|
||||
.. literalinclude:: ../config.default.yaml
|
||||
:language: yaml
|
||||
:start-at: conventional:
|
||||
:end-before: lines:
|
||||
|
||||
|
||||
``lines``
|
||||
=============
|
||||
|
||||
|
@ -53,11 +53,11 @@ Upcoming Release
|
||||
|
||||
* Add function to add global constraint on use of gas in :mod:`prepare_network`. This can be activated by including the keyword ``CH4L`` in the ``{opts}`` wildcard which enforces the limit set in ``electricity: gaslimit:`` given in MWh thermal. Alternatively, it is possible to append a number in the `{opts}` wildcard, e.g. `CH4L200` which limits the gas use to 200 TWh thermal.
|
||||
|
||||
* Add configuration option to implement Energy Availability Factors (EAFs) for conventional generation technologies.
|
||||
|
||||
* A new section ``conventional`` was added to the config file. This section contains configurations for conventional carriers.
|
||||
|
||||
* Implement country-specific EAFs for nuclear power plants based on IAEA 2018-2020 reported country averages. These are specified ``data/nuclear_eafs.csv`` and translate to static ``p_max_pu`` values.
|
||||
* Add configuration option to implement arbitrary generator attributes for conventional generation technologies.
|
||||
|
||||
* Implement country-specific Energy Availability Factors (EAFs) for nuclear power plants based on IAEA 2018-2020 reported country averages. These are specified ``data/nuclear_p_max_pu.csv`` and translate to static ``p_max_pu`` values.
|
||||
|
||||
* The powerplants that have been shut down before 2021 are filtered out.
|
||||
|
||||
|
@ -331,17 +331,20 @@ def attach_conventional_generators(n, costs, ppl, conventional_carriers, extenda
|
||||
|
||||
# Generators with technology affected
|
||||
idx = n.generators.query("carrier == @carrier").index
|
||||
factors = conventional_config[carrier].get("energy_availability_factors")
|
||||
|
||||
if isinstance(factors, float):
|
||||
# Single value affecting all generators of technology k indiscriminantely of country
|
||||
n.generators.loc[idx, "p_max_pu"] = factors
|
||||
elif isinstance(factors, str):
|
||||
factors = pd.read_csv(factors, index_col=0)['factor']
|
||||
# Values affecting generators of technology k country-specific
|
||||
# First map generator buses to countries; then map countries to p_max_pu
|
||||
bus_factors = n.buses.country.map(factors)
|
||||
n.generators.p_max_pu.update(n.generators.loc[idx].bus.map(bus_factors).dropna())
|
||||
for key in list(set(conventional_carriers[carrier]) & set(n.generators)):
|
||||
|
||||
values = conventional_config[carrier][key]
|
||||
|
||||
if isinstance(values, str) and str(values).startswith("data/"):
|
||||
# Values affecting generators of technology k country-specific
|
||||
# First map generator buses to countries; then map countries to p_max_pu
|
||||
values = pd.read_csv(values, index_col=0).iloc[:, 0]
|
||||
bus_values = n.buses.country.map(values)
|
||||
n.generators[key].update(n.generators.loc[idx].bus.map(bus_values).dropna())
|
||||
else:
|
||||
# Single value affecting all generators of technology k indiscriminantely of country
|
||||
n.generators.loc[idx, key] = values
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user