Skip to content

Commit

Permalink
Merge pull request pypsa-meets-earth#1281 from yerbol-akhmetov/custom…
Browse files Browse the repository at this point in the history
…_powerplants_fix

Do not compute powerplants from ppm if replace option is used
  • Loading branch information
davide-f authored Jan 4, 2025
2 parents 5b9ac30 + 395aaec commit a0971d5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
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

0 comments on commit a0971d5

Please sign in to comment.