Skip to content

Commit 25c83bf

Browse files
authored
Merge pull request pik-piam#100 from beijingzyl/fix-subsidy-module
With fixes instead of PR#98
2 parents 7963c0d + a13435a commit 25c83bf

21 files changed

+321
-2106
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2727
- Global Energy Monitor data integration
2828
- Technology configuration system
2929
- Network plotting with customizable styles
30+
- Policies (subsidies) and differentiated fuel costs
3031

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

6869
## Version History Notes
6970

70-
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.
71+
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.
7172

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

docs/configuration.md

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
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.
44

5-
## Table of Contents
5+
## Table of Contents
66

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

4646
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`
4747

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

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

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

9898
```yaml
99-
scenario:
99+
scenario:
100100
co2_pathway: ["exp175default"]
101101
topology: "current+FCG"
102102
planning_horizons: [year_list]
@@ -112,7 +112,7 @@ scenario:
112112
Emission reduction pathways. `scenario.co2_pathway` entries must be defined here.
113113

114114
```yaml
115-
co2_scenarios:
115+
co2_scenarios:
116116
exp175default: # pathway name
117117
control: "reduction"
118118
pathway:
@@ -205,10 +205,10 @@ Configuration for weather data processing:
205205

206206
## Renewable Energy Technologies Atlite
207207

208-
### Wind
208+
### Wind
209209
```yaml
210210
renewable:
211-
onwind | offwind:
211+
onwind | offwind:
212212
cutout: cutout-name
213213
resource:
214214
method: wind
@@ -350,7 +350,7 @@ Controls nuclear capacity expansion:
350350
- **`base_year`**: Reference year for capacity calculations (should be ≤ first planning year)
351351
- **`base_capacity`**: (Optional) Base year total capacity in MW. If not set, auto-detected from base_year network
352352

353-
## Sector and component Switches
353+
## Sector and component Switches
354354

355355
```yaml
356356
heat_coupling: false
@@ -542,18 +542,33 @@ nodes:
542542
- **`splits`**: Custom groupings of admin level 2 regions within provinces
543543

544544
## Fuel Subsidies
545-
546-
```yaml
547-
subsidies:
548-
enabled: false
549-
gas:
550-
Guangdong: -10
551-
Jiangsu: -10
552-
Zhejiang: -10
553-
Beijing: -11
554-
Tianjin: -11
555-
Shanghai: -11
556-
```
545+
Fuel subsidies can be speficied for all years or per year
546+
547+
=== "All years"
548+
```yaml
549+
subsidies:
550+
enabled: false
551+
gas:
552+
Guangdong: -10
553+
Jiangsu: -10
554+
Zhejiang: -10
555+
Beijing: -11
556+
Tianjin: -11
557+
Shanghai: -11
558+
```
559+
=== "Year by year"
560+
```yaml
561+
subsidies:
562+
enabled: false
563+
gas:
564+
2020:
565+
Guangdong: -10
566+
Jiangsu: -10
567+
Zhejiang: -10
568+
Beijing: -11
569+
Tianjin: -11
570+
Shanghai: -11
571+
```
557572

558573
Provincial fuel subsidies configuration:
559574
- **`enabled`**: Enable/disable fuel subsidy system
@@ -708,7 +723,7 @@ hydro:
708723
## Fossil Fuel Ramping Constraints
709724

710725
Operational ramping constraints for fossil fuel power plants:
711-
726+
712727
```yaml
713728
fossil_ramps:
714729
tech:
@@ -760,4 +775,3 @@ Also tech costs are now in Euro2015 from DK EA
760775
- **`pv_utility_fraction`**: Fraction of solar PV that is utility-scale (100%)
761776

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

examples/historical.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# A Configuration to reproduce historical mix for 2020 and 2025
2+
# run with `snakemake --configfile=examples/historical.yml`
3+
4+
run:
5+
name: "reproduce_historical_load"
6+
foresight: "overnight"
7+
8+
scenario:
9+
co2_pathway: ["exp175default"] # co2_scenarios that will be used
10+
topology: "current+FCG" # "current" or "FCG" or "current+FCG" or "current+Neighbor"
11+
planning_horizons:
12+
- 2020
13+
- 2025
14+
15+
subsidies:
16+
enabled: True # Set to false to disable fuel subsidies
17+
# Year-dependent format: subsidies.fuel_type -> year -> province -> value (EUR/MWh)
18+
# Only negative values allowed (subsidies reduce marginal cost)
19+
# Gas favoured over coal in urban areas due to PM2.5 concerns
20+
gas:
21+
2020:
22+
Guangdong: -10.16
23+
Jiangsu: -10.16
24+
Zhejiang: -10.15
25+
Beijing: -12.5
26+
Tianjin: -12.5
27+
Shanghai: -12.5
28+
Xinjiang: -10
29+
# location dependent fuel prices (cheaper in Shaanxi and Inner Mongolia for example)
30+
coal:
31+
2020:
32+
Xinjiang: -4
33+
InnerMongolia: -4.5
34+
Hebei: -4

workflow/Snakefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ include: "rules/postprocess.smk"
5555
include: "rules/fetch_data.smk"
5656
include: "rules/visualize_inputs.smk"
5757

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

6162
if config["run"].get("is_test", False):
6263
localrules: build_population, dag, fetch_region_shapes
@@ -191,12 +192,12 @@ if not config["run"].get("is_test", False):
191192
rule calculate_gebco_slope:
192193
"""
193194
Calculate slope from GEBCO altimetry/bathymetry data.
194-
195+
195196
Process:
196197
1. Reproject to Mollweide (ESRI:54009) - equal-area projection for accurate slope
197198
2. Calculate slope in percent using gdaldem
198199
3. Reproject back to EPSG:4326 for compatibility with atlite
199-
200+
200201
Output CRS: EPSG:4326 (WGS84 Geographic)
201202
Output format: NetCDF4 with DEFLATE compression
202203
"""
@@ -208,7 +209,7 @@ if not config["run"].get("is_test", False):
208209
"logs/gebco_slope_calculation.log"
209210
script:
210211
"scripts/calculate_gebco_slope.py"
211-
212+
212213

213214
rule build_availability_matrix:
214215
params:

workflow/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
"""Track version"""
2+
13
# pypsa-China PIK editions
24
__version__ = "1.3.2"

workflow/envs/environment.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ dependencies:
1313
- pypsa=0.35.1
1414
- atlite>=0.4.0
1515
- dask
16+
- coincbc
1617
- snakemake-storage-plugin-http
1718
# - pyasyncore
1819
# - pyasynchat

0 commit comments

Comments
 (0)