fix NaN techtype & fix wrong tech for Nuclear
This commit is contained in:
parent
d569d3782c
commit
f20203e623
@ -92,7 +92,13 @@ 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):
|
def replace_natural_gas_technology(df):
|
||||||
|
mapping = {'Steam Turbine': 'OCGT', "Combustion Engine": "OCGT"}
|
||||||
|
tech = df.Technology.replace(mapping).fillna('OCGT')
|
||||||
|
return df.Technology.where(df.Fueltype != 'Natural Gas', tech)
|
||||||
|
|
||||||
|
|
||||||
|
def replace_natural_gas_fueltype(df):
|
||||||
return df.Fueltype.where(df.Fueltype != 'Natural Gas', df.Technology)
|
return df.Fueltype.where(df.Fueltype != 'Natural Gas', df.Technology)
|
||||||
|
|
||||||
|
|
||||||
@ -110,8 +116,8 @@ if __name__ == "__main__":
|
|||||||
.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', "Combustion Engine": "OCGT"}})
|
.assign(Technology=replace_natural_gas_technology)
|
||||||
.assign(Fueltype=replace_natural_gas_by_technology))
|
.assign(Fueltype=replace_natural_gas_fueltype))
|
||||||
|
|
||||||
# Correct bioenergy for countries where possible
|
# Correct bioenergy for countries where possible
|
||||||
opsd = pm.data.OPSD_VRE().powerplant.convert_country_to_alpha2()
|
opsd = pm.data.OPSD_VRE().powerplant.convert_country_to_alpha2()
|
||||||
|
Loading…
Reference in New Issue
Block a user