Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Global Energy Monitor data integration
- Technology configuration system
- Network plotting with customizable styles
- Policies (subsidies) and differentiated fuel costs

### Changed
- Improved documentation structure with tutorials and reference guides
Expand Down Expand Up @@ -67,7 +68,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Version History Notes

PyPSA-China (PIK) is adapted from the Zhou et al. version, which was originally developed by Hailiang Liu et al. This changelog tracks changes from version 1.0.0 onwards in the PIK implementation.
PyPSA-China (PIK) is based on the paper by Zhou et al, which extends a version original developed by Hailiang Liu et al. This changelog tracks changes from version 1.0.0 onwards in the PIK implementation.

For detailed information about specific changes, see the [commit history](https://github.com/pik-piam/PyPSA-China-PIK/commits/main) on GitHub.

Expand Down
58 changes: 36 additions & 22 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This is documentation for the PyPSA-China configuration (`config/default_config.yaml` & `config/technology_config.yaml`). The configuration file controls various aspects of the PyPSA-China energy system modeling workflow.

## Table of Contents
## Table of Contents

- [Run Configuration](#run-configuration)
- [File Paths](#file-paths)
Expand Down Expand Up @@ -45,7 +45,7 @@ This is documentation for the PyPSA-China configuration (`config/default_config.

2. **Customization**: Do not edit `default_config.yaml`. Overwrite the variables you need in `my_config.yaml`. See [running section](../running). Then run `snakemake --configfile config/my_config.yaml`

3. **Technology Configuration**: Additional technology parameters are defined in separate files in `config/technology_config.yaml`
3. **Technology Configuration**: Additional technology parameters are defined in separate files in `config/technology_config.yaml`

4. **Solver Selection**: Remember to select a solver that is installed.

Expand All @@ -69,7 +69,7 @@ foresight: "overnight"
paths:
results_dir: "results/"
costs_dir: "resources/data/costs/default"
yearly_regional_load:
yearly_regional_load:
ac: "resources/data/load/Provincial_Load_2020_2060_MWh.csv"
ac_to_mwh: 1
```
Expand All @@ -96,7 +96,7 @@ Paths to named transmission line topology files for different scenarios. Predefi
A scenario is a set of time horizons with a carbon reduction pathway. The variations become snakemake wildcards.

```yaml
scenario:
scenario:
co2_pathway: ["exp175default"]
topology: "current+FCG"
planning_horizons: [year_list]
Expand All @@ -112,7 +112,7 @@ scenario:
Emission reduction pathways. `scenario.co2_pathway` entries must be defined here.

```yaml
co2_scenarios:
co2_scenarios:
exp175default: # pathway name
control: "reduction"
pathway:
Expand Down Expand Up @@ -205,10 +205,10 @@ Configuration for weather data processing:

## Renewable Energy Technologies Atlite

### Wind
### Wind
```yaml
renewable:
onwind | offwind:
onwind | offwind:
cutout: cutout-name
resource:
method: wind
Expand Down Expand Up @@ -350,7 +350,7 @@ Controls nuclear capacity expansion:
- **`base_year`**: Reference year for capacity calculations (should be ≤ first planning year)
- **`base_capacity`**: (Optional) Base year total capacity in MW. If not set, auto-detected from base_year network

## Sector and component Switches
## Sector and component Switches

```yaml
heat_coupling: false
Expand Down Expand Up @@ -542,18 +542,33 @@ nodes:
- **`splits`**: Custom groupings of admin level 2 regions within provinces

## Fuel Subsidies

```yaml
subsidies:
enabled: false
gas:
Guangdong: -10
Jiangsu: -10
Zhejiang: -10
Beijing: -11
Tianjin: -11
Shanghai: -11
```
Fuel subsidies can be speficied for all years or per year

=== "All years"
```yaml
subsidies:
enabled: false
gas:
Guangdong: -10
Jiangsu: -10
Zhejiang: -10
Beijing: -11
Tianjin: -11
Shanghai: -11
```
=== "Year by year"
```yaml
subsidies:
enabled: false
gas:
2020:
Guangdong: -10
Jiangsu: -10
Zhejiang: -10
Beijing: -11
Tianjin: -11
Shanghai: -11
```

Provincial fuel subsidies configuration:
- **`enabled`**: Enable/disable fuel subsidy system
Expand Down Expand Up @@ -708,7 +723,7 @@ hydro:
## Fossil Fuel Ramping Constraints

Operational ramping constraints for fossil fuel power plants:

```yaml
fossil_ramps:
tech:
Expand Down Expand Up @@ -760,4 +775,3 @@ Also tech costs are now in Euro2015 from DK EA
- **`pv_utility_fraction`**: Fraction of solar PV that is utility-scale (100%)

This parameter distinguishes between utility-scale and residential/distributed solar installations, affecting cost assumptions and grid integration characteristics.

34 changes: 34 additions & 0 deletions examples/historical.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# A Configuration to reproduce historical mix for 2020 and 2025
# run with `snakemake --configfile=examples/historical.yml`

run:
name: "reproduce_historical_load"
foresight: "overnight"

scenario:
co2_pathway: ["exp175default"] # co2_scenarios that will be used
topology: "current+FCG" # "current" or "FCG" or "current+FCG" or "current+Neighbor"
planning_horizons:
- 2020
- 2025

subsidies:
enabled: True # Set to false to disable fuel subsidies
# Year-dependent format: subsidies.fuel_type -> year -> province -> value (EUR/MWh)
# Only negative values allowed (subsidies reduce marginal cost)
# Gas favoured over coal in urban areas due to PM2.5 concerns
gas:
2020:
Guangdong: -10.16
Jiangsu: -10.16
Zhejiang: -10.15
Beijing: -12.5
Tianjin: -12.5
Shanghai: -12.5
Xinjiang: -10
# location dependent fuel prices (cheaper in Shaanxi and Inner Mongolia for example)
coal:
2020:
Xinjiang: -4
InnerMongolia: -4.5
Hebei: -4
11 changes: 6 additions & 5 deletions workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ include: "rules/postprocess.smk"
include: "rules/fetch_data.smk"
include: "rules/visualize_inputs.smk"

# Mark calculate_gebco_slope as local rule (always runs locally, not on Slurm)
localrules: calculate_gebco_slope
# Mark calculate_gebco_slope as local rule only when the rule is defined
if not config["run"].get("is_test", False):
localrules: calculate_gebco_slope

if config["run"].get("is_test", False):
localrules: build_population, dag, fetch_region_shapes
Expand Down Expand Up @@ -191,12 +192,12 @@ if not config["run"].get("is_test", False):
rule calculate_gebco_slope:
"""
Calculate slope from GEBCO altimetry/bathymetry data.

Process:
1. Reproject to Mollweide (ESRI:54009) - equal-area projection for accurate slope
2. Calculate slope in percent using gdaldem
3. Reproject back to EPSG:4326 for compatibility with atlite

Output CRS: EPSG:4326 (WGS84 Geographic)
Output format: NetCDF4 with DEFLATE compression
"""
Expand All @@ -208,7 +209,7 @@ if not config["run"].get("is_test", False):
"logs/gebco_slope_calculation.log"
script:
"scripts/calculate_gebco_slope.py"


rule build_availability_matrix:
params:
Expand Down
2 changes: 2 additions & 0 deletions workflow/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
"""Track version"""

# pypsa-China PIK editions
__version__ = "1.3.2"
1 change: 1 addition & 0 deletions workflow/envs/environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies:
- pypsa=0.35.1
- atlite>=0.4.0
- dask
- coincbc
- snakemake-storage-plugin-http
# - pyasyncore
# - pyasynchat
Expand Down
Loading
Loading