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
108 changes: 65 additions & 43 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,46 +91,68 @@ fuel_mapping:
"fossil gas: unknown": "natural gas"

imputation:
shape_overlap_correction: "split_capacity" # strict or split_capacity
scenario: "near-future" # near-future, far-future, far-off-future
lifetime_years:
# General lifetime assumptions. Adjust as needed!
bioenergy turbine: 25
ccgt: 20
coal turbine: 50
concentrating solar power: 25
high enthalpy geothermal: 30
igcc: 25
low enthalpy geothermal: 30
nuclear reactor: 50
ocgt: 20
offshore: 25
onshore: 25
pumped storage: 80
reciprocating engine: 20
reservoir: 80
rooftop pv: 25
run of river: 80
steam turbine: 30
utility pv: 25
retirement_delay_years:
# Assumed extension past reference year.
# Only applies if a powerplant is still operating past the lifetime_years assumption
bioenergy turbine: 5
ccgt: 5
coal turbine: 5
concentrating solar power: 2
high enthalpy geothermal: 5
igcc: 5
low enthalpy geothermal: 5
nuclear reactor: 5
ocgt: 5
offshore: 2
onshore: 2
pumped storage: 10
reciprocating engine: 5
reservoir: 10
rooftop pv: 5
run of river: 10
steam turbine: 5
utility pv: 2
location:
inner_distance: 100 # matches projected CRS unit.
on_overlap: "split_capacity"
on_forced_class_error: "drop" # either 'drop', 'ignore', or 'raise'
forced_class:
bioenergy turbine: "land"
ccgt: "land"
coal turbine: "land"
concentrating solar power: "land"
high enthalpy geothermal: "land"
igcc: "land"
low enthalpy geothermal: "land"
nuclear reactor: "land"
ocgt: "land"
offshore: "maritime"
onshore: "land"
pumped storage: "land"
reciprocating engine: "land"
reservoir: "land"
run of river: "land"
steam turbine: "land"
utility pv: "land"
time:
scenario: "construction" # Options: historical->construction->pre_construction->announced
lifetime_years:
# General lifetime assumptions. Adjust as needed!
bioenergy turbine: 25
ccgt: 20
coal turbine: 50
concentrating solar power: 25
high enthalpy geothermal: 30
igcc: 25
low enthalpy geothermal: 30
nuclear reactor: 50
ocgt: 20
offshore: 25
onshore: 25
pumped storage: 80
reciprocating engine: 20
reservoir: 80
rooftop pv: 25
run of river: 80
steam turbine: 30
utility pv: 25
retirement_delay_years:
# Assumed extension past reference year.
# Only applies if a powerplant is still operating past the lifetime_years assumption
bioenergy turbine: 5
ccgt: 5
coal turbine: 5
concentrating solar power: 2
high enthalpy geothermal: 5
igcc: 5
low enthalpy geothermal: 5
nuclear reactor: 5
ocgt: 5
offshore: 2
onshore: 2
pumped storage: 10
reciprocating engine: 5
reservoir: 10
rooftop pv: 5
run of river: 10
steam turbine: 5
utility pv: 2
42 changes: 21 additions & 21 deletions pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ python = "3.12.9.*"
pyyaml = "6.0.2.*"
xlrd = "2.0.1.*"
pip = "25.1.1.*"
mypy = "==1.20.0"
mypy = "1.20.1.*"

[feature.powerplants.pypi-dependencies]
gregor = { git = "https://github.com/jnnr/gregor.git", rev = "fix-memory-explosion" }
Expand Down
120 changes: 84 additions & 36 deletions workflow/internal/config.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ $defs:
type: string
minLength: 1

nonzero_number:
positive_number:
type: number
not:
const: 0
exclusiveMinimum: 0

year_map:
type: object
Expand Down Expand Up @@ -246,7 +245,7 @@ properties:
additionalProperties: false
properties:
utility_pv:
$ref: '#/$defs/nonzero_number'
$ref: '#/$defs/positive_number'
required:
- utility_pv
required:
Expand Down Expand Up @@ -353,36 +352,85 @@ properties:
type: object
additionalProperties: false
required:
- shape_overlap_correction
- scenario
- lifetime_years
- retirement_delay_years
- location
- time
properties:
shape_overlap_correction:
title: Shape overlap correction method
description: |
Approach to handling powerplants that land on shape overlaps.
Either 'strict' (raise errors) or 'split_capacity' (divide powerplant capacity equally across overlapping shapes).
type: string
enum:
- strict
- split_capacity
scenario:
title: Scenario
description: >
Determines which 'future' facilities to keep beyond the adjustment year. From less to more:

