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

build_powerplants FuelType and Technology bug #676

Closed
pz-max opened this issue Jun 6, 2023 · 1 comment · Fixed by #701
Closed

build_powerplants FuelType and Technology bug #676

pz-max opened this issue Jun 6, 2023 · 1 comment · Fixed by #701
Labels

Comments

@pz-max
Copy link
Collaborator

pz-max commented Jun 6, 2023

Describe the Bug

Spotted by @energyLS in PyPSA-Earth, fixed by @Tomkourou, and reviewed by me. It was found out that the FuelType and Technology were not correctly assigned in PyPSA-Earth, leading to the following issue: image

PyPSA-Eur trouble code is here:

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)

Recommended changes in the PyPSA-Earth PR applicable to PyPSA-Eur:

  • assume that steam turbine is actually CCGT (steam turbine + gas turbine)
  • fix assignment bug in replace_natural_gas_fueltype()
  • replace .where by .mask for readability improvement

The changes lead to the following correct results:
image

@pz-max pz-max added the bug label Jun 6, 2023
@pz-max
Copy link
Collaborator Author

pz-max commented Jun 6, 2023

Let us know if you think the bug should also be fixed in PyPSA-Eur. I am sure we can create a PR on this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant