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
feat: Add rerun-params-changed command line option #1107
feat: Add rerun-params-changed command line option #1107
Conversation
This commandline options allows to automatically rerun all rules for which parameters have changed. Fixes snakemake#976.
This PR lacks the test folder |
Yes, you need to force add it. The .gitignore needs some refinement. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about this. We already have --list-params-changes, which can be used with snakemake -R $(snakemake --list-params-changes)
. Is this PR to add more convenience?
Ok. I've force added the test folder. This option is about convenience, but not only that. |
Actually not, -R only forces the given files, the rest of the workflow is executed as well if necessary. Nevertheless, I agree that it might be a reasonable functionality for convenience, for some even a good default. |
Still needs formatting with black. |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've thought about this further, and I think we should change this into a flag --rerun-changed
, which would include apart from params also input file changes and code changes (using the code that is already there for --list-code-changes and --list-input-changes). Would you like to modify this accordingly?
Sounds good to me and yes, I can do that but will need some time. |
I would like to join this discussion to suggest the follwing. I used extensively other workflow managers in the past and I started using snakemake recently. I miss that snakemake triggers rules when inputs, code or parameters change, so I believe this pull request is certainly very useful for me. I agree with '--rerun-params-changed' and '--rerun-changed' as they would be very welcome additions. I often make changes to existing workflows and I would like to rely on snakemake to detect these changes and ensure that the outputs are up-to-date. However, once in a while, I make some changes which I know are inconsequential, or for some other reason I do not want to recompute all the dependencies of those changes. Assuming that a flag named '--rerun-changes' implies actually running the rules, I believe a flag '--trigger-changed' (also possible '--trigger-params-changed') would be more generally useful. Such a flag would simply modify the decision algorithm to trigger rules whose inputs/params/code changed. Consider the following case which I find myself often, It is possible that what I propose is exactly what was meant with '--rerun-changes', and in that case I simply propose a semantic (different name) change to '--trigger-changes' which does not imply running any rules. Thanks for the great work. |
Hi @pmginacio, thanks for your comment. My intention is to solve the exact problem you are describing -- good to hear that others are facing this too. If I understand you correctly, a lot of what you are describing is already possible today. What's missing right now is the possibility to always rerun rules with params/code/input changes, and that's what this PR is for. Is my assumption correct? Would this be of help for you? |
@pmginacio we are indeed all on the same page. I get your point about the trigger naming. However, Snakemake has other rerun-* parameters that work exactly as you describe in combination with dryrun or touch, so I think naming it rerun-* should be fine (as a dryrun e.g. is also a run in Snakemake world, just not one that actually runs the executable code of the rules). We could of course rename all of these parameters, but that would be an unnecessary breaking change in the interface that I'd like to avoid. Hence, I'd rather stick with the current naming scheme for consististency. |
@timtroendle glad to hear from you. Your assumption is correct, I find it useful to have a flag that always triggers rules for changes in params/code/input @johanneskoester I agree, better to be consistent. Thank you for your feedback, keep up the good work. |
I have now started to work on this, and actually decided to make these reruns the default. Using --touch, one always has a way to force ignoring such triggers. Hence, closing this in favor of #1663. |
Thanks a lot for your help here and the initial work! |
I am glad to hear that. Sorry for never finding the time to finish this. I am looking forward to testing this. |
Description
This command line options allows to automatically rerun all rules for which parameters have changed.
Fixes #976.
QC
docs/
) is updated to reflect the changes or this is not necessary (e.g. if the change does neither modify the language nor the behavior or functionalities of Snakemake).