Is there any way to replace a node in a ComputeGraph?
Let’s say I want to replace an input node with a computed value, but I do not want to delete all the dependent nodes and recreate them.
No not really and there likely wont be.
Btw, using ComputeGraph outside plot.attributes isn’t totally recommended, since we’re not entirely sure in which direction the compute graph will go and how to manage its life cycle outside of plot recipes.
Best only do it when you have a strong reason for it.
and I want the axisnames (labels for each axis) to depend on something.
I am able to access this as an Observable using
p.attributes.inputs[:names].value.axisnames
and by modifying that (e.g. using connect!), I can achieve what I want right now.
So maybe my question is more about the long term relationship between Observables and ComputeGraph. My impression (perhaps incorrectly) was that in the long run, we should prefer to remove Observables and implement as much as possible using the ComputeGraph directly - to avoid e.g. problems with updates that need to be synchronous.
And if later, axisnames is implemented with Observables, I wouldn’t be able to make it depend on something computed - without replacing the node in the compute graph.