Observation.remove#

Observation.remove() → None#

Remove this edge from its graph

Raises:

ValueError – the edge is not connected to a graph

e.remove() removes e from its graph’s own edge collection and from its connected vertices’ edge lists (both, for an undirected edge; the source only, for a directed one – see Graph.remove_edge), and clears e.v1/e.v2 to None. The Edge object itself is not deleted – it becomes an orphaned, disconnected shell, and calling remove() on it again raises ValueError.

Note

This is a thin convenience wrapper around Graph.remove_edge.

Return type:

None

>>> from pgraph import UGraph
>>> g = UGraph()
>>> v1 = g.add_vertex(coord=[0,0], name='v1')
>>> v2 = g.add_vertex(coord=[1,1], name='v2')
>>> e = g.add_edge(v1, v2)
>>> e.remove()
>>> print(g)
UGraph: 2 vertices, 0 edges, 2 components
Seealso:

Graph.remove_edge Vertex.remove