Open PythonFZ opened 3 years ago
I think it looks great. Is it possible to put a spawn=True into the decorator? That way it defines the type of the node in the node declaration. It could also maybe check that the iterator exists or something I am not sure.
I think it looks great. Is it possible to put a spawn=True into the decorator? That way it defines the type of the node in the node declaration. It could also maybe check that the iterator exists or something I am not sure.
Yes, it would be absolutely possible. It would be more of a check, because the definition itself would come from the zn.iterable
definition. Therefore, it would be a little bit redundant, but I agree that if it is desired the decorator would be the better place compared to the __init__
For subgraphs as shown in the Following I suggest an API like this:
this will create the following Nodes:
The
iterator
can be anything from tuples to generators. Also if you have twozn.iterable
it would iterate over all possible combinations.One major downside of this method is that it can probably not run them in parallel! So we should still consider having a sub-git or similar to run them in parallel on e.g. a cluster.
A pool node on the other hand will be a classic Node that has a SpawnNode as a dependency