Commit fa2b7b99 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Simplify internal filtering composition rules for GraphView

parent 479daa91
......@@ -1838,11 +1838,8 @@ class GraphView(Graph):
else:
vmap = self.new_vertex_property("bool")
if issubclass(type(vfilt), numpy.ndarray):
vmap.a = vfilt
vmap.fa = vfilt
else:
omap, inv = g.get_vertex_filter()
if omap is not None:
vmap.a = omap.a if not inv else omap.a ^ 1
for v in g.vertices():
vmap[v] = vfilt(v)
self.set_vertex_filter(vmap)
......@@ -1853,11 +1850,8 @@ class GraphView(Graph):
else:
emap = self.new_edge_property("bool")
if issubclass(type(efilt), numpy.ndarray):
vmap.a = efilt
emap.fa = efilt
else:
omap, inv = g.get_edge_filter()
if omap is not None:
emap.a = omap.a if not inv else omap.a ^ 1
for e in g.edges():
emap[e] = efilt(e)
self.set_edge_filter(emap)
......
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