Node name is badly handled
A workaround has been used to give a unique name to every node inside of a GraphView but it is not very good.
Current algorithm:
- Create a GraphView that contains every node in the graph (even nodes inside of MetaOperators)
- Generate unique name using the method
GraphView.get_ranked_nodes_name()
. - Rename every node
This is flawed because it will rename nodes that already have a name. But I don't see a better way because name of operators inside a MetaOperator may not be unique ... Which means I am not guaranteed that keeping the name if it exist is a good solution.
📝 Note: It is also the reason why before renaming I need to remove the nodes from the global GraphView because renaming a node that has a not unique name raise a sanity error.
The second reason why it is flawed is that model explorer allow to open two graphs and navigate them synchronously given that they have the same node id. (This is the reason why I wanted to keep the information fo the id with the name because a change in the topology of the graph will not change the id). But because my algorithm always rename nodes I never have a correspondance between id when doing two calls...