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

Remove H2 and battery related techs from elec-only model before re-addition #1198

Merged
merged 6 commits into from
Nov 28, 2024

Conversation

yerbol-akhmetov
Copy link
Collaborator

@yerbol-akhmetov yerbol-akhmetov commented Nov 15, 2024

Changes proposed in this Pull Request

Good day. This PR aims to help organization of H2 and battery addition to sector network. Currently, H2 electrolysis, H2 Fuel cell, battery charger and battery discharger links are added in add_extra_components and then re-added in prepare_sector_network. As a result, the second time it shows pypsa warning (error that components already exist). This PR aims to remove H2 and battery related components from electricity-only network, so that addition in sector script will be smooth.

One option what I thought was addition of if/else statements to ensure adding buses, links, and stores if it does not exist. But that approach is not clean in terms of code, as a lot of ifs need to be added. Also addition of H2 and battery related techs (links) will be accomplished in different scripts and functions, which might make it slightly difficult to debug.

Also removing them first from electricity network, and adding as a whole function will make it more consistent. As everything will be added with add_hydrogen and add_storage functions.
@davide-f

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.
  • 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

@davide-f davide-f left a comment

Choose a reason for hiding this comment

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

Hello @yerbol-akhmetov ,

Many thanks! To me this approach seems reasonable. A quick, simple but robust solution

scripts/prepare_sector_network.py Show resolved Hide resolved
Copy link
Member

@davide-f davide-f left a comment

Choose a reason for hiding this comment

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

Contributions are great and useful.
CI on sector coupled model changes slightly due to the intended feature that is added.
Merging. Many thanks @yerbol-akhmetov :D

Copy link
Member

@davide-f davide-f left a comment

Choose a reason for hiding this comment

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

@yerbol-akhmetov sorry, last point. Can you add a major contribution to the release_note?

@davide-f davide-f merged commit c9f30e1 into pypsa-meets-earth:main Nov 28, 2024
6 checks passed
@yerbol-akhmetov yerbol-akhmetov deleted the fix_storages branch November 28, 2024 13:54
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