snakemake / snakemake

This is the development home of the workflow management system Snakemake. For general information, see
https://snakemake.github.io
MIT License
2.26k stars 550 forks source link

DOC: Confusing `--help` text for `--reason` option: `(deprecated, always true now). (default: False)` #1902

Open corneliusroemer opened 2 years ago

corneliusroemer commented 2 years ago

Snakemake version 7.14.2

Describe the bug The --help text for option --reason is confusing. It states:

--reason, -r          Print the reason for each executed rule (deprecated, always true now). (default: False)

The combination default: False and (deprecated, always true now) makes no sense, or am I not getting what is intended? How can something be always true and False at the same time?

pdimens commented 1 year ago

What triggered this decision if it's deprecated? The output log gets tremendously bloated if your inputs/outputs have a lot of files in them, for example:

rule example:
    input: expand("file.{num}.txt", num = range(0, 500))

I've been seeing large volumes of reason: text flood my terminal sessions as a result. Is this truly deprecated?

corneliusroemer commented 1 year ago

@pdimens see this PR https://github.com/snakemake/snakemake/pull/1663 for where the default seems to have changed: https://github.com/snakemake/snakemake/commit/4c11893d2fda5824adff44d16d7741484e63efea (found it using git blame)

I guess that CLI option should be removed and until then at least it should say default: True.

pdimens commented 1 year ago

It becomes terribly unwieldy. Here's a real-world example of splitting a file into 10 chunks (in reality, this could be 10-1000).

[Tue Nov 22 14:15:48 2022]
Job 31: Preprocessing for EMA mapping: ShadHap1_L002_C08
Reason: Missing output files: ReadMapping/preproc/ShadHap1_L002_C08/ema-bin-009, ReadMapping/preproc/ShadHap1_L002_C08/ema-bin-007, ReadMapping/preproc/ShadHap1_L002_C08/ema-nobc, ReadMapping/preproc/ShadHap1_L002_C08/ema-bin-001, ReadMapping/preproc/ShadHap1_L002_C08/ema-bin-006, ReadMapping/preproc/ShadHap1_L002_C08/ema-bin-003, ReadMapping/preproc/ShadHap1_L002_C08/ema-bin-004, ReadMapping/preproc/ShadHap1_L002_C08/ema-bin-002, ReadMapping/preproc/ShadHap1_L002_C08/ema-bin-000, ReadMapping/preproc/ShadHap1_L002_C08/ema-bin-005, ReadMapping/preproc/ShadHap1_L002_C08/ema-bin-008; Input files updated by another job: ReadMapping/count/ShadHap1_L002_C08.ema-ncnt; Code has changed since last execution

which wraps in the terminal like this image

vokoscreenNG-2022-11-22_15-02-27.webm

corneliusroemer commented 1 year ago

Thanks for sharing @pdimens - that's not so great.

@johanneskoester maybe it would be nice if one could still set print reason -r to false - even if the default is true?

pdimens commented 1 year ago

Another option would be to have the text elided so that it fits the terminal width. Something akin to

Reason: Missing output files file2.txt, file3.txt...file500.txt
corneliusroemer commented 1 year ago

Good idea! This shouldn't be default though as one may want to be able to know all the files that trigger rebuild in some cases.

pdimens commented 1 year ago

pinging @johanneskoester to renew discussion of this