Skip to content

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

@thorwhalen

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions