Enhancement Idea seeds #53
Replies: 1 comment
-
name-based connectionFor example, a
This kind of approach has echoes in domain-driven design (see this comment about that). Such an approach enables the developer, or the no-code user, to quickly and correctly create "programs" by selecting the components that self-organize. This list, This mapping could be done with def name_of_out_var_node(first_source_var_node, second_source_var_node):
return actual_underlying_function(second_source_var_node, y=first_source_var_node) # note how argument binding is done here In the more general Moreover, we can use similar approaches for Note that what has been discussed here, based on naming conventions, can also be done (with some differences) with typing. |
Beta Was this translation helpful? Give feedback.
-
DAG Factories
Make func_nodes (i.e. dag) factory to allow the user to use (or make) ways to efficiently
express how names and therefore connections should be made.
Connection using type annotations
A function providing
Featurizer
as an output can connect to (i.e. feed) functions that takeFeaturizer
s as inputsstructure through nested lists
[..., [a, b, c],...]
meaning we wanta -> b -> c
from python code
Make a
graphviz.Digraph
object based on code (string or function's body)from a set name-consistent functions
Moved to name-based connection
ch_names
Method to change the names (roots, inner, leafs, funcs)
order
Method to make order compliant with some given order-determining list.
Ordering roots and leafs should make inputs and outputs as wished, but doesn't
carry on to sub-DAGs. Do we need more control on topological sort?
request-triggered data access
obj.prop
asksobj._dag
for the sub-dag to computesaid prop and if a maintained
obj._scope
(the cache) contains sufficient data,it computes it (and caches it) with minimum computional path.
Basically the pattern I often use lazyprop for.
code_to_dag
(Enable code_to_dag to use wrapped function signature for the dag signature it produces)[https://github.com//issues/37]
Parse
return
(&yield
?) statementsThis can be used to post-process the DAG's output nodes, returning only some of the values, in a tuple, or a
dict
or something else.Further, it's natural for a function to have a return statement, so parsing it would help make
code_to_dag
more natural.Allow code to not have an assignee
Some functions are called for side effects only (store something, or forward to viz, etc.). It's a shame to have to have a return value.
Now, the thing with this is that a
DAG
, which is just a set ofFuncNode
s, will necessarily have anout
, so it will store the output of the function anyway (which will probably just be aNone
). We probably don't want to have to change that simplicity.Beta Was this translation helpful? Give feedback.
All reactions