Skip to content

ancient() statements are arbitrarily ignored when using a workflow as a module: #3474

@irm-codebase

Description

@irm-codebase

Snakemake version
Occurs in v9.1.1 (and older)

Describe the bug
snakemake seems to arbitrarily ignore the ancient() setting in rule inputs when sub-workflows are called using the module: functionality.

Minimal example

In the case below, rule inputs with ancient statement within module_hydropower may be re-triggered, even if the file exists.

configfile: workflow.source_path("./test_config.yaml")

module module_hydropower:
    snakefile:
        "../../workflow/Snakefile"
    config:
        config["module_hydropower"]

use rule * from module_hydropower as module_hydropower_*

rule all:
    message:
        "Generate CF timeseries for a small country."
    default_target: True
    input:
        "results/by_shape_id/hydro_dam_cf.parquet",

Additional context
This issue was identified in this PR calliope-project/module_hydropower#1

Here is a failing example: module_hydropower.zip. You should be able to re-run our case by running the test workflow in tests/integration

This project uses data that requires a specific API key. To allow for CI tests (and to deter constant downloads) we use ancient in rules that would re-download data using the API, and include minimal test datasets in the integration test. Unfortunately, snakemake is ignoring these pre-existing files during github's CI testing, leading to the failure.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions