Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not compute powerplants from ppm if replace option is used #1281

Merged
Merged
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 data/custom_powerplants.csv
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Name,Fueltype,Technology,Set,Country,Capacity,Efficiency,Duration,Volume_Mm3,DamHeight_m,StorageCapacity_MWh,DateIn,DateRetrofit,DateMothball,DateOut,lat,lon,EIC,projectID,bus
Name,Fueltype,Technology,Set,Country,Capacity,Efficiency,Duration,Volume_Mm3,DamHeight_m,StorageCapacity_MWh,DateIn,DateRetrofit,DateOut,lat,lon,EIC,projectID,bus
2 changes: 2 additions & 0 deletions doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ This part of documentation collects descriptive release notes to capture the mai

**Minor Changes and bug-fixing**

* Prevent computation of powerplantmatching if replace option is selected for custom_powerplants `PR #1281 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/1281>`__


PyPSA-Earth 0.6.0
=================
Expand Down
17 changes: 10 additions & 7 deletions scripts/build_powerplants.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,13 +337,16 @@ def replace_natural_gas_technology(df: pd.DataFrame):
else:
config["main_query"] = ""

ppl = (
pm.powerplants(from_url=False, update=True, config_update=config)
.powerplant.fill_missing_decommissioning_years()
.query('Fueltype not in ["Solar", "Wind"] and Country in @countries_names')
.powerplant.convert_country_to_alpha2()
.pipe(replace_natural_gas_technology)
)
if snakemake.config["electricity"]["custom_powerplants"] != "replace":
ppl = (
pm.powerplants(from_url=False, update=True, config_update=config)
.powerplant.fill_missing_decommissioning_years()
.query('Fueltype not in ["Solar", "Wind"] and Country in @countries_names')
.powerplant.convert_country_to_alpha2()
.pipe(replace_natural_gas_technology)
)
else:
ppl = pd.DataFrame()

ppl = add_custom_powerplants(
ppl, snakemake.input, snakemake.config
Expand Down
Loading