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
fc5f379c
Commit
fc5f379c
authored
Apr 16, 2016
by
Tiago Peixoto
Browse files
Fix bug in BlockState.{remove/add}_vertex()
parent
9cc5cb2f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/graph_tool/inference/blockmodel.py
View file @
fc5f379c
...
...
@@ -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
:
...
...
Write
Preview
Markdown
is supported
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