powerplants: filter out powerplants with shut down date < 2021
This commit is contained in:
parent
f878faac73
commit
1fd6a685ab
@ -53,8 +53,10 @@ electricity:
|
|||||||
battery: 6
|
battery: 6
|
||||||
H2: 168
|
H2: 168
|
||||||
|
|
||||||
powerplants_filter: false # use pandas query strings here, e.g. Country not in ['Germany']
|
# use pandas query strings here, e.g. Country not in ['Germany']
|
||||||
custom_powerplants: false # use pandas query strings here, e.g. Country in ['Germany']
|
powerplants_filter: (DateOut >= 2021 or DateOut != DateOut)
|
||||||
|
# use pandas query strings here, e.g. Country in ['Germany']
|
||||||
|
custom_powerplants: false
|
||||||
conventional_carriers: [nuclear, oil, OCGT, CCGT, coal, lignite, geothermal, biomass]
|
conventional_carriers: [nuclear, oil, OCGT, CCGT, coal, lignite, geothermal, biomass]
|
||||||
renewable_capacities_from_OPSD: [] # onwind, offwind, solar
|
renewable_capacities_from_OPSD: [] # onwind, offwind, solar
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ Energy Security Release (April 2022)
|
|||||||
* old: ``estimate_renewable_capacities_from_capacity_stats``
|
* old: ``estimate_renewable_capacities_from_capacity_stats``
|
||||||
* new: ``estimate_renewable_capacities``
|
* new: ``estimate_renewable_capacities``
|
||||||
|
|
||||||
|
* The powerplants that have been shut down before 2021 are filtered out.
|
||||||
|
|
||||||
**Bugs and Compatibility**
|
**Bugs and Compatibility**
|
||||||
|
|
||||||
|
@ -94,6 +94,10 @@ def add_custom_powerplants(ppl, custom_powerplants, custom_ppl_query=False):
|
|||||||
return pd.concat([ppl, add_ppls], sort=False, ignore_index=True, verify_integrity=True)
|
return pd.concat([ppl, add_ppls], sort=False, ignore_index=True, verify_integrity=True)
|
||||||
|
|
||||||
|
|
||||||
|
def replace_natural_gas_by_technology(df):
|
||||||
|
return df.Fueltype.where(df.Fueltype != 'Natural Gas', df.Technology)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
if 'snakemake' not in globals():
|
if 'snakemake' not in globals():
|
||||||
from _helpers import mock_snakemake
|
from _helpers import mock_snakemake
|
||||||
@ -103,16 +107,13 @@ if __name__ == "__main__":
|
|||||||
n = pypsa.Network(snakemake.input.base_network)
|
n = pypsa.Network(snakemake.input.base_network)
|
||||||
countries = n.buses.country.unique()
|
countries = n.buses.country.unique()
|
||||||
|
|
||||||
|
|
||||||
ppl = (pm.powerplants(from_url=True)
|
ppl = (pm.powerplants(from_url=True)
|
||||||
.powerplant.fill_missing_decommissioning_years()
|
.powerplant.fill_missing_decommissioning_years()
|
||||||
.powerplant.convert_country_to_alpha2()
|
.powerplant.convert_country_to_alpha2()
|
||||||
.query('Fueltype not in ["Solar", "Wind"] and Country in @countries')
|
.query('Fueltype not in ["Solar", "Wind"] and Country in @countries')
|
||||||
.replace({'Technology': {'Steam Turbine': 'OCGT'}})
|
.replace({'Technology': {'Steam Turbine': 'OCGT', "Combustion Engine": "OCGT"}})
|
||||||
.assign(Fueltype=lambda df: (
|
.assign(Fueltype=replace_natural_gas_by_technology))
|
||||||
df.Fueltype
|
|
||||||
.where(df.Fueltype != 'Natural Gas',
|
|
||||||
df.Technology.replace('Steam Turbine',
|
|
||||||
'OCGT').fillna('OCGT')))))
|
|
||||||
|
|
||||||
ppl_query = snakemake.config['electricity']['powerplants_filter']
|
ppl_query = snakemake.config['electricity']['powerplants_filter']
|
||||||
if isinstance(ppl_query, str):
|
if isinstance(ppl_query, str):
|
||||||
|
Loading…
Reference in New Issue
Block a user