- historical: only keep existing capacities.
- near-future: keeps the above plus projects in construction (RECOMMENDED).
- far-future: keeps the above plus projects in pre-construction stages (e.g., those processing permits).
- far-off-future: keeps the above plus announced projects that have not reached permitting stages. Highly speculative.
type: string
enum:
- historical
- near-future
- far-future
- far-off-future
lifetime_years:
$ref: '#/$defs/year_map'
retirement_delay_years:
$ref: '#/$defs/year_map'
location:
title: Location imputation
description: Settings in this section affect how the module modifies the location of powerplants.
type: object
additionalProperties: false
required:
- inner_distance
- on_overlap
- on_forced_class_error
properties:
inner_distance:
title: Inner distance
description: |
Distance, in projected CRS units, used when relocating powerplant points into valid placement areas.
Applies both to overlap-split plants and to plants forced into a target shape class.
The point is placed approximately this far inside the selected polygon from the nearest boundary/contact point.
If the available interior segment is shorter, the midpoint of that segment is used.
$ref: '#/$defs/positive_number'
on_overlap:
title: Overlap adjustment method
description: |
Controls how to handle powerplants that overlap on more than one shape.
- "raise" stops the workflow with an error listing the overlapping powerplants.
- "split_capacity" creates smaller duplicate powerplants in each intersecting shape, moved using `inner_distance`.
type: string
enum:
- raise
- split_capacity
on_forced_class_error:
title: Forced shape class adjustment error handling
description: |
Controls how to handle powerplants whose technology is configured for a forced `shape_class`, but no matching shape exists in that plant's country.
- "raise": Stop the workflow with an error listing the failing country/shape_class/technology combinations.
- "ignore": Leave those powerplants unchanged.
- "drop": Remove those powerplants.
type: string
enum:
- raise
- ignore
- drop
forced_class:
title: Forced `shape_class` adjustment.
description: |
Optional. Maps powerplant technologies to a `shape_class`.
Powerplants with a listed technology are moved to the nearest matching shape class within their assigned country.
Allowed values are "land" and "maritime".
type: object
additionalProperties:
type: string
enum:
- land
- maritime
time:
title: Time imputation
description: Settings in this section relate to temporal aspects of powerplants
additionalProperties: false
required:
- scenario
- lifetime_years
- retirement_delay_years
properties:
scenario:
title: Scenario
description: |
Determines which 'future' facilities to keep beyond the adjustment year. In order of lower to higher uncertainty:
- historical: only keep existing capacities.
- construction: keeps the above plus projects already in construction (RECOMMENDED).
- pre_construction: keeps the above plus projects in pre-construction stages (e.g., those processing permits).
- announced: keeps the above plus announced projects that have not reached permitting stages. Highly speculative.
type: string
enum:
- historical
- construction
- pre_construction
- announced
lifetime_years:
$ref: '#/$defs/year_map'
retirement_delay_years:
$ref: '#/$defs/year_map'
2 changes: 2 additions & 0 deletions workflow/internal/settings.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Module settings that users cannot modify.
crs:
geographic: "EPSG:4326"
resources:
automatic:
# Links for automatically downloaded files
Expand Down
1 change: 1 addition & 0 deletions workflow/report/impute_location.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Powerplant relocation based on the imputation->location configuration.
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
Histogram of evolving {{ snakemake.wildcards.category }} capacity in each country in {{ snakemake.wildcards.shapes }}.
Determined by:

* Imputed lifetimes and retirement delay.
* Imputed powerplant exclusions and inclusions.
1 change: 0 additions & 1 deletion workflow/report/prepare_shapes.rst

This file was deleted.

6 changes: 4 additions & 2 deletions workflow/rules/_utils.smk
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ IMPUTED_CAT_WITHOUT_ADJUSTMENT = {"large_solar"}

def additional_config_validation():
"""Ensures technology mapping and lifetime-related names match."""
lifetime_set = set(config["imputation"]["lifetime_years"].keys())
mismatch = lifetime_set ^ set(config["imputation"]["retirement_delay_years"])
lifetime_set = set(config["imputation"]["time"]["lifetime_years"].keys())
mismatch = lifetime_set ^ set(
config["imputation"]["time"]["retirement_delay_years"]
)
if mismatch:
raise ValueError(
f"Technologies in lifetimes and retirement delays mismatch: {mismatch}."
Expand Down
Loading
Loading