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

Custom ppl opts #739

Merged
merged 12 commits into from
May 21, 2023
2 changes: 1 addition & 1 deletion config.default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ electricity:
Link: [] # H2 pipeline

powerplants_filter: (DateOut >= 2022 or DateOut != DateOut)
custom_powerplants: false
custom_powerplants: false # "false" - no custom powerplants, "merge" uses both open-source and custom powerplants, "replace" uses only custom powerplants
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you change the comment to wherever possible:
# "false" use only powerplantmatching (ppm) data, "merge" combines ppm and custom powerplants, "replace" use only custom powerplants


conventional_carriers: [nuclear, oil, OCGT, CCGT, coal, lignite, geothermal, biomass]
renewable_carriers: [solar, onwind, offwind-ac, offwind-dc, hydro]
Expand Down
2 changes: 1 addition & 1 deletion config.tutorial.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ electricity:
Link: [] # H2 pipeline

powerplants_filter: (DateOut >= 2022 or DateOut != DateOut)
custom_powerplants: false
custom_powerplants: false # "false" - no custom powerplants, "merge" uses both open-source and custom powerplants, "replace" uses only custom powerplants

conventional_carriers: [nuclear, oil, OCGT, CCGT, coal, lignite, geothermal, biomass]
renewable_carriers: [solar, onwind, offwind-ac, offwind-dc, hydro]
Expand Down
1 change: 1 addition & 0 deletions doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ PyPSA-Earth 0.2.1
* Fix hard-coded simplification of lines to 380kV `PR #732 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/732>`__.
It is now possible to simplify the network to any other voltage level with config option `base_voltage`.

* Add merge and replace functionalities while adding custom powerplants `PR #739 <https://github.com/pypsa-meets-earth/pypsa-earth/pull/739>`__

PyPSA-Earth 0.2.0
=================
Expand Down
9 changes: 6 additions & 3 deletions scripts/build_powerplants.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,12 @@ def add_custom_powerplants(ppl, inputs, config):
# if isinstance(custom_ppl_query, str):
# add_ppls.query(custom_ppl_query, inplace=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know pypsa-eur is using line 247 and 248. Can you figure out its purpose?
I think your merge and replace option could make lines 247 and 248 not necessary. Maybe we can remove the comment?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have checked the code and it seems that it is left to enable some query to custom powerplants being added. We can leave them as commented or we can remove them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it is better to remove them, since if enabled it might contradict with the proposed PR.


return pd.concat(
[ppl, add_ppls], sort=False, ignore_index=True, verify_integrity=True
)
if custom_ppl_query == "merge":
return pd.concat(
[ppl, add_ppls], sort=False, ignore_index=True, verify_integrity=True
)
elif custom_ppl_query == "replace":
return add_ppls


def replace_natural_gas_technology(df):
Expand Down