From ccc56ce3c889420fd31b015c4b5025596dbe9660 Mon Sep 17 00:00:00 2001 From: euronion <42553970+euronion@users.noreply.github.com> Date: Tue, 17 Mar 2020 09:50:38 +0100 Subject: [PATCH] Fix: Correctly determine the bus to attatch custom powerplants to. (#131) * Add index integrity checks for custom powerplants. * Update .csv template for custom powerplants. * Update data/custom_powerplants.csv * Revert "Merge branch 'master' into fix/custom-powerplants" This reverts commit 5cd9c1afafd1ab36c31181ffed7635152805ee52, reversing changes made to 5b1df27b25fdc89acca88395a0ba999f84dce109. * Update release_notes.rst * Rephrasing update to release notes. * Merge with upstream/master (revert reverted merge). Co-authored-by: Fabian Neumann --- data/custom_powerplants.csv | 2 +- doc/release_notes.rst | 2 ++ scripts/build_powerplants.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/data/custom_powerplants.csv b/data/custom_powerplants.csv index 91fc5eec..4e039b7a 100644 --- a/data/custom_powerplants.csv +++ b/data/custom_powerplants.csv @@ -1 +1 @@ -id,Name,Fueltype,Technology,Set,Country,Capacity,Efficiency,Duration,Volume_Mm3,DamHeight_m,YearCommissioned,Retrofit,lat,lon,projectID \ No newline at end of file +Name,Fueltype,Technology,Set,Country,Capacity,Efficiency,Duration,Volume_Mm3,DamHeight_m,YearCommissioned,Retrofit,lat,lon,projectID,YearDecommissioning diff --git a/doc/release_notes.rst b/doc/release_notes.rst index ee16c96a..9484b2d5 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -7,6 +7,8 @@ PyPSA-Eur 0.2.0 (TBD) * The optimization is now performed using the ``pyomo=False`` setting in the :func:`pypsa.lopf.network_lopf`. This speeds up the solving process significantly and consumes much less memory. The inclusion of additional constraints were adjusted to the new implementation. They are all passed to the :func:`network_lopf` function via the ``extra_functionality`` argument. The rule ``trace_solve_network`` was integrated into the rule :mod:`solve_network` and can be activated via configuration with ``solving: options: track_iterations: true``. The charging and discharging capacities of batteries modelled as store-link combination are now coupled (`#116 `_). +* Removed the `id` column for custom power plants in `data/custom_powerplants.csv` to avoid custom power plants with conflicting ids getting attached to the wrong bus (`#131 `_). + * ``snakemake`` rules for retrieving cutouts and the natura raster can now be disabled independently from their respective rules to build them; via ``config.*yaml`` (`#136 `_). diff --git a/scripts/build_powerplants.py b/scripts/build_powerplants.py index 237c42b9..a5b0fd45 100755 --- a/scripts/build_powerplants.py +++ b/scripts/build_powerplants.py @@ -86,7 +86,7 @@ def add_custom_powerplants(ppl): dtype={'bus': 'str'}) if isinstance(custom_ppl_query, str): add_ppls.query(custom_ppl_query, inplace=True) - return ppl.append(add_ppls, sort=False) + return ppl.append(add_ppls, sort=False, ignore_index=True, verify_integrity=True) if __name__ == "__main__":