(self)
Commit all nodes and edges to the networkx graph object.
Commit all nodes and edges to the networkx graph object.
Commit all nodes and edges to the networkx graph object .
def commit(self):
        """Commit all nodes and edges to the networkx graph object."""
        for node_id, node in self._nodes.items():
            self.nx_instance.add_node(
                node_id, label=node.label, **node.attributes)

        for _, edge in self._edges.items():
            label = edge.label + f' ({edge.node_counter})'
            self.nx_instance.add_edge(
                edge.source.id, edge.target.id, label=label,
                **edge.attributes)
def commit ( self ) : for node_id , node in self . _nodes . items ( ) : self . nx_instance . add_node ( node_id , label = node . label , * * node . attributes ) for _ , edge in self . _edges . items ( ) : label = edge . label + f' ({edge.node_counter})' self . nx_instance . add_edge ( edge . source . id , edge . target . id , label = label , * * edge . attributes )