Skip to content
Open
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
20 changes: 0 additions & 20 deletions config/config.default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -535,26 +535,6 @@ load:
gdp: 0.6
population: 0.4

# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration/#pypsa_eur_cf
pypsa_eur:
Bus:
- AC
Link:
- DC
Generator:
- onwind
- "offwind-ac"
- "offwind-dc"
- "offwind-float"
- "solar-hsat"
- solar
- ror
- nuclear
StorageUnit:
- PHS
- hydro
Store: []

# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration/#energy_cf
energy:
energy_totals_year: 2023
Expand Down
88 changes: 4 additions & 84 deletions config/schema.default.json
Original file line number Diff line number Diff line change
Expand Up @@ -2419,7 +2419,7 @@
"type": "array"
},
"conventional_carriers": {
"description": "List of conventional power plants to include in the model from `resources/powerplants.csv`. If an included carrier is also listed in `extendable_carriers`, the capacity is taken as a lower bound.",
"description": "List of conventional power plants to include in the model from `resources/powerplants.csv`. If an included carrier is also listed in `extendable_carriers`, the capacity is taken as a lower bound. Sector-coupled models ignore OCGT, CCGT, oil, coal, lignite, biomass and waste here, because they add these technologies as links with fuel and emission tracking.",
"items": {
"type": "string"
},
Expand Down Expand Up @@ -2585,7 +2585,7 @@
"type": "number"
},
"conventional_carriers": {
"description": "List of conventional power plants to include in the sectoral network.",
"description": "Fuels for which buses are added to the sector-coupled network with myopic or perfect foresight, so that existing power plants can connect to them. Does not select which existing power plants are added.",
"items": {
"type": "string"
},
Expand Down Expand Up @@ -3698,46 +3698,6 @@
}
}
},
"PypsaEurConfig": {
"description": "Configuration for `pypsa_eur` settings.",
"properties": {
"Bus": {
"description": "Bus carriers to keep from PyPSA-Eur.",
"items": {
"type": "string"
},
"type": "array"
},
"Link": {
"description": "Link carriers to keep from PyPSA-Eur.",
"items": {
"type": "string"
},
"type": "array"
},
"Generator": {
"description": "Generator carriers to keep from PyPSA-Eur.",
"items": {
"type": "string"
},
"type": "array"
},
"StorageUnit": {
"description": "StorageUnit carriers to keep from PyPSA-Eur.",
"items": {
"type": "string"
},
"type": "array"
},
"Store": {
"description": "Store carriers to keep from PyPSA-Eur.",
"items": {
"type": "string"
},
"type": "array"
}
}
},
"RemoteConfig": {
"description": "Configuration for top level `remote` settings.",
"properties": {
Expand Down Expand Up @@ -10431,7 +10391,7 @@
"type": "array"
},
"conventional_carriers": {
"description": "List of conventional power plants to include in the model from `resources/powerplants.csv`. If an included carrier is also listed in `extendable_carriers`, the capacity is taken as a lower bound.",
"description": "List of conventional power plants to include in the model from `resources/powerplants.csv`. If an included carrier is also listed in `extendable_carriers`, the capacity is taken as a lower bound. Sector-coupled models ignore OCGT, CCGT, oil, coal, lignite, biomass and waste here, because they add these technologies as links with fuel and emission tracking.",
"items": {
"type": "string"
},
Expand Down Expand Up @@ -12182,46 +12142,6 @@
}
}
},
"pypsa_eur": {
"description": "Configuration for `pypsa_eur` settings.",
"properties": {
"Bus": {
"description": "Bus carriers to keep from PyPSA-Eur.",
"items": {
"type": "string"
},
"type": "array"
},
"Link": {
"description": "Link carriers to keep from PyPSA-Eur.",
"items": {
"type": "string"
},
"type": "array"
},
"Generator": {
"description": "Generator carriers to keep from PyPSA-Eur.",
"items": {
"type": "string"
},
"type": "array"
},
"StorageUnit": {
"description": "StorageUnit carriers to keep from PyPSA-Eur.",
"items": {
"type": "string"
},
"type": "array"
},
"Store": {
"description": "Store carriers to keep from PyPSA-Eur.",
"items": {
"type": "string"
},
"type": "array"
}
}
},
"energy": {
"description": "Configuration for `energy` settings.",
"properties": {
Expand Down Expand Up @@ -12376,7 +12296,7 @@
"type": "number"
},
"conventional_carriers": {
"description": "List of conventional power plants to include in the sectoral network.",
"description": "Fuels for which buses are added to the sector-coupled network with myopic or perfect foresight, so that existing power plants can connect to them. Does not select which existing power plants are added.",
"items": {
"type": "string"
},
Expand Down
17 changes: 0 additions & 17 deletions doc/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -459,23 +459,6 @@ Configuration for `load` settings.
```


## `pypsa_eur` {#pypsa_eur_cf}

Only used for sector-coupling studies.

Carriers of the electricity-only network that are kept per component type when
the sector-coupling components are added. Components with other carriers, for
example conventional generators, are removed and re-added in their
sector-coupled form.

{{ schema_table("pypsa_eur") }}

**YAML Syntax**

```yaml
{{ yaml_section("pypsa_eur") }}
```

## `energy` {#energy_cf}

Only used for sector-coupling studies.
Expand Down
2 changes: 2 additions & 0 deletions doc/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<!-- Upcoming Release -->
<!-- ================= -->

* **Breaking:** Removed the `pypsa_eur` configuration section. Sector-coupled models no longer add and later remove electricity components: power plants whose fuels the sector model tracks (OCGT, CCGT, oil, coal, lignite, biomass, waste) and hydrogen storage are skipped, all others are kept (e.g. nuclear, and now also geothermal). To drop a technology, remove it from `electricity: conventional_carriers` or `electricity: renewable_carriers` instead ([#2370](https://github.com/PyPSA/pypsa-eur/pull/2370)).

* Fix: `lines: types` must now define a line type for the 380 kV level; the config validation fails early with a clear message instead of the workflow failing later ([#2166](https://github.com/PyPSA/pypsa-eur/issues/2166)).

* Feature: New switches `industry: solid_biomass_for_industry_cc`, `industry: gas_for_industry_cc` and `industry: process_emissions_cc` to disable the carbon capture options for solid biomass for industry, gas for industry and industrial process emissions. All default to `true`, which matches the previous behaviour ([#2357](https://github.com/PyPSA/pypsa-eur/pull/2357)).
Expand Down
1 change: 0 additions & 1 deletion rules/compose.smk
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ rule compose_network:
clustering=config_provider("clustering"),
clustering_temporal=config_provider("clustering", "temporal"),
existing_capacities=config_provider("existing_capacities"),
pypsa_eur=config_provider("pypsa_eur"),
renewable=config_provider("renewable"),
conventional=config_provider("conventional"),
costs=config_provider("costs"),
Expand Down
21 changes: 20 additions & 1 deletion scripts/add_electricity.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
capacity. Storage is either a `StorageUnit` whose energy-to-power ratio is
fixed by `electricity.max_hours` (one investment variable) or a `Store` on an
extra bus with separate charging and discharging links (three investment
variables).
variables). In sector-coupled models, conventional power plants with fuels
tracked by the sector model and hydrogen storage are skipped, because
[prepare_sector_network][] adds them itself.

!!! note "Called from compose_network"
This module has no Snakemake rule of its own. Its `main` function is
Expand Down Expand Up @@ -46,6 +48,17 @@
if PYPSA_V1:
pypsa.options.params.add.return_names = True

SECTOR_CARRIERS = {
"OCGT",
"CCGT",
"oil",
"coal",
"lignite",
"biomass",
"waste",
"H2",
}

STORE_LOOKUP = {
"battery": {
"store": "battery storage",
Expand Down Expand Up @@ -1262,6 +1275,12 @@ def main(
renewable_carriers = set(params.electricity["renewable_carriers"])
extendable_carriers = params.electricity["extendable_carriers"]
conventional_carriers = params.electricity["conventional_carriers"]
if params.sector["enabled"]:
conventional_carriers = sorted(set(conventional_carriers) - SECTOR_CARRIERS)
extendable_carriers = {
c: sorted(set(carriers) - SECTOR_CARRIERS)
for c, carriers in extendable_carriers.items()
}
conventional_inputs = {
k: v for k, v in inputs.items() if k.startswith("conventional_")
}
Expand Down
16 changes: 11 additions & 5 deletions scripts/lib/validation/config/_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
from scripts.lib.validation.config.load import LoadConfig
from scripts.lib.validation.config.overpass_api import OverpassApiConfig
from scripts.lib.validation.config.plotting import PlottingConfig
from scripts.lib.validation.config.pypsa_eur import PypsaEurConfig
from scripts.lib.validation.config.renewable import RenewableConfig
from scripts.lib.validation.config.run import RunConfig
from scripts.lib.validation.config.sector import SectorConfig
Expand Down Expand Up @@ -180,10 +179,6 @@ def normalize_planning_horizons(cls, v):
default_factory=LoadConfig,
description="Electrical load configuration.",
)
pypsa_eur: PypsaEurConfig = Field(
default_factory=PypsaEurConfig,
description="PyPSA-Eur component filtering configuration.",
)
energy: EnergyConfig = Field(
default_factory=EnergyConfig,
description="Energy totals configuration.",
Expand Down Expand Up @@ -248,3 +243,14 @@ def check_no_secrets_section(cls, data):
"CORINE_API_TOKEN). You can set these in a .env file in the project root."
)
return data

@model_validator(mode="before")
@classmethod
def check_no_pypsa_eur_section(cls, data):
"""Reject the removed `pypsa_eur` section."""
if isinstance(data, dict) and "pypsa_eur" in data:
raise ValueError(
"The 'pypsa_eur:' section is removed. Select power plants with "
"'electricity: renewable_carriers' and 'electricity: conventional_carriers'."
)
return data
2 changes: 1 addition & 1 deletion scripts/lib/validation/config/electricity.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ class ElectricityConfig(BaseModel):
"waste",
"biomass",
],
description="List of conventional power plants to include in the model from `resources/powerplants.csv`. If an included carrier is also listed in `extendable_carriers`, the capacity is taken as a lower bound.",
description="List of conventional power plants to include in the model from `resources/powerplants.csv`. If an included carrier is also listed in `extendable_carriers`, the capacity is taken as a lower bound. Sector-coupled models ignore OCGT, CCGT, oil, coal, lignite, biomass and waste here, because they add these technologies as links with fuel and emission tracking.",
)
renewable_carriers: list[str] = Field(
default_factory=lambda: [
Expand Down
2 changes: 1 addition & 1 deletion scripts/lib/validation/config/existing_capacities.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class ExistingCapacitiesConfig(ConfigModel):
)
conventional_carriers: list[str] = Field(
default_factory=lambda: ["lignite", "coal", "oil", "uranium"],
description="List of conventional power plants to include in the sectoral network.",
description="Fuels for which buses are added to the sector-coupled network with myopic or perfect foresight, so that existing power plants can connect to them. Does not select which existing power plants are added.",
)
phase_outs: list[_PhaseOutConfig] = Field(
default_factory=lambda: [
Expand Down
49 changes: 0 additions & 49 deletions scripts/lib/validation/config/pypsa_eur.py

This file was deleted.

Loading
Loading