Skip to content

Commit

Permalink
fix: added missing input files in reason.updated_input in dag.py
Browse files Browse the repository at this point in the history
Let's consider a 'A' rule that takes 'N' inputs from a 'B' rule with
different wildcards. The input function for the A rule requests output
files from 'B'.

If a first run has already generated the output of 'A' and 'B' and if
the input function of 'A' requests new input files from B not yet
generated, snakemake will neither generate missing 'B' output files
nor regenerate the 'A' output. However the list-input-changes is able
to list correctly the missing files.

The commit allows to generate missing 'B' outputs and regenerate the
'A' output.
  • Loading branch information
Christophe Clienti committed Mar 7, 2022
1 parent ef0475c commit 057d01a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion snakemake/dag.py
Expand Up @@ -996,7 +996,9 @@ def update_needrun(job):
output_mintime_ = output_mintime.get(job)
if output_mintime_:
updated_input = [
f for f in job.input if f.exists and f.is_newer(output_mintime_)
f
for f in job.input
if f.exists and f.is_newer(output_mintime_) or not f.exists
]
reason.updated_input.update(updated_input)
if noinitreason and reason:
Expand Down

0 comments on commit 057d01a

Please sign in to comment.