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

Use absolute path for config.default.yaml in _helpers.py #1137

Merged
merged 18 commits into from
Oct 29, 2024

Conversation

yerbol-akhmetov
Copy link
Collaborator

Changes proposed in this Pull Request

Good day. Here I propose to use absolute path to config.default.yaml in _helpers.py script. Such change is important while importing PyPSA-Earth rules elsewhere and running then in external directories within another Snakemake. This is helpful for setting workflow.

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.

@yerbol-akhmetov
Copy link
Collaborator Author

We are still re-testing all rules execution with @GbotemiB. Unfortunately, these small changes were not sufficient for some rules, while it worked in one machine. We will let know when it is 100% ready.
@davide-f @ekatef

@yerbol-akhmetov
Copy link
Collaborator Author

With recent commit, prefix was identified for retrieve_databundle_light rule. Generally, a prefix is added to input and outputs of the imported rules automatically when prefix is defined as:

module pypsa_earth:
    snakefile:
        "submodules/pypsa-earth/Snakefile"
    config:
        config
    prefix:
        "submodules/pypsa-earth"

Those inputs and outputs (with prefix) are accessed properly when input and outputs of rules are defined explicitly as in almost all rules, except retrieve_databundle_light rule. Therefore, prefix is added inside of the retrieve_databundle_light.py script. It helps to match the inputs of following rule to outputs of preceding rule if Snakefile import is done. If snakemake is run in pypsa-earth directory (as regularly), then prefix is an empty string `` and rules are run regularly.

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.

Great @yerbol-akhmetov :D
This PR is ready to go functionality-wise! :D

Would you mind to fix the merge conflict? Than this is merged :)
Many thanks!

@yerbol-akhmetov
Copy link
Collaborator Author

Great @yerbol-akhmetov :D This PR is ready to go functionality-wise! :D

Would you mind to fix the merge conflict? Than this is merged :) Many thanks!

Thanks, @davide-f, for great help in testing and suggestions. I have resolved the conflicts and updated the branch.

@davide-f davide-f merged commit 3836aed into pypsa-meets-earth:main Oct 29, 2024
4 checks passed
@davide-f
Copy link
Member

Thanks @yerbol-akhmetov :D

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