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
Merged

Conversation

yerbol-akhmetov
Copy link
Collaborator

@yerbol-akhmetov yerbol-akhmetov commented May 20, 2023

Changes proposed in this Pull Request

Here I propose an extension of functionality of custom powerplants addition. Currently, there are only two options: 1) Use open-source powerplants with custom_powerplants: false, and 2) Attach custom powerplants from custom_powerplants.csv to open-source data and use both with custom_powerplants: true. There is no option to select only custom powerplants. This functionality is very useful. Sometimes you can have an accurate custom powerplants information and you would like to replace retrieved open-source plants with custom data. On the other situations, you might need to use both open-source and custom powerplants.
Therefore, I propose to extend the functionality to three options:

  1. false - no custom power plants are used;
  2. merge - both open-source and custom powerplants from custom_powerplants.csv are merged and used;
  3. replace - only custom powerplants from custom_powerplants.csv are used.

Checklist

  • I consent to the release of this PR's code under the AGPLv3 license and non-code contributions under CC0-1.0 and CC-BY-4.0.
  • I tested my contribution locally and it seems to work fine.
  • Changes in configuration options are added in all of config.default.yaml and config.tutorial.yaml.
  • Changes in configuration options are also documented in doc/configtables/*.csv and line references are adjusted in doc/configuration.rst and doc/tutorial.rst.
  • A note for the release notes doc/release_notes.rst is amended in the format of previous release notes, including reference to the requested PR.

Copy link
Member

@pz-max pz-max left a comment

Choose a reason for hiding this comment

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

Nice PR! 💯 Some minor changes are required.
Could you also adjust the configuration.rst accordingly?

@@ -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

Comment on lines 247 to 248
# 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.

@yerbol-akhmetov yerbol-akhmetov requested a review from pz-max May 21, 2023 14:04
pz-max
pz-max approved these changes May 21, 2023
Copy link
Member

@pz-max pz-max left a comment

Choose a reason for hiding this comment

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

Looks great. I just had to change the release note position

@pz-max pz-max merged commit 7b00562 into pypsa-meets-earth:main May 21, 2023
@yerbol-akhmetov yerbol-akhmetov deleted the custom_ppl_opts branch May 21, 2023 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants