Commit 9ca10d2f authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Small documentation and test fixes

parent cfc67930
......@@ -104,24 +104,24 @@ def pagerank(g, damping=0.8, prop=None, epslon=1e-6, max_iter=None,
>>> seed(42)
>>> g = gt.random_graph(100, lambda: (poisson(3), poisson(3)))
>>> pr = gt.pagerank(g)
>>> print pr.get_array()
[ 0.99988081 0.39997616 0.80428057 0.43237369 0.2 0.75830329
0.41447482 1.56621542 0.30841665 0.86432715 0.79374139 0.54573086
0.89372179 0.93590145 0.25159724 1.12033843 0.2 0.98486039
0.28191404 0.88133806 0.31166878 1.73878838 0.6903469 0.94100349
0.25159724 0.32248278 1.03788472 0.58022932 0.35009064 0.94542317
0.85751934 0.69608227 1.11373543 1.13477707 0.2 0.71559888
0.30461189 0.2 1.02871995 1.14657561 0.2 0.25031945
0.51841423 0.44709022 0.75239816 0.76551737 0.25638281 1.51657252
0.30841665 0.59707408 0.34179258 1.0590272 2.16427996 0.51196274
1.2264604 1.71578696 0.85838961 0.41931136 0.96797602 0.61882367
1.07826603 0.2984934 1.1305187 0.75006564 0.48066231 1.61759314
0.73870051 1.08374044 0.38258693 0.98112013 0.2 0.25590818
1.17500568 1.2288973 0.29613246 1.45937444 0.39997616 1.18311783
0.67063807 0.39229458 0.72314004 0.88473325 0.32859279 0.40656244
0.51754349 0.5315028 0.55196274 0.2335463 1.56357203 0.91464458
0.46999727 1.06779933 0.4852867 0.48933035 0.58997931 0.52883683
0.79385874 0.59244805 0.99896399 1.0470592 ]
>>> print pr.a
[ 0.89482844 1.37847566 0.24 1.30716676 0.2 0.70397009
0.40205781 0.74783725 1.37167015 0.66836587 0.5868133 0.47968714
1.52225854 1.07388611 0.76316432 0.39214247 0.9302883 0.86455762
0.77546264 1.87740317 0.25482139 0.29902553 0.2 0.24756383
0.97205301 0.29727392 1.34742309 0.30905457 0.55032542 0.56654712
0.40895463 0.77928729 0.73227413 0.59911926 1.39946277 0.72793699
2.27008393 0.88929335 0.48636962 0.73070609 0.2 0.232
0.96857512 2.97683022 0.58581032 0.80217847 0.37896569 0.93866821
0.27337672 0.98201842 0.48551839 1.22651796 0.73263045 0.43013228
1.00971133 0.72075953 0.66715456 0.58705749 0.74286661 0.37785867
1.8475279 0.26432925 0.33994628 0.97319326 0.78104447 0.2
0.33333761 0.51756267 0.47811583 0.85905246 1.46428623 0.2
1.70687671 1.0107342 0.94504737 1.29858046 2.19707395 0.55931282
0.85129509 1.09493368 1.22168331 0.64108136 0.70690188 0.2
0.31736266 0.42372513 0.79429328 1.44749664 1.20741669 0.65763236
0.40895463 0.62628812 0.32671006 0.85626447 0.59925496 0.3399879
0.81215046 0.71506902 2.25678844 1.04882679]
References
----------
......@@ -201,24 +201,24 @@ def betweenness(g, vprop=None, eprop=None, weight=None, norm=True):
>>> seed(42)
>>> g = gt.random_graph(100, lambda: (poisson(3), poisson(3)))
>>> vb, eb = gt.betweenness(g)
>>> print vb.get_array()
[ 0.06129648 0.02004734 0.04305659 0.01071136 0. 0.0252028
0.00679622 0.06981881 0.00541371 0.02462107 0.05328111 0.0107051
0.05981227 0. 0.01315561 0.00131498 0. 0.01883264
0.01663386 0.03195175 0.01942617 0.13693745 0.01378875 0.00962001
0.01325009 0.04685362 0.03839758 0.03395201 0.02160984 0.01727593
0.0478231 0. 0.03826993 0.05124999 0. 0.
0.00705917 0. 0.02190356 0.04505211 0. 0.00676419
0.00110802 0.00169839 0.08733666 0.10546473 0. 0.12058932
0. 0.00907921 0.02182859 0.08865455 0. 0.0418017
0.03500162 0.07492683 0.03856307 0.04300598 0.02173347 0.00488363
0.03739852 0.01113193 0.04386369 0.02994719 0.03383728 0.
0.09230395 0.05449223 0.02507715 0.04944675 0. 0.00215935
0.04371057 0.01749238 0.00104315 0.04688928 0.00444627 0.0178016
0.01358585 0.02193068 0.03184527 0.05640358 0.00214389 0.03922583
0.02195544 0.02613584 0.02246488 0.00066481 0.0755375 0.03142692
0.04533332 0.03188087 0.04227853 0.03926328 0.00810412 0.02888085
0.0455241 0.01373183 0.07029039 0.04382892]
>>> print vb.a
[ 0.03047981 0.07396685 0.00270882 0.044637 0. 0.03259048
0.0243547 0.04265909 0.06274696 0.01778475 0.03502657 0.02692273
0.05170277 0.05522454 0.02303023 0.0038858 0. 0.04852871
0.02398655 0.00232365 0. 0.01064643 0. 0.01105872
0.03564021 0.0222059 0.05170383 0.00140447 0.03935299 0.02644813
0.01831885 0. 0.0453981 0.04552396 0.1242787 0.04983878
0.07248363 0.04676976 0.03481327 0.04473583 0. 0.0027417
0.01061048 0.0470108 0.01059109 0.05290495 0. 0.02541583
0. 0.04012033 0.02616307 0.09056515 0.01640322 0.01599007
0.02784563 0.05008998 0.03788222 0.03028745 0.01097982 0.00178571
0.05804645 0.01015181 0.0061582 0.0255485 0.05504439 0.
0.00179516 0.03367643 0.00304982 0.02333254 0.00843039 0.
0.05947385 0.01936996 0.0521946 0.04928937 0.03955121 0.01360865
0.02942447 0. 0.05149102 0.01054765 0. 0.
0.00537915 0.01251828 0.01097982 0.06667564 0.04090169 0.02161779
0.02941671 0.01793679 0.02360528 0.02638257 0.0062989 0.00946123
0. 0.02255701 0.05081734 0.04846652]
References
----------
......@@ -283,7 +283,7 @@ def central_point_dominance(g, betweenness):
>>> g = gt.random_graph(100, lambda: (poisson(3), poisson(3)))
>>> vb, eb = gt.betweenness(g)
>>> print gt.central_point_dominance(g, vb)
0.108411171667
0.0980212339559
References
----------
......@@ -359,31 +359,31 @@ def eigentrust(g, trust_map, vprop=None, norm=False, epslon=1e-6, max_iter=0,
>>> trust.get_array()[:] = random(g.num_edges())*42
>>> t = gt.eigentrust(g, trust, norm=True)
>>> print t.get_array()
[ 1.78295032e-02 1.10159977e-03 8.27504534e-03 3.34579667e-03
0.00000000e+00 9.28795883e-03 7.56225537e-03 2.03772288e-02
6.87447577e-04 8.87085111e-03 2.84707349e-03 2.55095571e-03
7.65302351e-03 5.06044724e-02 3.98617107e-04 1.02897822e-02
0.00000000e+00 6.76980749e-03 6.91342330e-04 1.13998018e-02
1.91846222e-03 3.74940757e-02 8.65907932e-03 5.76596060e-03
1.11786939e-05 8.20855949e-04 9.45056085e-03 1.76099276e-02
2.67746802e-03 1.03182164e-02 1.80748361e-02 8.49781556e-03
7.89442825e-03 1.11838761e-02 0.00000000e+00 4.37095317e-03
2.50451228e-05 0.00000000e+00 6.04054677e-03 1.51361293e-02
0.00000000e+00 1.62557422e-04 1.02859153e-03 3.38079641e-03
3.06115271e-03 2.96226918e-03 7.40021010e-05 1.64096932e-02
1.12026631e-03 3.33521569e-03 1.77214999e-03 6.62472745e-03
3.17014482e-02 1.93793538e-03 5.24056364e-02 4.04200200e-02
2.96053927e-02 2.06294202e-03 2.93045979e-02 1.87688605e-03
1.13962350e-02 6.94033709e-03 1.57347756e-02 3.97987237e-03
1.15994824e-03 1.81252731e-02 2.06848985e-02 3.73314296e-03
1.27163202e-03 1.08081901e-02 0.00000000e+00 2.25590063e-04
8.55970439e-03 4.15387826e-02 8.61792076e-05 6.48435253e-02
5.61799591e-03 4.69096686e-02 4.24627753e-03 9.16721227e-04
4.86522362e-03 4.42735866e-03 5.50595265e-04 3.12087221e-03
8.75442087e-03 4.25588041e-03 2.91851609e-03 1.80331544e-06
2.89281502e-02 1.75099401e-02 1.14704807e-02 3.30940821e-02
2.84005465e-03 4.92435108e-03 4.34713976e-03 2.72336599e-03
9.37679329e-03 8.64912360e-03 3.96113432e-03 1.07637051e-02]
[ 1.04935746e-02 2.82745068e-02 0.00000000e+00 1.81121002e-02
0.00000000e+00 3.70898521e-03 1.00108703e-03 1.29620638e-02
1.71874047e-02 7.07523828e-03 8.29873222e-03 1.79259666e-03
4.08925756e-02 1.55855653e-02 2.92256968e-03 1.71520782e-03
5.04335865e-03 1.25678184e-02 1.92903241e-02 2.46642649e-02
1.76431290e-04 1.85066489e-04 0.00000000e+00 4.52686439e-04
7.13943855e-03 2.36002975e-03 1.44366165e-02 4.39632543e-04
7.50316671e-03 8.13521884e-03 3.98083843e-03 1.04883920e-02
7.42099689e-03 2.46651355e-03 2.08148781e-02 8.02104873e-03
2.59366573e-02 2.11125347e-02 7.45781416e-03 6.62338254e-03
0.00000000e+00 0.00000000e+00 1.72521147e-02 4.74346499e-02
8.10593668e-03 2.27229702e-02 2.21525586e-03 6.24223052e-03
2.59753300e-03 9.15181124e-03 3.67310718e-03 1.18998211e-02
1.66177496e-02 6.44748287e-03 8.01978992e-03 1.48621102e-02
6.65606246e-03 3.39887550e-03 1.20188240e-02 3.51012614e-03
2.79661104e-02 7.90103914e-05 1.18015521e-03 8.17179744e-03
1.05694658e-02 0.00000000e+00 4.49123443e-04 9.80728243e-04
2.70933271e-03 1.61865322e-02 2.13504124e-02 0.00000000e+00
1.17773123e-02 4.63490203e-03 1.79331966e-02 1.46366115e-02
3.26856602e-02 4.31126006e-03 1.68787878e-02 2.02752156e-02
1.48203062e-02 1.17346898e-03 7.87933309e-03 0.00000000e+00
1.13274458e-03 2.25418313e-03 1.27966643e-02 2.46154526e-02
7.15248968e-03 8.35660945e-03 3.88259360e-03 5.95428313e-03
1.16751480e-04 5.78637193e-03 6.50575506e-03 1.47111816e-03
1.22855215e-02 1.34294277e-02 4.03141738e-02 2.77313687e-02]
References
----------
......
......@@ -253,10 +253,6 @@ def random_rewire(g, strat= "uncorrelated", parallel_edges = False,
self_loops : bool (optional, default: False)
If True, self-loops are allowed.
Returns
-------
None
See Also
--------
random_graph: random graph generation
......
Markdown is supported
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