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

Fix an output error for connections costs #691

Merged
merged 2 commits into from
Apr 18, 2023

Conversation

ekatef
Copy link
Member

@ekatef ekatef commented Apr 18, 2023

Closes #647

Currently a connection costs file is written by _adjust_capital_costs_using_connection_costs which is called after simplifying links and when removing stubs. If there are no links in the network and remove_stubs: false, a connection costs file is not written which leads to snakemake MissingOutputException error.

Added an output of an empty data frame for connection costs to a short-cut of simplify_links() corresponding to a case without links in the network. In case remove_stubs is called, it happens after simplify_links() and an empty connections costs file will simply be overwriten.

Checklist

  • I consent to the release of this PR's code under the GPLv3 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.
  • Code and workflow changes are sufficiently documented.
  • Newly introduced dependencies are added to envs/environment.yaml and envs/environment.docs.yaml.
  • Changes in configuration options are added in all of config.default.yaml and config.tutorial.yaml.
  • Add a test config or line additions to test/ (note tests are changing the 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.

@ekatef
Copy link
Member Author

ekatef commented Apr 18, 2023

Not sure if a release note is needed as that is a simple bug fix

@ekatef
Copy link
Member Author

ekatef commented Apr 18, 2023

@davide-f, I think that is ready for review
Actually, it looks like a solution can be much simpler than expected :)

@davide-f davide-f merged commit 309e837 into pypsa-meets-earth:main Apr 18, 2023
@ekatef ekatef deleted the fix_connect_costs_output branch November 14, 2023 22:18
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.

Connection costs are not calculated if stubs are not removed
2 participants