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
d0bd7f48
Commit
d0bd7f48
authored
Apr 02, 2016
by
Tiago Peixoto
Browse files
More docstring test fixes
parent
53933d87
Pipeline
#129
failed with stage
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
d0bd7f48
...
...
@@ -5,7 +5,7 @@ job_gcc_386:
-
CCACHE_BASEDIR=$PWD make $MAKEOPTS
-
make install
-
export PYTHONPATH=$PWD/install/site-packages
-
cd doc; OMP_NUM_THREADS=1 python3 /usr/bin/sphinx-build -b doctest . build centrality.rst clustering.rst collection.rst
community
.rst correlations.rst draw.rst faq.rst flow.rst generation.rst graph_tool.rst gt_format.rst index.rst modules.rst quickstart.rst spectral.rst stats.rst topology.rst util.rst
-
cd doc; OMP_NUM_THREADS=1 python3 /usr/bin/sphinx-build -b doctest . build centrality.rst clustering.rst collection.rst
inference
.rst correlations.rst draw.rst faq.rst flow.rst generation.rst graph_tool.rst gt_format.rst index.rst modules.rst quickstart.rst spectral.rst stats.rst topology.rst util.rst
tags
:
-
i386
...
...
@@ -16,7 +16,7 @@ job_gcc_py2_386:
-
CCACHE_BASEDIR=$PWD make $MAKEOPTS
-
make install
-
export PYTHONPATH=$PWD/install/site-packages
-
cd doc; OMP_NUM_THREADS=1 python2 /usr/bin/sphinx-build -b doctest . build centrality.rst clustering.rst collection.rst
community
.rst correlations.rst draw.rst faq.rst flow.rst generation.rst graph_tool.rst gt_format.rst index.rst modules.rst quickstart.rst spectral.rst stats.rst topology.rst util.rst
-
cd doc; OMP_NUM_THREADS=1 python2 /usr/bin/sphinx-build -b doctest . build centrality.rst clustering.rst collection.rst
inference
.rst correlations.rst draw.rst faq.rst flow.rst generation.rst graph_tool.rst gt_format.rst index.rst modules.rst quickstart.rst spectral.rst stats.rst topology.rst util.rst
tags
:
-
i386
...
...
doc/test_inference.py
View file @
d0bd7f48
...
...
@@ -5,8 +5,9 @@ verbose=False
import
os
import
sys
if
not
verbose
:
f
=
open
(
os
.
devnull
,
'w'
)
sys
.
stdout
=
f
out
=
open
(
os
.
devnull
,
'w'
)
else
:
out
=
sys
.
stdout
from
graph_tool.all
import
*
import
numpy.random
...
...
@@ -45,26 +46,26 @@ for directed in [True, False]:
print
(
"
\n
directed:"
,
directed
,
"overlap:"
,
overlap
,
"layered:"
,
layered
,
"deg-corr:"
,
deg_corr
,
"dl:"
,
dl
,
file
=
sys
.
std
out
)
file
=
out
)
print
(
"
\t
mcmc (unweighted)"
,
file
=
sys
.
std
out
)
print
(
"
\t
mcmc (unweighted)"
,
file
=
out
)
state
=
gen_state
(
directed
,
deg_corr
,
layered
,
overlap
)
print
(
"
\t\t
"
,
state
.
mcmc_sweep
(
beta
=
0
,
allow_empty
=
True
,
entropy_args
=
dict
(
dl
=
dl
)),
(
state
.
wr
.
a
>
0
).
sum
())
(
state
.
wr
.
a
>
0
).
sum
()
,
file
=
out
)
if
overlap
:
print
(
"
\t\t
"
,
state
.
mcmc_sweep
(
beta
=
0
,
bundled
=
True
,
allow_empty
=
True
,
entropy_args
=
dict
(
dl
=
dl
)),
(
state
.
wr
.
a
>
0
).
sum
(),
file
=
sys
.
std
out
)
file
=
out
)
state
=
gen_state
(
directed
,
deg_corr
,
layered
,
overlap
)
if
not
overlap
:
print
(
"
\t
mcmc"
,
file
=
sys
.
std
out
)
print
(
"
\t
mcmc"
,
file
=
out
)
bstate
=
state
.
get_block_state
(
vweight
=
True
,
deg_corr
=
deg_corr
)
...
...
@@ -73,21 +74,21 @@ for directed in [True, False]:
allow_empty
=
True
,
entropy_args
=
dict
(
dl
=
dl
,
multigraph
=
False
)),
(
bstate
.
wr
.
a
>
0
).
sum
(),
file
=
sys
.
std
out
)
(
bstate
.
wr
.
a
>
0
).
sum
(),
file
=
out
)
print
(
"
\t\t
"
,
bstate
.
mcmc_sweep
(
beta
=
0
,
allow_empty
=
True
,
entropy_args
=
dict
(
dl
=
dl
,
multigraph
=
False
)),
(
bstate
.
wr
.
a
>
0
).
sum
())
(
bstate
.
wr
.
a
>
0
).
sum
()
,
file
=
out
)
print
(
"
\t\t
"
,
bstate
.
gibbs_sweep
(
beta
=
0
,
allow_empty
=
True
,
entropy_args
=
dict
(
dl
=
dl
,
multigraph
=
False
)),
(
bstate
.
wr
.
a
>
0
).
sum
(),
file
=
sys
.
std
out
)
(
bstate
.
wr
.
a
>
0
).
sum
(),
file
=
out
)
print
(
"
\t
merge"
,
file
=
sys
.
std
out
)
print
(
"
\t
merge"
,
file
=
out
)
state
=
gen_state
(
directed
,
deg_corr
,
layered
,
overlap
)
...
...
@@ -99,7 +100,7 @@ for directed in [True, False]:
bstate
.
merge_sweep
(
50
,
entropy_args
=
dict
(
dl
=
dl
,
multigraph
=
False
)),
file
=
sys
.
std
out
)
file
=
out
)
bstate
=
bstate
.
copy
()
...
...
@@ -107,32 +108,32 @@ for directed in [True, False]:
bstate
.
mcmc_sweep
(
beta
=
0
,
allow_empty
=
True
,
entropy_args
=
dict
(
dl
=
dl
,
multigraph
=
False
)),
file
=
sys
.
std
out
)
file
=
out
)
print
(
"
\t\t
"
,
bstate
.
gibbs_sweep
(
beta
=
0
,
allow_empty
=
True
,
entropy_args
=
dict
(
dl
=
dl
,
multigraph
=
False
)),
file
=
sys
.
std
out
)
file
=
out
)
else
:
print
(
"
\t\t
"
,
state
.
merge_sweep
(
50
,
entropy_args
=
dict
(
dl
=
dl
,
multigraph
=
False
)),
file
=
sys
.
std
out
)
file
=
out
)
print
(
"
\t
shrink"
,
file
=
sys
.
std
out
)
print
(
"
\t
shrink"
,
file
=
out
)
state
=
gen_state
(
directed
,
deg_corr
,
layered
,
overlap
)
state
=
state
.
shrink
(
B
=
5
,
entropy_args
=
dict
(
dl
=
dl
,
multigraph
=
False
))
print
(
"
\t\t
"
,
state
.
B
,
file
=
sys
.
std
out
)
print
(
"
\t\t
"
,
state
.
B
,
file
=
out
)
for
directed
in
[
True
,
False
]:
for
overlap
in
[
False
,
True
]:
for
layered
in
[
False
,
"covariates"
,
True
]:
for
deg_corr
in
[
False
,
True
]:
print
(
"
\n
directed:"
,
directed
,
"overlap:"
,
overlap
,
"layered:"
,
layered
,
"deg-corr:"
,
deg_corr
)
"layered:"
,
layered
,
"deg-corr:"
,
deg_corr
,
file
=
out
)
state
=
minimize_blockmodel_dl
(
GraphView
(
g
,
directed
=
directed
),
verbose
=
(
1
,
"
\t
"
)
if
verbose
else
False
,
...
...
@@ -141,7 +142,7 @@ for directed in [True, False]:
layers
=
layered
!=
False
,
state_args
=
dict
(
ec
=
ec
,
layers
=
(
layered
==
True
)))
print
(
state
.
B
,
state
.
entropy
(),
file
=
sys
.
std
out
)
print
(
state
.
B
,
state
.
entropy
(),
file
=
out
)
state
=
minimize_nested_blockmodel_dl
(
GraphView
(
g
,
directed
=
directed
),
verbose
=
(
1
,
"
\t
"
)
if
verbose
else
False
,
...
...
@@ -152,6 +153,6 @@ for directed in [True, False]:
layers
=
(
layered
==
True
)))
if
verbose
:
state
.
print_summary
()
print
(
state
.
entropy
(),
file
=
sys
.
std
out
)
print
(
state
.
entropy
(),
file
=
out
)
print
(
"OK"
)
\ No newline at end of file
src/graph_tool/generation/__init__.py
View file @
d0bd7f48
...
...
@@ -1695,6 +1695,7 @@ def condensation_graph(g, prop, vweight=None, eweight=None, avprops=None,
>>> # fit a SBM with 5 groups
>>> state = gt.BlockState(g, B=5, deg_corr=True)
>>> gt.mcmc_equilibrate(state, wait=1000)
<...>
>>> b = state.get_blocks()
>>> gt.graph_draw(g, pos=g.vp["pos"], vertex_fill_color=b, vertex_shape=b,
... output="polbooks_blocks_B5.pdf")
...
...
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