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
40c76afc
Commit
40c76afc
authored
Mar 12, 2018
by
Tiago Peixoto
Browse files
Fix docstrings
parent
41dc36a4
Pipeline
#403
passed with stage
in 365 minutes and 40 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/graph_tool/__init__.py
View file @
40c76afc
...
...
@@ -1186,7 +1186,7 @@ def edge_endpoint_property(g, prop, endpoint, eprop=None):
>>> g = gt.random_graph(100, lambda: (3, 3))
>>> esource = gt.edge_endpoint_property(g, g.vertex_index, "source")
>>> print(esource.a)
[ 0 0 0 96 96 96 92 92 92 88 88 88 84 84 84 80 80 80 76 76 76 72 72 72
[ 0 0 0 96 96 96 92 92 92 88 88 88 84 84 84 80 80 80 76 76 76 72 72 72
68 68 68 64 64 64 60 60 60 56 56 56 52 52 52 48 48 48 44 44 44 40 40 40
36 36 36 32 32 32 28 28 28 24 24 24 20 20 20 16 16 16 12 12 12 8 8 8
4 4 4 99 99 99 1 1 1 2 2 2 3 3 3 5 5 5 6 6 6 7 7 7
...
...
src/graph_tool/inference/blockmodel.py
View file @
40c76afc
...
...
@@ -2056,10 +2056,10 @@ class BlockState(object):
>>> state.mcmc_sweep(niter=1000) # remove part of the transient
(...)
>>> for i in range(1000):
... state.mcmc_sweep(niter=10)
...
ret =
state.mcmc_sweep(niter=10)
... pe = state.collect_edge_marginals(pe)
>>> gt.bethe_entropy(g, pe)[0]
-
21.162075
...
-
0.901611
...
"""
if
p
is
None
:
...
...
@@ -2110,10 +2110,10 @@ class BlockState(object):
>>> state.mcmc_sweep(niter=1000) # remove part of the transient
(...)
>>> for i in range(1000):
... state.mcmc_sweep(niter=10)
...
ret =
state.mcmc_sweep(niter=10)
... pv = state.collect_vertex_marginals(pv)
>>> gt.mf_entropy(g, pv)
7.578883
...
26.887021
...
>>> gt.graph_draw(g, pos=g.vp["pos"], vertex_shape="pie",
... vertex_pie_fractions=pv, output="polbooks_blocks_soft_B4.pdf")
<...>
...
...
@@ -2176,10 +2176,10 @@ class BlockState(object):
>>> state.mcmc_sweep(niter=1000) # remove part of the transient
(...)
>>> for i in range(1000):
... state.mcmc_sweep(niter=10)
...
ret =
state.mcmc_sweep(niter=10)
... ph = state.collect_partition_histogram(ph)
>>> gt.microstate_entropy(ph)
1
46.181674
...
1
29.330077
...
"""
if
h
is
None
:
...
...
src/graph_tool/topology/__init__.py
View file @
40c76afc
...
...
@@ -1230,18 +1230,18 @@ def label_biconnected_components(g, eprop=None, vprop=None):
>>> g = gt.random_graph(100, lambda: poisson(2), directed=False)
>>> comp, art, hist = gt.label_biconnected_components(g)
>>> print(comp.a)
[26 26 26 26 26 26 26 26 19 25 26 26 23 26 26 26 26 6 26 24 18 26 26 13
26
26 26 26 26 26 26 26 26 26 26 16 29 26 26 26 26 26 26 15 26 26 26 26
26 0
26 26 12 2 26 26 26 26 26 26 26 26 9 3 26 28 26 26 8 26 4 26
26 26 14
26 26 26 26 30 11 26 26 26 20 26 26 27 26 33 26 22 17 7 5 32
21 26 1 10
31]
[26 26 26 26 26 26 26 26 19 25 26 26 23 26 26 26 26 6 26 24 18 26 26 13
26 26 26 26 26 26 26 26 26 26
26
16 29 26 26 26 26 26 26 15 26 26 26 26
26
0 26
26 12 2 26 26 26 26 26 26 26 26 9 3 26 28 26 26 8 26 4 26
26 26
14 26 26
26 26 30 11 26 26 26 20 26 26 27 26 33 26 22 17 7 5 32
21 26 1 10
31]
>>> print(art.a)
[1 0 1 1 0 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 1 0
1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0
1 0 0 1 0 0 0 1 1 0 0 1 0 0 1 1 0 0 0 1 0 0 1 0 0 0]
>>> print(hist)
[ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1
1 68 1 1 1 1 1 1 1]
[ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1
1
68 1 1 1 1 1 1 1]
"""
...
...
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