Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tiago Peixoto
graph-tool
Commits
fa2b7b99
Commit
fa2b7b99
authored
Mar 11, 2012
by
Tiago Peixoto
Browse files
Simplify internal filtering composition rules for GraphView
parent
479daa91
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/graph_tool/__init__.py
View file @
fa2b7b99
...
...
@@ -1838,11 +1838,8 @@ class GraphView(Graph):
else
:
vmap
=
self
.
new_vertex_property
(
"bool"
)
if
issubclass
(
type
(
vfilt
),
numpy
.
ndarray
):
vmap
.
a
=
vfilt
vmap
.
f
a
=
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
):
v
map
.
a
=
efilt
e
map
.
f
a
=
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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment