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

--until not working with checkpoints #2824

Open
nkt97 opened this issue Apr 18, 2024 · 4 comments
Open

--until not working with checkpoints #2824

nkt97 opened this issue Apr 18, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@nkt97
Copy link

nkt97 commented Apr 18, 2024

Hello,

I cannot use --until for rules between a checkpoint and the rule where the aggregation happens. If I use --until, it says Nothing to be done. If I do not use --until, everything works perfectly fine.

Here is a minimal example, where snakemake --cores all --until r2 does not work, even after running rule r1 beforehand.

rule all:
    input:
        'agg'
        
checkpoint r1:
    output:
        directory('B')
    shell:
        'mkdir -p B && touch B/1 && touch B/2 && touch B/3'
        
rule r2:
    input:
        'B/{i}'
    output:
        'C{i}'
    shell:
        'touch {output}'
        
        
def aggregate_input(wildcards):
    checkpoint_output = checkpoints.r1.get(**wildcards).output
    exp = expand('C{i}', i=glob_wildcards( 'B/{i}').i)
    return exp
    
rule r3:
    input:
        aggregate_input
    output:
        'agg'
    shell:
        'touch {output}'

I hope you can help me. Thank you very much in advance!
Khoa

@nkt97 nkt97 added the bug Something isn't working label Apr 18, 2024
@phspo
Copy link

phspo commented Apr 18, 2024

can confirm and reproduce this

@cademirch
Copy link
Contributor

cademirch commented Apr 18, 2024

The first issue makes sense and I believe is expected behavior. If r1 has not been run, r2 is not in the DAG yet, and thus running until it is not possible. It is odd that --until r2 does not work when r1 has already been run though.

Edit: Based on the help message of until:

"Runs the pipeline until it reaches the specified rules or "
"files. Only runs jobs that are dependencies of the specified "
"rule or files, does not run sibling DAGs. "

I guess the second situation kinda makes sense too, since r3 needs to be run to trigger the DAG re-evaluation. It is a bit odd since if you put a print statement in the aggregate_input function, the function is being run.

@nkt97
Copy link
Author

nkt97 commented Apr 29, 2024

Thank you for your answer! Still, would it be possible to add this functionality to --until somehow?

@cademirch
Copy link
Contributor

I'm not sure. But if you figure out how to fix this, you should open a PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants