Hydro Capacity Trajectories
See Generic Capacity Trajectories for the general trajectories.csv
schema and how the constraints derived from it are applied and configured. This page covers the
hydro-specific application that currently populates trajectories.csv.
Building the Trajectories (Hydro Application)
Script: scripts/pypsa-at/build_capacity_trajectories.py
Rule: build_capacity_trajectories (rules/pypsa-at/build.smk)
Output: resources/trajectories.csv
For the current hydro use case, the script:
- Reads PEMMDB
MarketNodeInfosheets from everyPEMMDB_<country>_Hydro_Inflows_<year>.xlsxfile in the Open-TYNDP "Hydro Inflows" folder (extract_hydro_capacities_tyndp). Each sheet reports installed capacity (MW) and energy volume (GWh) for run-of-river, reservoir, and both open- and closed-loop pumped-storage (PS) technologies, per TYNDP node and year. - Maps TYNDP node codes to PyPSA-AT country codes via
TYNDP_TO_PYPSA_LOCATION(mods/constants.py), and the PEMMDB technology labels to(carrier, variable, sense)tuples viaHYDRO_CARRIER_MAPPING— also inmods/constants.py. Both mappings are applied generically through the reusable helper_map_index, which expands a single index level into one or more new levels based on the mapping's (possibly tuple-valued) targets. - Drops rows whose mapping resolves to
None(e.g."... - GWh"energy volumes, which are informational only and are not turned into capacity constraints). - Fills in any planning horizon or region missing from the raw PEMMDB data with
value = 0(add_missing_years,add_missing_regions), so that every configured planning horizon and every modelled country has a defined (possibly zero) row for the constraint step to consume.
Hydro Technology Mapping
HYDRO_CARRIER_MAPPING = {
"Run of River - MW": ("ror", "Generator-p_nom", "max"),
"Pondage - MW": ("ror", "Generator-p_nom", "max"),
"Pondage - GWh": ("ror", None, None),
"Reservoir - MW": ("hydro discharger", "Link-p_nom", "max"),
"Reservoir - GWh": ("hydro store", "Store-e_nom", "max"),
"PS Open (turbine) - MW": ("PHS discharger", "Link-p_nom", "max"),
"PS Open (pump) - MW": ("PHS charger", "Link-p_nom", "max"),
"PS Open - GWh": ("PHS store", "Store-e_nom", "max"),
"PS Closed (turbine) - MW": ("PHS discharger", "Link-p_nom", "max"),
"PS Closed (pump) - MW": ("PHS charger", "Link-p_nom", "max"),
"PS Closed - GWh": ("PHS store", "Store-e_nom", "max"),
}
This mapping is the only hydro-specific artifact in the whole feature — everything downstream of it (constraint construction, region aggregation, brownfield deduction) is carrier-agnostic.