Monday, 16 September 2019

Passing Values Between Rules

Cited from I want to pass variables between rules. Is that possible?

from pytools.persistent_dict import PersistentDict

storage = PersistentDict("mystorage")

rule a:
    input: "test.in"
    output: "test.out"
    run:
        myvar = storage.fetch("myvar")
        # do stuff

rule b:
    output: temp("test.in")
    run:
        storage.store("myvar", 3.14)

No comments:

Post a Comment