Skip to content

Conversation

@tgilon
Copy link
Contributor

@tgilon tgilon commented Feb 5, 2025

Changes proposed in this Pull Request

This PR proposes to align the snakemake version and the associated mock_snakemake to the one used in PyPSA-Eur. This is necessary to avoid two errors. The first one is reported here PyPSA/pypsa-eur#1439 and solved here PyPSA/pypsa-eur#1440 (related snakemake bug snakemake/snakemake#3202).

The second is error is thrown with snakemake=8.27.1 and the current `mock_snakemake. Here is the traceback:

Traceback (most recent call last):
  File "technology-data/scripts/compile_cost_assumptions.py", line 3348, in <module>
    snakemake = mock_snakemake("compile_cost_assumptions")
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "technology-data/scripts/_helpers.py", line 114, in mock_snakemake
    for p in sm.SNAKEFILE_CHOICES:
             ^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'snakemake' has no attribute 'SNAKEFILE_CHOICES'

I tested the current suggestion using both the snakemake rule and through terminal.

Checklist

  • Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be given in doc.
  • Data source for new technologies is clearly stated.
  • Newly introduced dependencies are added to environment.yaml (if applicable).
  • A note for the release notes doc/release_notes.rst of the upcoming release is included.
  • I consent to the release of this PR's code under the GPLv3 license.

@tgilon tgilon marked this pull request as ready for review February 5, 2025 17:03
@tgilon
Copy link
Contributor Author

tgilon commented Feb 5, 2025

@finozzifa FYI

@fneum fneum merged commit 93f6e08 into PyPSA:master Feb 5, 2025
3 checks passed
@tgilon tgilon deleted the fix-snakemake-env branch February 6, 2025 08:39
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