# Test workflow with params that depend on wildcards
# Tests: params extraction, wildcard-dependent parameters

SAMPLE_CONFIG = {
    "A": {"threads": 2, "memory": "1G"},
    "B": {"threads": 4, "memory": "2G"},
    "C": {"threads": 1, "memory": "512M"},
}

rule all:
    input: expand("output/{sample}.done", sample=SAMPLE_CONFIG.keys())

rule process:
    output: "output/{sample}.done"
    params:
        sample_threads=lambda wc: SAMPLE_CONFIG[wc.sample]["threads"],
        sample_memory=lambda wc: SAMPLE_CONFIG[wc.sample]["memory"]
    shell:
        """
        echo 'Sample: {wildcards.sample}' > {output}
        echo 'Threads: {params.sample_threads}' >> {output}
        echo 'Memory: {params.sample_memory}' >> {output}
        """
