Skip to content

Commit

Permalink
Merge branch 'main' into create-subregion
Browse files Browse the repository at this point in the history
  • Loading branch information
virio-andreyana authored Jun 24, 2024
2 parents 29a1cbb + 2c33699 commit c1cd2a4
Show file tree
Hide file tree
Showing 22 changed files with 242 additions and 35 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ repos:

# Find common spelling mistakes in comments and docstrings
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
args: ['--ignore-regex="(\b[A-Z]+\b)"', '--ignore-words-list=fom,appartment,bage,ore,setis,tabacco,berfore,fo,FO']
Expand Down Expand Up @@ -72,7 +72,7 @@ repos:

# Format Snakemake rule / workflow files
- repo: https://github.com/snakemake/snakefmt
rev: v0.10.1
rev: v0.10.2
hooks:
- id: snakefmt

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,18 +328,18 @@ The documentation is available here: [documentation](https://pypsa-earth.readthe
</a>
</td>
<td align="center">
<a href="https://github.com/cpschau">
<img src="https://avatars.githubusercontent.com/u/124347782?v=4" width="100;" alt="cpschau"/>
<a href="https://github.com/finozzifa">
<img src="https://avatars.githubusercontent.com/u/167071962?v=4" width="100;" alt="finozzifa"/>
<br />
<sub><b>Cschau</b></sub>
<sub><b>Finozzifa</b></sub>
</a>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/finozzifa">
<img src="https://avatars.githubusercontent.com/u/167071962?v=4" width="100;" alt="finozzifa"/>
<a href="https://github.com/cpschau">
<img src="https://avatars.githubusercontent.com/u/124347782?v=4" width="100;" alt="cpschau"/>
<br />
<sub><b>Finozzifa</b></sub>
<sub><b>Cschau</b></sub>
</a>
</td>
<td align="center">
Expand Down
3 changes: 2 additions & 1 deletion Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ RDIR = run["name"] + "/" if run.get("name") else ""
CDIR = RDIR if not run.get("shared_cutouts") else ""

load_data_paths = get_load_paths_gegis("data", config)

if config["enable"].get("retrieve_cost_data", True):
COSTS = "resources/" + RDIR + "costs.csv"
else:
Expand Down Expand Up @@ -465,7 +466,7 @@ rule build_renewable_profiles:
powerplants="resources/" + RDIR + "powerplants.csv",
regions=lambda w: (
"resources/" + RDIR + "bus_regions/regions_onshore.geojson"
if w.technology in ("onwind", "solar", "hydro")
if w.technology in ("onwind", "solar", "hydro", "csp")
else "resources/" + RDIR + "bus_regions/regions_offshore.geojson"
),
cutout=lambda w: "cutouts/"
Expand Down
32 changes: 30 additions & 2 deletions config.default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ electricity:
custom_powerplants: false # "false" use only powerplantmatching (ppm) data, "merge" combines ppm and custom powerplants, "replace" use only custom powerplants

conventional_carriers: [nuclear, oil, OCGT, CCGT, coal, lignite, geothermal, biomass]
renewable_carriers: [solar, onwind, offwind-ac, offwind-dc, hydro]
renewable_carriers: [solar, csp, onwind, offwind-ac, offwind-dc, hydro]

estimate_renewable_capacities:
stats: "irena" # False, = greenfield expansion, 'irena' uses IRENA stats to add expansion limits
Expand Down Expand Up @@ -324,6 +324,26 @@ renewable:
method: hydro_capacities # 'hydro_capacities' to rescale country hydro production by using hydro_capacities, 'eia' to rescale by eia data, false for no rescaling
year: 2013 # (optional) year of statistics used to rescale the runoff time series. When not provided, the weather year of the snapshots is used
multiplier: 1.1 # multiplier applied after the normalization of the hydro production; default 1.0
csp:
cutout: cutout-2013-era5
resource:
method: csp
installation: SAM_solar_tower
capacity_per_sqkm: 2.392 # From 1.7 to 4.6 addresses issue #361
# Determined by comparing uncorrected area-weighted full-load hours to those
# published in Supplementary Data to
# Pietzcker, Robert Carl, et al. "Using the sun to decarbonize the power
# sector: The economic potential of photovoltaics and concentrating solar
# power." Applied Energy 135 (2014): 704-720.
copernicus:
grid_codes: [20, 30, 40, 60, 90]
distancing_codes: [50]
distance_to_codes: 3000
natura: true
potential: simple # or conservative
clip_p_max_pu: 1.e-2
extendable: true
csp_model: advanced # simple or advanced

# TODO: Needs to be adjusted for Africa.
# Costs Configuration (Do not remove, needed for Sphynx documentation).
Expand Down Expand Up @@ -472,13 +492,21 @@ plotting:
"electricity": "#f9d002"
"lines": "#70af1d"
"transmission lines": "#70af1d"
"AC": "#70af1d"
"AC-AC": "#70af1d"
"AC line": "#70af1d"
"links": "#8a1caf"
"HVDC links": "#8a1caf"
"DC": "#8a1caf"
"DC-DC": "#8a1caf"
"DC link": "#8a1caf"
"load": "#FF0000"
"load": "#ff0000"
"load shedding": "#ff0000"
"battery discharger": slategray
"battery charger": slategray
"h2 fuel cell": '#c251ae'
"h2 electrolysis": '#ff29d9'
"csp": "#fdd404"
nice_names:
OCGT: "Open-Cycle Gas"
CCGT: "Combined-Cycle Gas"
Expand Down
32 changes: 30 additions & 2 deletions config.tutorial.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ electricity:
custom_powerplants: false # "false" use only powerplantmatching (ppm) data, "merge" combines ppm and custom powerplants, "replace" use only custom powerplants

conventional_carriers: [nuclear, oil, OCGT, CCGT, coal, lignite, geothermal, biomass]
renewable_carriers: [solar, onwind, offwind-ac, offwind-dc, hydro]
renewable_carriers: [solar, csp, onwind, offwind-ac, offwind-dc, hydro]

estimate_renewable_capacities:
stats: "irena" # False, = greenfield expansion, 'irena' uses IRENA stats to add expansion limits
Expand Down Expand Up @@ -310,6 +310,26 @@ renewable:
method: hydro_capacities # 'hydro_capacities' to rescale country hydro production by using hydro_capacities, 'eia' to rescale by eia data, false for no rescaling
year: 2013 # (optional) year of statistics used to rescale the runoff time series. When not provided, the cutout weather year is used
multiplier: 1.1 # multiplier applied after the normalization of the hydro production; default 1.0
csp:
cutout: cutout-2013-era5-tutorial
resource:
method: csp
installation: SAM_solar_tower
capacity_per_sqkm: 2.392 # From 1.7 to 4.6 addresses issue #361
# Determined by comparing uncorrected area-weighted full-load hours to those
# published in Supplementary Data to
# Pietzcker, Robert Carl, et al. "Using the sun to decarbonize the power
# sector: The economic potential of photovoltaics and concentrating solar
# power." Applied Energy 135 (2014): 704-720.
copernicus:
grid_codes: [20, 30, 40, 60, 90]
distancing_codes: [50]
distance_to_codes: 3000
natura: true
potential: simple # or conservative
clip_p_max_pu: 1.e-2
extendable: true
csp_model: advanced # simple or advanced

# TODO: Needs to be adjusted for Africa
costs:
Expand Down Expand Up @@ -447,13 +467,21 @@ plotting:
"electricity": "#f9d002"
"lines": "#70af1d"
"transmission lines": "#70af1d"
"AC": "#70af1d"
"AC-AC": "#70af1d"
"AC line": "#70af1d"
"links": "#8a1caf"
"HVDC links": "#8a1caf"
"DC": "#8a1caf"
"DC-DC": "#8a1caf"
"DC link": "#8a1caf"
"load": "#FF0000"
"load": "#ff0000"
"load shedding": "#ff0000"
"battery discharger": slategray
"battery charger": slategray
"h2 fuel cell": '#c251ae'
"h2 electrolysis": '#ff29d9'
"csp": "#fdd404"
nice_names:
OCGT: "Open-Cycle Gas"
CCGT: "Combined-Cycle Gas"
Expand Down
2 changes: 1 addition & 1 deletion configs/bundle_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ databundles:
category: cutouts
destination: "cutouts"
urls:
zenodo: https://sandbox.zenodo.org/record/1239739/files/tutorial_cutouts_KZ.zip?download=1
zenodo: https://sandbox.zenodo.org/records/69756/files/bundle_tutorial_cutouts_KZ.zip?download=1
output: [cutouts/cutout-2013-era5-tutorial.nc]
disable_by_opt:
build_cutout: [all]
Expand Down
9 changes: 9 additions & 0 deletions data/costs.csv
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,12 @@ HVDC submarine,2030,FOM,2,%/year,Hagspiel
HVDC inverter pair,2030,investment,150000,EUR/MW,Hagspiel
HVDC inverter pair,2030,lifetime,40,years,Hagspiel
HVDC inverter pair,2030,FOM,2,%/year,Hagspiel
csp-tower,2030,FOM,1.1,%/year,ATB CSP data (https://atb.nrel.gov/electricity/2021/concentrating_solar_power)
csp-tower,2030,investment,108.37,"EUR/kW_th,dp",ATB CSP data (https://atb.nrel.gov/electricity/2021/concentrating_solar_power) and NREL SAM v2021.12.2 (https://sam.nrel.gov/).
csp-tower,2030,lifetime,30.0,years,ATB CSP data (https://atb.nrel.gov/electricity/2021/concentrating_solar_power)
csp-tower TES,2030,FOM,1.1,%/year,see solar-tower.
csp-tower TES,2030,investment,14.52,EUR/kWh_th,ATB CSP data (https://atb.nrel.gov/electricity/2021/concentrating_solar_power) and NREL SAM v2021.12.2 (https://sam.nrel.gov/).
csp-tower TES,2030,lifetime,30.0,years,see solar-tower.
csp-tower power block,2030,FOM,1.1,%/year,see solar-tower.
csp-tower power block,2030,investment,759.17,EUR/kW_e,ATB CSP data (https://atb.nrel.gov/electricity/2021/concentrating_solar_power) and NREL SAM v2021.12.2 (https://sam.nrel.gov/).
csp-tower power block,2030,lifetime,30.0,years,see solar-tower.
15 changes: 15 additions & 0 deletions doc/configtables/csp.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
,Unit,Values,Description
cutout,--,Should be a file name listed in the configuration ``atlite: cutouts:`` (e.g. 'europe-2013-era5') or reference an existing folder in the directory ``cutouts``. Source module can be ERA5 or SARAH-2.,Specifies the directory where the relevant weather data is stored that is specified at ``atlite/cutouts`` configuration. Both ``sarah`` and ``era5`` work.
resource,,,
-- method,--,Must be 'csp',
-- installation,--,"Should be 'SAM_solar_tower' as defined in `atlite <https://github.com/PyPSA/atlite/tree/master/atlite/resources/cspinstallation>`__",Specifies the csp technology and its characteristic attributes.
capacity_per_sqkm,:math:`MW/km^2`,float,Allowable density of csp tower placement. Value relates to socio-technical acceptable density.
copernicus,,,
-- grid_codes,--,Any subset of the `Copernicus Land Cover code list <https://land.copernicus.eu/pan-european/corine-land-cover/clc2018>`_,Specifies areas based on CLC which generally eligible for csp tower placement.
-- distance,m,"int","(Optional) Distance to reserve as uneligible area around 'distance_grid_codes' for the renewable technology."
-- distance_grid_codes,--,"(Optional with 'distance') Any subset of the `Copernicus Land Cover code list <https://land.copernicus.eu/pan-european/corine-land-cover/clc2018>`_","Specifies from which a distance of 'distance' metres is unavailable as a buffer area."
natura,bool,"{true, false}",Switch to exclude `Natura 2000 <https://en.wikipedia.org/wiki/Natura_2000>`_ natural protection areas. Area is excluded if ``true``.
potential,--,"One of {'simple', 'conservative'}",Method to compute the maximal installable potential for a node; confer :ref:`renewableprofiles`
clip_p_max_pu,p.u.,float,To avoid too small values in the renewables` per-unit availability time series values below this threshold are set to zero.
extendable, bool, "{True, False}", "True: In nodes where there is no csp generation, adds a zero-capacity csp generator so that csp is considered for capacity expansion. It is done in the ``add_electricity`` rule."
csp_model,--, One of {'advanced' or 'simple'}, Specifies the CSP model to be used. The advanced model attach stores and links to the csp buses while the simple has no stores and links.
2 changes: 1 addition & 1 deletion doc/configtables/hydro.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
,Unit,Values,Description
cutout,--,"Must be 'europe-2013-era5'","Specifies the directory where the relevant weather data ist stored."
cutout,--,"Must be 'europe-2013-era5'","Specifies the directory where the relevant weather data is stored."
resource,,,
-- method,,, "Specifies the Atlite method to calculate renewable potential."
-- hydrobasin,,, "Specifies the file location for hydrobasins. They are used to make the runoff calibration, defining a polygon to compute the available water surface using a surface integral."
Expand Down
2 changes: 1 addition & 1 deletion doc/configtables/offwind-ac.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
,Unit,Values,Description
cutout,--,"Should be a file name listed in the configuration ``atlite: cutouts:`` (e.g. 'europe-2013-era5') or reference an existing folder in the directory ``cutouts``. Source module must be ERA5.","Specifies the directory where the relevant weather data ist stored."
cutout,--,"Should be a file name listed in the configuration ``atlite: cutouts:`` (e.g. 'europe-2013-era5') or reference an existing folder in the directory ``cutouts``. Source module must be ERA5.","Specifies the directory where the relevant weather data is stored."
resource,,,
-- method,--,"Must be 'wind'","A superordinate technology type."
-- turbine,--,"One of turbine types included in `atlite <https://github.com/PyPSA/atlite/tree/master/atlite/resources/windturbine>`_","Specifies the turbine type and its characteristic power curve."
Expand Down
2 changes: 1 addition & 1 deletion doc/configtables/offwind-dc.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
,Unit,Values,Description
cutout,--,"Should be a file name listed in the configuration ``atlite: cutouts:`` (e.g. 'europe-2013-era5') or reference an existing folder in the directory ``cutouts``. Source module must be ERA5.","Specifies the directory where the relevant weather data ist stored."
cutout,--,"Should be a file name listed in the configuration ``atlite: cutouts:`` (e.g. 'europe-2013-era5') or reference an existing folder in the directory ``cutouts``. Source module must be ERA5.","Specifies the directory where the relevant weather data is stored."
resource,,,
-- method,--,"Must be 'wind'","A superordinate technology type."
-- turbine,--,"One of turbine types included in `atlite <https://github.com/PyPSA/atlite/tree/master/atlite/resources/windturbine>`__","Specifies the turbine type and its characteristic power curve."
Expand Down
2 changes: 1 addition & 1 deletion doc/configtables/onwind.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
,Unit,Values,Description
cutout,--,"Should be a file name listed in the configuration ``atlite: cutouts:`` (e.g. 'europe-2013-era5') or reference an existing folder in the directory ``cutouts``. Source module must be ERA5.","Specifies the directory where the relevant weather data ist stored."
cutout,--,"Should be a file name listed in the configuration ``atlite: cutouts:`` (e.g. 'europe-2013-era5') or reference an existing folder in the directory ``cutouts``. Source module must be ERA5.","Specifies the directory where the relevant weather data is stored."
resource,,,
-- method,--,"Must be 'wind'","A superordinate technology type."
-- turbine,--,"One of turbine types included in `atlite <https://github.com/PyPSA/atlite/tree/master/atlite/resources/windturbine>`__","Specifies the turbine type and its characteristic power curve."
Expand Down
2 changes: 1 addition & 1 deletion doc/configtables/solar.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
,Unit,Values,Description
cutout,--,Should be a file name listed in the configuration ``atlite: cutouts:`` (e.g. 'europe-2013-era5') or reference an existing folder in the directory ``cutouts``. Source module can be ERA5 or SARAH-2.,Specifies the directory where the relevant weather data ist stored that is specified at ``atlite/cutouts`` configuration. Both ``sarah`` and ``era5`` work.
cutout,--,Should be a file name listed in the configuration ``atlite: cutouts:`` (e.g. 'europe-2013-era5') or reference an existing folder in the directory ``cutouts``. Source module can be ERA5 or SARAH-2.,Specifies the directory where the relevant weather data is stored that is specified at ``atlite/cutouts`` configuration. Both ``sarah`` and ``era5`` work.
resource,,,
-- method,--,Must be 'pv',A superordinate technology type.
-- panel,--,"One of {'Csi', 'CdTe', 'KANENA'} as defined in `atlite <https://github.com/PyPSA/atlite/tree/master/atlite/resources/solarpanel>`__",Specifies the solar panel technology and its characteristic attributes.
Expand Down
15 changes: 14 additions & 1 deletion doc/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ Specifies the minimum voltage magnitude in the base network and the offshore sub
``load_options``
=============================

Specifies the options to estimate future electricity demand (load). Different years might be considered for weather and the socio-economic pathway (GDP and population growth), to enhance modelling capabilities.
Specifies the options to estimate future electricity demand (load). Different years might be considered for weather and the socioeconomic pathway (GDP and population growth), to enhance modelling capabilities.

.. literalinclude:: ../config.default.yaml
:language: yaml
Expand Down Expand Up @@ -402,6 +402,19 @@ Specifies the options to obtain renewable potentials in every cutout. These are
:widths: 25,7,22,30
:file: configtables/hydro.csv

``csp``
---------------

.. literalinclude:: ../config.default.yaml
:language: yaml
:start-at: csp:
:end-at: csp_model:

.. csv-table::
:header-rows: 1
:widths: 25,7,22,30
:file: configtables/csp.csv

.. _costs_cf:

``costs``
Expand Down
14 changes: 14 additions & 0 deletions doc/customization_basic1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,20 @@ Year-related parameters are also being used when specifying `load_options`:
The `weather_year` value corresponds to the weather data which was used to generate the electricity demand profiles for a selected area while `prediction_year` corresponds to the point of a `Shared Socioeconomic Pathways (SSP) <https://en.wikipedia.org/wiki/Shared_Socioeconomic_Pathways>`__ trajectory. PyPSA-Earth uses SSP2-2.6 scenario within the Shared Socioeconomic Pathways framework, which is characterized by medium challenges to mitigation and adaptation efforts resulting in a global warming of approximately 2.6°C by the end of the 21st century.
The available values for `weather_year` and `prediction_year` can be checked by looking into `pypsa-earth/data/ssp2-2.6` folder. Currently, there are pre-calculated demand data for 2011, 2013, 2018 weather years and for 2030, 2040, 2050, and 2100 scenario prediction years.

Use custom demand data
----------------------

It is possible to implement custom demand profiles. It can be done by creating a dedicated custom demand sub-folder in a scenario folder `pypsa-earth/data/ssp2-2.6` and placing there a custom demand file. The name of a custom demand sub-folder should correspond to `weather_year` argument which stands in this case for general identification of a demand input. The name of a demand input file should be a continent name to which belongs a country of initerest. Both csv and nc formats can be used for demand files.

For example, to `pypsa-earth/data/ssp2-2.6/2013_custom/`

.. note::

For example, to provide custom inputs for Nigeria, you can put the time-series into `Africa.csv` file and place the file into `pypsa-earth/data/ssp2-2.6/2013_custom/` folder. To make it fetched, you'll need to specify `weather_year: 2013_custom` under `load_options`.

A format of the custom csv demand file should correspond to the csv files supplied with the model: there are `region_code`, `time`, `region_name` and `Electricity demand` columns, while a semicolon is used as a separator.


Configure `atlite` section
--------------------------

Expand Down
4 changes: 4 additions & 0 deletions doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ E.g. if a new rule becomes available describe how to use it `snakemake -j1 run_t

* Add an option to merge isolated networks into respective backbone networks by countries. `PR #903 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/903>`__

* Add an option to use csv format for custom demand imports. `PR #995 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/995>`__

**Minor Changes and bug-fixing**

* Minor bug-fixing to run the cluster wildcard min `PR #1019 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/1019>`__
Expand All @@ -44,6 +46,8 @@ E.g. if a new rule becomes available describe how to use it `snakemake -j1 run_t

* Resolve pandas deprecation warning. `PR #1023 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/1023>`__

* Create files where the code outputs the value of the objective function. `PR #1033 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/1033>`__

PyPSA-Earth 0.3.0
=================

Expand Down
Loading

0 comments on commit c1cd2a4

Please sign in to comment.