MCPcopy Create free account
hub / github.com/alibaba/GraphScope / clear_edges

Method clear_edges

python/graphscope/nx/classes/graph.py:1542–1557  ·  view source on GitHub ↗

Remove all edges from the graph without altering nodes. Examples -------- >>> G = nx.path_graph(4) # or DiGraph >>> G.clear_edges() >>> list(G.nodes) [0, 1, 2, 3] >>> list(G.edges) []

(self)

Source from the content-addressed store, hash-verified

1540
1541 @clear_mutation_cache
1542 def clear_edges(self):
1543 """Remove all edges from the graph without altering nodes.
1544
1545 Examples
1546 --------
1547 >>> G = nx.path_graph(4) # or DiGraph
1548 >>> G.clear_edges()
1549 >>> list(G.nodes)
1550 [0, 1, 2, 3]
1551 >>> list(G.edges)
1552 []
1553 """
1554 self._convert_arrow_to_dynamic()
1555 self._op = dag_utils.clear_edges(self)
1556 self._op.eval(leaf=False)
1557 self.cache.clear()
1558
1559 @patch_docstring(RefGraph.is_directed)
1560 def is_directed(self):

Callers 1

ClearEdgesMethod · 0.80

Calls 3

clearMethod · 0.65
evalMethod · 0.45

Tested by

no test coverage detected