
report: "report/workflow.rst"


rule all:
    input:
        ["fig1.svg", "fig2.png", "test.csv"]


rule c:
    output:
        "test.{i}.out"
    singularity:
        "docker://continuumio/miniconda3:4.4.10"
    conda:
        "envs/test.yaml"
    shell:
        "sleep `shuf -i 1-3 -n 1`; touch {output}"


rule a:
    input:
        expand("test.{i}.out", i=range(10))
    output:
        report("fig1.svg", caption="report/fig1.rst", category="Step 1")
    shell:
        "sleep `shuf -i 1-3 -n 1`; cp data/fig1.svg {output}"


rule b:
    input:
        expand("test.{i}.out", i=range(10))
    output:
        report("fig2.png", caption="report/fig2.rst", category="Step 2")
    shell:
        "sleep `shuf -i 1-3 -n 1`; cp data/fig2.png {output}"


rule d:
    output:
        report("test.csv", caption="report/table.rst")
    shell:
        "curl http://samplecsvs.s3.amazonaws.com/Sacramentorealestatetransactions.csv > {output}"
