Open dlcole3 opened 8 months ago
This may be a good reason to maintain a reference from optinodes to each of their containing optigraphs. The original design of Plasmo.jl actually did this, but we opted to make nodes more modular at the time. This will be added to the roadmap in the re-write.
I have found that adding to a subgraph does not necessarily update the overall graph's backend. For example, the code below throws an error because the first
incident_edges
call sets the backend of the graph, and then when the second node is added, the backend on graphg0
is not updated. When Plasmo runs the second call ofincident_edges
, it does not have theextra_node
in its hypermap.This does make sense since there is no mapping to go from the subgraph to its "owning" graph (only to go from the "owning" graph to the subgraph), so there is no way for the upper graph to know to update its backend. Currently, I get around this in my code by forcing the upper graph to reset the backend by calling
Plasmo.set_graph_backend
, but if there is an efficient way to fix this in the future, it could be nice.