Open Onandon11 opened 4 years ago
Interesting suggestion! I think it somewhat relates to https://github.com/PaulSchweizer/flowpipe/issues/139 - both issues could be solved easily by transitioning from a batch-processing approach towards a streaming architecture. Still, the option of having nodes iterate over inputs could already allow flowpipe to fulfill many purposes that, for now, it couldn't.
This looks very interesting, thanks for the elaborate example @Onandon11 ! I'd be happy to see this implemented. @neuneck, switching to a streaming architecture is a bit more invovled, but as you say this addition might already fulfil a lot of purposes for now
Great :D Shall I make a PR and try to cleanup the example to implement it?
Yes, that would be great, thanks @Onandon11
Is your feature request related to a problem? Please describe. In our library we have to call a specific subgraph quite frequently (for example 100+ times). Currently you either the following options to achieve this:
print(graph)
print(graph)
and draws a lot of lines.Describe the solution you'd like I have in mind that in
Node.evaluate
a check is done if there are inputs that should be iterated over. If so, the node is calling itself that many times. The output of the node is then an iterable and the next node should notice that just like the previous did. For proof-of-principle I subclassed theFunctionNode
and created the following (ps.: This is far from prefect but it's as an example).Now you can write the following and it iterates without making more connections or nodes.
Please let me know what you guys think of this feature 😄 !!