Skip to content

Commit 0325940

Browse files
committed
Dynamic delay for gif animations
1 parent 1e2b039 commit 0325940

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

workflow/rules/plot.smk

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def get_leadtimes(wc):
4848

4949

5050
rule make_forecast_animation:
51+
localrule: True
5152
input:
5253
expand(
5354
OUT_ROOT
@@ -57,8 +58,9 @@ rule make_forecast_animation:
5758
),
5859
output:
5960
OUT_ROOT / "showcases/{run_id}/{init_time}/{init_time}_{param}_{region}.gif",
60-
localrule: True
61+
params:
62+
delay=lambda wc: int(10*RUN_CONFIGS[wc.run_id]["steps"].split("/")[2]),
6163
shell:
6264
"""
63-
convert -delay 10 -loop 0 {input} {output}
65+
convert -delay {params.delay} -loop 0 {input} {output}
6466
"""

0 commit comments

Comments
 (0)