Skip to content

CacheDag: Ability to make methods for desired target outs #36

Description

@thorwhalen

The current CacheDag.__call__ is just the backend.
For more convenience, we'd can add methods for all, or selected targeted values.

Consider the CachedDag below.

def add(a, b=1):
    return a + b

def mult(x, y=2):
    return x * y

def subtract(a, b=4):
    return a - b

from meshed import code_to_dag

@code_to_dag(func_src=locals())
def dag(w, ww, www):
    x = mult(w, ww)
    y = add(x, www)
    z = subtract(x, y)

from meshed.scrap.cached_dag import CachedDag

g = CachedDag(dag)
dag.dot_digraph()

image

We'd like to have methods like g.mult with a signature corresponding to the root nodes it needs to satisfy it's inputs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions