flaxandteal / dewret

DEclarative Workflow REndering Tool
Apache License 2.0
2 stars 0 forks source link

Sympy objects in nested_tasks #16

Open elleryames opened 5 months ago

elleryames commented 5 months ago

Currently arbitrary python objects cannot be referenced within nested_tasks, since the logic of the nested task gets evaluated and embedded in the workflow. However, it would be desirable to loosen this restriction somewhat. One idea is to make use of sympy, such that the object to be referenced in the nested task can be expressed in sympy, then dewret can represent represent it in the workflow.

Yes - good point. I'm tempted to write that once I have the sympy functionality working, so we can say "if you can write it with sympy it's gtg" or something like that. (although agree if that's not right now, then it should be noted regardless)

_Originally posted by @philtweir in https://github.com/flaxandteal/dewret/pull/15#discussion_r1573040329_

philtweir commented 5 months ago

Action points:

philtweir commented 5 months ago

Working through this, it might be sufficient - if not very elegant - to leave this up to the backend. I have PoC'd using dask to extract the subgraph corresponding to arithmetic/dask.array operations, where the other steps are dependencies. This would give us as much flexibility as dask.delayed has but with (at least) two major caveats: