Commit d9f7b784 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Trivial documentation fixes

parent b73b71e1
......@@ -44,7 +44,7 @@ Contents
from .. dl_import import dl_import
dl_import("import libgraph_tool_clustering as _gt")
from .. import _degree, _prop, Graph
from .. import _degree, _prop, Graph, GraphView
from .. topology import isomorphism
from .. generation import random_rewire
from .. stats import vertex_hist
......@@ -115,7 +115,7 @@ def local_clustering(g, prop=None, undirected=True):
>>> g = gt.random_graph(1000, lambda: (5,5))
>>> clust = gt.local_clustering(g)
>>> print gt.vertex_average(g, clust)
(0.0057683333333333336, 0.00048270786829210805)
(0.009394444444444445, 0.00045574247520250265)
References
----------
......@@ -172,7 +172,7 @@ def global_clustering(g):
>>> seed(42)
>>> g = gt.random_graph(1000, lambda: (5,5))
>>> print gt.global_clustering(g)
(0.0093894614473184149, 0.00045618573270753208)
(0.009389461447318415, 0.0004561857327075321)
References
----------
......@@ -181,7 +181,7 @@ def global_clustering(g):
:doi:`10.1137/S003614450342480`
"""
c =_gt.global_clustering(g._Graph__graph)
c = _gt.global_clustering(g._Graph__graph)
return c
......@@ -247,11 +247,11 @@ def extended_clustering(g, props=None, max_depth=3, undirected=False):
>>> for i in xrange(0, 5):
... print gt.vertex_average(g, clusts[i])
...
(0.0057683333333333336, 0.00048270786829210805)
(0.025800144927536232, 0.00097643830822805055)
(0.11379500000000001, 0.0019584434515139259)
(0.39734630434782608, 0.0029727349290168477)
(0.43750507246376807, 0.0029440016153056154)
(0.005768333333333334, 0.00048270786829210805)
(0.025800144927536232, 0.0009764383082280506)
(0.11379500000000001, 0.001958443451513926)
(0.3973463043478261, 0.0029727349290168477)
(0.4375050724637681, 0.0029440016153056154)
References
----------
......@@ -418,11 +418,11 @@ def motif_significance(g, k, n_shuffles=100, p=1.0, motif_list=None,
g : :class:`~graph_tool.Graph`
Graph to be used.
k : int
number of vertices of the motifs
Number of vertices of the motifs
n_shuffles : int (optional, default: 100)
number of shuffled networks to consider for the z-score
Number of shuffled networks to consider for the z-score
p : float or float list (optional, default: 1.0)
uniform fraction of the motifs to be sampled. If a float list is
Uniform fraction of the motifs to be sampled. If a float list is
provided, it will be used as the fraction at each depth
:math:`[1,\dots,k]` in the algorithm. See [wernicke-efficient-2006]_ for
more details.
......
......@@ -263,7 +263,7 @@ def modularity(g, prop, weight=None):
>>> g = gt.load_graph("community.dot")
>>> spins = gt.community_structure(g, 10000, 10)
>>> gt.modularity(g, spins)
0.53531418856240398
0.535314188562404
References
----------
......
......@@ -183,7 +183,7 @@ def scalar_assortativity(g, deg):
... lambda i,k: 1.0/(1+abs(i-k)),
... directed=False)
>>> gt.scalar_assortativity(g, "out")
(0.62451825727122212, 0.011132275391353953)
(0.6245182572712221, 0.011132275391353953)
References
----------
......
......@@ -141,7 +141,7 @@ def random_graph(N, deg_sampler, deg_corr=None, directed=True,
>>> g = gt.random_graph(1000, lambda: sample_k(40),
... lambda i,k: 1.0/(1+abs(i-k)), directed=False)
>>> gt.scalar_assortativity(g, "out")
(0.62986894481988553, 0.011101504846821255)
(0.6298689448198855, 0.011101504846821255)
The following samples an in,out-degree pair from the joint distribution:
......
......@@ -214,7 +214,7 @@ def vertex_average(g, deg):
>>> seed(42)
>>> g = gt.random_graph(1000, lambda: (poisson(5), poisson(5)))
>>> print gt.vertex_average(g, "in")
(5.0919999999999996, 0.071885575743677543)
(5.092, 0.07188557574367754)
"""
ret = libgraph_tool_stats.\
......@@ -262,7 +262,7 @@ def edge_average(g, eprop):
>>> eprop = g.new_edge_property("double")
>>> eprop.get_array()[:] = random(g.num_edges())
>>> print gt.edge_average(g, eprop)
(0.49674035434130187, 0.0040946040690938677)
(0.49674035434130187, 0.004094604069093868)
"""
ret = libgraph_tool_stats.\
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment