-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFE: enhancements for the future of the project #1
Comments
As far as colors go, I was actually thinking about this, what if it were possible to attach arbitrary metadata to nodes and pass a predicate function which looks at the metadata and returns true or false which tells you whether to evaluate the node or not? |
I agree, this is a flexible solution, a superset of "colors", since it is more "dynamic" - it can decide the nodes to consider after the DAG has formed. Implementation wise, the Finally we need the metadata to be in the DAG - A remark on performance, |
e.g. assign "colors" to nodes, and solve a subset each time.
e.g. assign "colors" to nodes, and solve a subset each time.
@syamajala the just released 4.0.0 supports node-attributes and and a |
Are there any plans to implement control flow nodes? Things like If, ElseIf, Else, and maybe For? |
I had thought that initially, and had precluded it, because of all the complication such a UX would imply, to drive conditional logic in the DAG level. Specifically, if some function wants to cancel its downstream execution, or produce a subset of its outputs (and implement if-then-else logic), can do that with endured operations or partial outputs. A reschedule point kicks-in after such operations. I cannot think of a way to workaround also for-loops with the same machinery, because of the following architectural reasons:
|
Based on what you said I have some vague idea of how to do something like this outside of graphtik. Note: I havent tried this out yet. What you do is have some higher level functions/nodes.
What graph_composer would do then is walk the list of nodes and return an operation that looks something like this:
You could probably clean this up by generating a class that holds the graphs as attributes and implements the if1 function as I think instead of For what I would really like is a Map where maybe what it does is loop over lists and just applies the subgraph to each entry.
It would work in a similar method. Also I should say my use case for something like this is that I provide users with libraries of operations and they build the graph themselves, so putting the logic inside of the operation itself is not really feasible for me because I dont know the conditions they want to evaluate on. |
If you auto-generate a function that def if1(val, a, b):
if val > 10:
return {"if1_if"': True}
elif val == 10:
return {"if1_elif"': True}
else:
return {"if1_else"': True}
operation(if1,
needs="val",
provides=["if1_if", "if1_elif", "if1_else"],
returns_dict=True) The You also need to auto-generate 3 branch-operations downstream, each one receiving one of the 3 dependencies provided above Does that makes sense? |
(Cloned from yahoo#22)
Collecting here enhancements that would nice to have on this project going forward:
Language & Build
logging
module instead ofprint()
base
&functional
.2. Functionality
Operation
, clean up API(e.g.
FunctionalOperation.compute()
raises not impl, and network using private_compute()
instead).networkx
and not in classesnetworkx.DiGraph
._DataNode
.contextvars
(now uses the one from
Network
).*args
(non-kwarg optionals)**kwargs
(to receive the whole solution).netop.compute()
/netop.__call__()
toFunctionalOperation
: onlycompute()
should accept inputs dict,__call__()
should accept**kwargs
.3. diagrams:
basalt
: https://www.anishathalye.com/2019/12/12/constraint-based-graphic-design/g9.js
: http://omrelli.ug/g9/#installationvis.js
: https://visjs.github.io/vis-network/examples/The text was updated successfully, but these errors were encountered: