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
18b833e2
Commit
18b833e2
authored
Dec 22, 2016
by
Tiago Peixoto
Browse files
blockmodel.py: Fix get_block_state() with recs
parent
351e646b
Changes
1
Show whitespace changes
Inline
Side-by-side
src/graph_tool/inference/blockmodel.py
View file @
18b833e2
...
...
@@ -606,6 +606,8 @@ class BlockState(object):
eweight
=
self
.
mrs
if
self
.
g
.
get_vertex_filter
()[
0
]
is
not
None
:
bg
=
GraphView
(
bg
,
vfilt
=
numpy
.
ones
(
bg
.
num_vertices
()))
recs
=
False
if
vweight
==
"nonempty"
:
vweight
=
bg
.
new_vp
(
"int"
,
self
.
wr
.
a
>
0
)
elif
vweight
==
"unity"
:
...
...
@@ -615,6 +617,7 @@ class BlockState(object):
vweight
=
bg
.
own_property
(
self
.
wr
.
copy
())
else
:
vweight
=
self
.
wr
recs
=
True
else
:
vweight
=
None
state
=
BlockState
(
bg
,
...
...
@@ -626,16 +629,14 @@ class BlockState(object):
self
.
allow_empty
),
degs
=
degs
,
rec_types
=
kwargs
.
pop
(
"rec_types"
,
self
.
rec_types
if
vweight
else
[]),
self
.
rec_types
if
recs
else
[]),
recs
=
kwargs
.
pop
(
"recs"
,
ungroup_vector_property
(
bg
.
ep
.
rec
,
range
(
len
(
self
.
rec_types
)))
if
(
vweight
is
not
None
and
len
(
self
.
rec_types
)
>
0
)
if
(
recs
and
len
(
self
.
rec_types
)
>
0
)
else
[]),
drec
=
kwargs
.
pop
(
"drec"
,
bg
.
ep
.
drec
if
(
vweight
is
not
None
and
len
(
self
.
rec_types
)
>
0
)
bg
.
ep
.
drec
if
(
recs
and
len
(
self
.
rec_types
)
>
0
)
else
None
),
rec_params
=
kwargs
.
pop
(
"rec_params"
,
self
.
rec_params
),
ignore_degrees
=
kwargs
.
pop
(
"ignore_degrees"
,
...
...
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