Commit fc5f379c authored by Tiago Peixoto's avatar Tiago Peixoto

Fix bug in BlockState.{remove/add}_vertex()

parent 9cc5cb2f
......@@ -628,6 +628,8 @@ class BlockState(object):
twice.
"""
if isinstance(v, collections.Iterable):
if not isinstance(v, numpy.ndarray):
v = list(v)
self._state.remove_vertices(numpy.asarray(v, dtype="uint64"))
else:
self._state.remove_vertex(int(v))
......@@ -643,6 +645,10 @@ class BlockState(object):
added twice to the same group.
"""
if isinstance(v, collections.Iterable):
if not isinstance(v, numpy.ndarray):
v = list(v)
if not isinstance(r, numpy.ndarray):
r = list(r)
self._state.add_vertices(numpy.asarray(v, dtype="uint64"),
numpy.asarray(r, dtype="uint64"))
else:
......
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