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
d3411dcf
Commit
d3411dcf
authored
Aug 01, 2015
by
Tiago Peixoto
Browse files
(overlap_)blockmodel.py: Convert clabel to "int" type
parent
ab0da1a4
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/graph_tool/community/blockmodel.py
View file @
d3411dcf
...
...
@@ -181,7 +181,7 @@ class BlockState(object):
if
clabel
is
not
None
:
if
isinstance
(
clabel
,
PropertyMap
):
self
.
clabel
=
self
.
g
.
own_property
(
clabel
.
copy
())
self
.
clabel
=
self
.
g
.
own_property
(
clabel
.
copy
(
"int"
))
else
:
self
.
clabel
=
self
.
g
.
new_vertex_property
(
"int"
)
self
.
clabel
.
a
=
clabel
...
...
src/graph_tool/community/overlap_blockmodel.py
View file @
d3411dcf
...
...
@@ -206,7 +206,7 @@ class OverlapBlockState(BlockState):
if
_bm_test
():
assert
len
(
clabel
.
a
)
<
self
.
g
.
num_vertices
()
self
.
clabel
=
self
.
node_index
.
copy
()
pmap
(
self
.
clabel
,
clabel
)
pmap
(
self
.
clabel
,
clabel
.
copy
(
"int"
)
)
else
:
# if clabel is an array, we will assume it constraints the *half-edges*
self
.
clabel
=
self
.
g
.
new_vertex_property
(
"int"
)
...
...
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