DAG.partial had a (not implemented) _roll_in_orphaned_nodes arguments described as such:
When True, actually change the DAG so it only contains the nodes it "needs": that is, recursively remove func-nodes (and their output nodes) if their inputs are fixed.
This argument was removed because it was not clear what it should mean or how useful it would be at this juncture.
This issue is to keep track of the thinking around this. This also fits in the general thinking about what we'd like to have as far as DAG (or other meshed data structures) operations.
In the case of rolling in nodes (which is also related to expanding nodes that are DAGs), here are some considerations:
What more do we mean the simply removing nodes (and with them, the edges attached to them) from the underlying graph?
Say we have a node representing f(a=1, b=2): we may not want to have a and b show up in the signature, or the graphviz display, but what do we do with the value it should compute? We could compute the function, then store the result in the out node, to then be used as the default of the functions that use it. Maybe recursively doing the same with those functions.
One problem with that can arise if f is not deterministic, the resulting DAG won't be the same as our "rolled in" DAG, but this simplification and caching mechanism can still be useful in many contexts. It should be requested explicitly though.
DAG.partialhad a (not implemented)_roll_in_orphaned_nodesarguments described as such:When True, actually change the DAG so it only contains the nodes it "needs": that is, recursively remove func-nodes (and their output nodes) if their inputs are fixed.
This argument was removed because it was not clear what it should mean or how useful it would be at this juncture.
This issue is to keep track of the thinking around this. This also fits in the general thinking about what we'd like to have as far as
DAG(or other meshed data structures) operations.In the case of rolling in nodes (which is also related to expanding nodes that are DAGs), here are some considerations:
What more do we mean the simply removing nodes (and with them, the edges attached to them) from the underlying graph?
Say we have a node representing
f(a=1, b=2): we may not want to have a and b show up in the signature, or the graphviz display, but what do we do with the value it should compute? We could compute the function, then store the result in the out node, to then be used as the default of the functions that use it. Maybe recursively doing the same with those functions.One problem with that can arise if
fis not deterministic, the resulting DAG won't be the same as our "rolled in" DAG, but this simplification and caching mechanism can still be useful in many contexts. It should be requested explicitly though.