MCPcopy Create free account
hub / github.com/easy-graph/Easy-Graph / _add_one_node

Method _add_one_node

easygraph/classes/directed_graph.py:638–647  ·  view source on GitHub ↗
(self, one_node_for_adding, node_attr: dict = {})

Source from the content-addressed store, hash-verified

636 self._node[n].update(newdict)
637
638 def _add_one_node(self, one_node_for_adding, node_attr: dict = {}):
639 node = one_node_for_adding
640 if node not in self._node:
641 self._adj[node] = self.adjlist_inner_dict_factory()
642 self._pred[node] = self.adjlist_inner_dict_factory()
643
644 attr_dict = self._node[node] = self.node_attr_dict_factory()
645 attr_dict.update(node_attr)
646 else: # If already exists, there is no complain and still updating the node attribute
647 self._node[node].update(node_attr)
648
649 def add_edge(self, u_of_edge, v_of_edge, **edge_attr):
650 """Add a directed edge.

Callers 3

add_nodeMethod · 0.95
add_nodesMethod · 0.95
_add_one_edgeMethod · 0.95

Calls 1

updateMethod · 0.80

Tested by

no test coverage detected