Skip to content
GitLab
Menu
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
c1d8a409
Commit
c1d8a409
authored
Dec 21, 2015
by
Tiago Peixoto
Browse files
Fix bug in find_vertex() with prop in ["in", "out", "total"]
This fixes issue
#258
.
parent
ce514489
Pipeline
#82
failed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/graph_tool/util/__init__.py
View file @
c1d8a409
...
...
@@ -51,7 +51,10 @@ def find_vertex(g, prop, match):
"""Find all vertices `v` for which `prop[v] = match`. The parameter prop
can be either a :class:`~graph_tool.PropertyMap` or string with value "in",
"out" or "total", representing a degree type."""
val
=
_converter
(
prop
.
value_type
())(
match
)
if
prop
in
[
"in"
,
"out"
,
"total"
]:
val
=
int
(
match
)
else
:
val
=
_converter
(
prop
.
value_type
())(
match
)
ret
=
libgraph_tool_util
.
\
find_vertex_range
(
g
.
_Graph__graph
,
_degree
(
g
,
prop
),
(
val
,
val
))
...
...
@@ -62,7 +65,10 @@ def find_vertex_range(g, prop, range):
"""Find all vertices `v` for which `range[0] <= prop[v] <= range[1]`. The
parameter prop can be either a :class:`~graph_tool.PropertyMap` or string
with value"in", "out" or "total", representing a degree type."""
convert
=
_converter
(
prop
.
value_type
())
if
prop
in
[
"in"
,
"out"
,
"total"
]:
convert
=
lambda
x
:
int
(
x
)
else
:
convert
=
_converter
(
prop
.
value_type
())
ret
=
libgraph_tool_util
.
\
find_vertex_range
(
g
.
_Graph__graph
,
_degree
(
g
,
prop
),
(
convert
(
range
[
0
]),
convert
(
range
[
1
])))
...
...
Tiago Peixoto
@count0
mentioned in issue
#258 (closed)
·
Dec 21, 2015
mentioned in issue
#258 (closed)
mentioned in issue #258
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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