Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow python expressions in --set-resources (#2521)
### Description <!--Add a description of your PR here--> ### QC <!-- Make sure that you can tick the boxes below. --> * [ ] The PR contains a test case for the changes or the changes are already covered by an existing test case. * [ ] The documentation (`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). --------- Co-authored-by: David Laehnemann <david.laehnemann@hhu.de>
- Loading branch information
1 parent
7864a76
commit 022a31e
Showing
10 changed files
with
163 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
rule: | ||
shell: | ||
"python -m snakemake --cores 1 --profile . -s Snakefile.internal" | ||
"python -m snakemake --cores 3 --profile . -s Snakefile.internal" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
shell.executable("bash") | ||
|
||
rule a: | ||
input: | ||
"input.txt", | ||
output: | ||
config["out"] | ||
config["out"], | ||
shell: | ||
"touch {output}" | ||
'echo "' | ||
'threads: {threads}\n' | ||
'mem_mb: {resources.mem_mb}\n' | ||
'eggs_factor: {resources.eggs_factor}\n' | ||
'spam_factor: {resources.spam_factor}\n' | ||
'double_jeopardy: {resources.double_jeopardy}' | ||
'"> {output}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,13 @@ | ||
configfile: "workflow-config.yaml" | ||
cores: all | ||
set-threads: | ||
- a=2 | ||
- a=max(1024*24*input.size_mb, 2) | ||
- b=4 | ||
default-resources: | ||
- mem_mb=max(1024*32*input.size_mb, 5) | ||
- eggs_factor=twitter | ||
set-resources: | ||
a: | ||
mem_mb: max(1024*24*input.size_mb, 1) | ||
spam_factor: X | ||
double_jeopardy: attempt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
threads: 2 | ||
mem_mb: 1 | ||
eggs_factor: twitter | ||
spam_factor: X | ||
double_jeopardy: 1 |
Empty file.