diff --git a/docs/release-notes.md b/docs/release-notes.md index 1f1f48a0..c30d2159 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -10,6 +10,11 @@ SPDX-License-Identifier: MIT * +## [v0.9.1](https://github.com/PyPSA/powerplantmatching/releases/tag/v0.9.1) (7th October 2026) + +* Bugfix: `pm.powerplants()` no longer drops entries that share name, fuel type and country. In v0.9.0, this removed all but one unit of each wind park in the Marktstammdatenregister. The operating wind capacity in Germany fell from 77 GW to 18 GW, and biogas from 7 GW to 3 GW. ([PR #328](https://github.com/PyPSA/powerplantmatching/pull/328)) +* For OPSD EU, use the most specific fuel classification (`energy_source_level_3`) for `Fueltype` when available. Correct the capacity of Borssele 1 nuclear power plant to the net value of 485 MW. ([PR #288](https://github.com/PyPSA/powerplantmatching/pull/288)) + ## [v0.9.0](https://github.com/PyPSA/powerplantmatching/releases/tag/v0.9.0) (3rd October 2026) * Updated BEYONDCOAL, IRENASTAT, ENTSOE, JRC, Marktstammdatenregister (August 2026), European Energy Storage Inventory and the Global Energy Monitor datasets (oil and gas, coal, geothermal, nuclear, hydropower) to the latest versions. ([PR #319](https://github.com/PyPSA/powerplantmatching/pull/319)) diff --git a/powerplantmatching/collection.py b/powerplantmatching/collection.py index a677ae52..5e462f5c 100644 --- a/powerplantmatching/collection.py +++ b/powerplantmatching/collection.py @@ -243,15 +243,6 @@ def powerplants( else: matched = matched[matched.lat.notnull()] - if isinstance(matched.columns, pd.MultiIndex): - matched = ( - matched.stack(future_stack=True) - .drop_duplicates(["Name", "Fueltype", "Country"]) - .unstack(-1) - ) - else: - matched = matched.drop_duplicates(["Name", "Fueltype", "Country"]) - matched.reset_index(drop=True).to_csv(fn, index_label="id", encoding="utf-8") if extend_by_vres: diff --git a/test/test_collection.py b/test/test_collection.py new file mode 100644 index 00000000..1d54a99e --- /dev/null +++ b/test/test_collection.py @@ -0,0 +1,28 @@ +# SPDX-FileCopyrightText: Contributors to powerplantmatching +# +# SPDX-License-Identifier: MIT + +import pandas as pd + +import powerplantmatching as pm +from powerplantmatching import collection + + +def test_powerplants_keeps_units_with_same_name(monkeypatch): + turbines = pd.DataFrame( + { + "Name": ["Windpark Nord", "Windpark Nord"], + "Fueltype": "Wind", + "Country": "Germany", + "Capacity": [3.0, 4.0], + "lat": [54.0, 54.1], + "lon": [9.0, 9.1], + "projectID": [{"MASTR": {"SEE1"}}, {"MASTR": {"SEE2"}}], + } + ) + monkeypatch.setattr(collection, "collect", lambda *args, **kwargs: turbines) + config = pm.get_config(fully_included_sources=[], variant="test-same-name") + + df = pm.powerplants(config=config, update=True, fill_geopositions=False) + + assert df.Capacity.sum() == turbines.Capacity.sum()