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
2 changes: 1 addition & 1 deletion docs/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SPDX-License-Identifier: MIT

## Upcoming Version

*
* Fix typo in `clean_name.fueltypes_with_blocks`: listed fuels are now excluded from aggregation, rather than the setting being partially ignored due to the misspelled key. Nuclear units therefore remain separate by default. Empty lists allow all fuels to be aggregated and no longer cause an error during name cleaning.

## [v0.9.1](https://github.com/PyPSA/powerplantmatching/releases/tag/v0.9.1) (7th October 2026)

Expand Down
9 changes: 6 additions & 3 deletions powerplantmatching/cleaning.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def clean_name(df, config=None):
# do not remove block letters for fuel types with blocks; the regular
# regex \w would remove standalone letters, this one is skipped for
# fueltypes in mask
elif key == "" and r"\w" in pattern:
elif len(keep_blocks) > 0 and key == "" and r"\w" in pattern:
pattern_keep = r"(?i)" + "|".join(
[rf"\b{p}\b" for p in pattern if p != r"\w"]
)
Expand Down Expand Up @@ -439,6 +439,9 @@ def aggregate_units(
up the capacity of powerplant units which are determined to belong
to the same plant.

Fuel types listed in ``clean_name.fueltypes_with_blocks`` are excluded
from aggregation and remain singleton groups, regardless of their names.

Parameters
----------
df : pandas.Dataframe or string
Expand Down Expand Up @@ -497,8 +500,8 @@ def aggregate_units(
break

block_query = None
if with_blocks := config["clean_name"].get("fuel_type_with_blocks", []): # noqa
block_query = "Fueltype in @with_blocks"
if with_blocks := config["clean_name"].get("fueltypes_with_blocks", []): # noqa: F841
block_query = "Fueltype not in @with_blocks"

if country_wise:
countries = df.Country.unique()
Expand Down
2 changes: 2 additions & 0 deletions powerplantmatching/package_data/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,8 @@ target_technologies:
- op zee
- zeewind
clean_name:
# Preserve block labels in names and exclude these fuels from unit aggregation.
# An empty list removes block labels and allows all fuels to be aggregated.
fueltypes_with_blocks:
- Nuclear
remove_common_words: false # remove words which appear more that 20 times in all entries
Expand Down
Loading