Commit cced576d authored by Ale Abdo's avatar Ale Abdo

remove_vertex(): for lists, fix duplicates and property map updates

parent ef74576c
......@@ -1984,15 +1984,16 @@ class Graph(object):
vs = numpy.asarray([int(v) for v in vertex], dtype="int64")
if len(vs) == 0:
vs = numpy.sort(vs)[::-1]
vmax = vs[0]
if vs[0] > back:
raise ValueError("Vertex index %d is invalid" % vs[0])
vs = numpy.unique(vs)[::-1]
vmax, vmin = vs[0], vs[-1]
vmax = int(vertex)
if vmax > back:
raise ValueError("Vertex index %d is invalid" % vmax)
# move / shift all known property maps
if vmax != back:
if (vmax-vmin >= len(vs) if is_iter else vmax != back):
if not is_iter:
vs = numpy.asarray((vertex,), dtype="int64")
vfilt = self.get_vertex_filter()[0]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment