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

Avoid the use use of workflow.source_path #893

Merged
merged 2 commits into from
Jan 24, 2024

Conversation

koen-vg
Copy link
Contributor

@koen-vg koen-vg commented Jan 24, 2024

The above function returns a path to a cached source file, which changes for every run, causing the resulting parameter to change and the solve_network rule to re-run every time. The problem was introduced in d145758

I have tested the solution, and also tested to make sure this works when pypsa-eur is used as a module.

Checklist

  • I tested my contribution locally and it seems to work fine.
  • Code and workflow changes are sufficiently documented.
  • Changed dependencies are added to envs/environment.yaml.
  • Changes in configuration options are added in all of config.default.yaml.
  • Changes in configuration options are also documented in doc/configtables/*.csv.
  • A release note doc/release_notes.rst is added.

The above function returns a path to a cached source file, which
changes for every run, causing the resulting parameter to change and
the solve_network rule to re-run
Copy link
Member

@fneum fneum left a comment

Choose a reason for hiding this comment

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

Oh, interesting! This is a big downside of using workflow.source_path() for any place (input, param) and probably not intended by the snakemake developers. Thanks for finding the issue and providing the fix!

@fneum fneum enabled auto-merge January 24, 2024 15:19
@fneum fneum disabled auto-merge January 24, 2024 15:57
@fneum fneum merged commit 5980618 into PyPSA:master Jan 24, 2024
5 checks passed
@koen-vg koen-vg deleted the fix-source-path branch January 24, 2024 16:09
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