Skip to content

when matching plants, do a grouping with respect to DateOut - #329

Closed
lindnemi wants to merge 2 commits into
masterfrom
add-dateout-grouping-years
Closed

lindnemi wants to merge 2 commits into
masterfrom
add-dateout-grouping-years

Conversation

@lindnemi

@lindnemi lindnemi commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

The Problem

Decomissioning is too aggressive, when DateOut is missing for some units, consider e.g. the Neurath powerplant which has several blocks recorded in MASTR:

133884	Neurath	Lignite	Steam Turbine	PP	Germany	1060.00	NaN	2012.0	NaN	NaN	51.037649	6.612286	NaN	NaN	NaN	NaN	NaN	MASTR-SEE993592183001
133885	Neurath	Lignite	Steam Turbine	PP	Germany	294.00	NaN	1972.0	NaN	2022.0	51.037649	6.612286	NaN	NaN	NaN	NaN	NaN	MASTR-SEE907150117643
133886	Neurath	Lignite	Steam Turbine	PP	Germany	607.00	NaN	1975.0	NaN	2024.0	51.037649	6.612286	NaN	NaN	NaN	NaN	NaN	MASTR-SEE931736847297
133887	Neurath	Lignite	Steam Turbine	PP	Germany	294.00	NaN	1972.0	NaN	2021.0	51.037649	6.612286	NaN	NaN	NaN	NaN	NaN	MASTR-SEE979012663285
133888	Neurath	Lignite	Steam Turbine	PP	Germany	292.00	NaN	1973.0	NaN	2024.0	51.037649	6.612286	NaN	NaN	NaN	NaN	NaN	MASTR-SEE978971638464
133889	Neurath	Lignite	Steam Turbine	PP	Germany	1060.00	NaN	2012.0	NaN	NaN	51.037649	6.612286	NaN	NaN	NaN	NaN	NaN	MASTR-SEE925599434282
133890	Neurath	Lignite	Steam Turbine	PP	Germany	604.00	NaN	1976.0	NaN	2024.0	51.037649	6.612286	NaN	NaN	NaN	NaN	NaN	MASTR-SEE976414005279

So, it's a 4 GW PP out of which around 2 GW have been decommissoned before 2024.

However, aggregation turned this into:

131607	Neurath	Lignite	Steam Turbine	PP	Germany	4211.00	NaN	1972.0	NaN	2024.0	51.037649	6.612286	NaN	NaN	NaN	NaN	{nan, nan, nan, nan, nan, nan, nan}	{MASTR-SEE978971638464, MASTR-SEE993592183001,...

Which means that all 4 GW get registered as decomissioned in 2024.

This PR

Instead of aggregating all matching units into one plant, this change distinguishes the units based on the given DateOut.

This PR distinguishes based on the new config option grouping_years_dateout and keeps a separate row for units with DateOut = NaN

Changes proposed in this Pull Request

Checklist

  • Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be given in docs.
  • Unit tests for new features were added (if applicable).
  • A note for the release notes docs/release_notes.md of the upcoming release is included.
  • I consent to the release of this PR's code under the MIT license and have added my name to the docs/contributors.md.

@lindnemi

lindnemi commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Actually this fix only targeted the MASTR data. For the aggregated data across all data sources it produces undesired side effects.

E.g. for Neurath, the DateOut is with all sources enables is currently infered as 2033 and the opposite problem arises, all 4 GW remain operational:

Snippet from the Copilot report:

Run Capacity DateIn DateOut Main source association
Before 4211 MW 1972 2033 All blocks combined across sources
After 2120 MW 1972 2033 Operating MASTR/GEM/BEYONDCOAL blocks, plus other sources
After 2224 MW 1972 2024 Retired GEM/BEYONDCOAL blocks
After 2091 MW 1972 2024 Retired MASTR blocks

What improved: using the comparison’s retirement convention, Neurath capacity available in 2026 falls from 4211 MW to 2120 MW, as desired.

What remains problematic:

The two retired rows describe overlapping Neurath blocks from different sources. They were not consolidated, so final historical capacity rises from 4211 to 6435 MW.
The operating cohort’s MASTR commissioning year of 2012 becomes 1972 during cross-source reduction.
Its missing MASTR retirement date becomes 2033 from other sources. Thus NaN preservation works within-source, but does not persist through the complete pipeline.

@lindnemi
lindnemi marked this pull request as draft October 9, 2026 14:51
@lindnemi lindnemi closed this Oct 15, 2026
@lindnemi lindnemi mentioned this pull request Oct 15, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant