diff --git a/Snakefile b/Snakefile index 3ca43fd4..4a756959 100644 --- a/Snakefile +++ b/Snakefile @@ -33,7 +33,9 @@ if config['enable']['prepare_links_p_nom']: script: 'scripts/prepare_links_p_nom.py' rule build_powerplants: - input: base_network="networks/base.nc" + input: + base_network="networks/base.nc", + custom_powerplants="data/custom_powerplants.csv" output: "resources/powerplants.csv" threads: 1 resources: mem=500 diff --git a/data/custom_powerplants.csv b/data/custom_powerplants.csv new file mode 100644 index 00000000..91fc5eec --- /dev/null +++ b/data/custom_powerplants.csv @@ -0,0 +1 @@ +id,Name,Fueltype,Technology,Set,Country,Capacity,Efficiency,Duration,Volume_Mm3,DamHeight_m,YearCommissioned,Retrofit,lat,lon,projectID \ No newline at end of file diff --git a/doc/configtables/electricity.csv b/doc/configtables/electricity.csv index 68b57b92..5274d347 100644 --- a/doc/configtables/electricity.csv +++ b/doc/configtables/electricity.csv @@ -9,4 +9,6 @@ extendable_carriers,,, max_hours,,, -- battery,h,float,"Maximum state of charge capacity of the battery in terms of hours at full output capacity ``p_nom``. Cf. `PyPSA documentation `_." -- H2,h,float,"Maximum state of charge capacity of the hydrogen storage in terms of hours at full output capacity ``p_nom``. Cf. `PyPSA documentation `_." +powerplants_filter,--,"use `pandas.query `_ strings here, e.g. Country not in ['Germany']","Filter query for the default powerplant database." +custom_powerplants,--,"use `pandas.query `_ strings here, e.g. Country in ['Germany']","Filter query for the custom powerplant database." conventional_carriers,--,"Any subset of {nuclear, oil, OCGT, CCGT, coal, lignite, geothermal, biomass}","List of conventional power plants to include in the model from ``resources/powerplants.csv``." diff --git a/scripts/build_powerplants.py b/scripts/build_powerplants.py index 4f29b35f..6735e7fc 100644 --- a/scripts/build_powerplants.py +++ b/scripts/build_powerplants.py @@ -1,6 +1,6 @@ # coding: utf-8 """ -Retrieves conventional powerplant capacities and locations from `powerplantmatching `_, assigns these to buses and creates a ``.csv`` file. +Retrieves conventional powerplant capacities and locations from `powerplantmatching `_, assigns these to buses and creates a ``.csv`` file. It is possible to amend the powerplant database with custom entries provided in ``data/custom_powerplants.csv``. Relevant Settings ----------------- @@ -13,12 +13,13 @@ Relevant Settings .. seealso:: Documentation of the configuration file ``config.yaml`` at - :ref:`toplevel_cf` + :ref:`electricity` Inputs ------ - ``networks/base.nc``: confer :ref:`base`. +- ``data/custom_powerplants.csv``: custom powerplants in the same format as `powerplantmatching `_ provides Outputs ------- @@ -33,6 +34,37 @@ Outputs Description ----------- +The configuration options ``electricity: powerplants_filter`` and ``electricity: custom_powerplants`` can be used to control whether data should be retrieved from the original powerplants database or from custom amendmends. These specify `pandas.query `_ commands. + +1. Adding all powerplants from custom: + + .. code:: yaml + + powerplants_filter: false + custom_powerplants: true + +2. Replacing powerplants in e.g. Germany by custom data: + + .. code:: yaml + + powerplants_filter: Country not in ['Germany'] + custom_powerplants: true + + or + + .. code:: yaml + + powerplants_filter: Country not in ['Germany'] + custom_powerplants: Country in ['Germany'] + + +3. Adding additional built year constraints: + + .. code:: yaml + + powerplants_filter: Country not in ['Germany'] and YearCommissioned <= 2015 + custom_powerplants: YearCommissioned <= 2015 + """ import logging