-
Notifications
You must be signed in to change notification settings - Fork 1
/
__init__.py
executable file
·66 lines (65 loc) · 1.2 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
""" A module containing networking framework and analysis functions
>>> from netpython import *
>>> def basicTests(net):
... print len(net.edges)
... print net[1].deg()
... print net[1].strength()
... print percolator.getComponents(net).getSizeDist()
... print sum(net.weights)
... #print netext.mst(net).edges
... #print netext.deg(net)
... #print netext.clustering(net)
>>> def addNodes1(net):
... net[1,2]=2.0
... net[2,1]=1.0
... net[2,3]=2.0
... net[3,1]=3.0
... net[3,4]=4.0
... net[5,6]=5.0
>>> def addNodes2(net):
... net['foo','bar']=10.0
... net['bar','foo']=20.0
... net['cat','dog']=30.0
>>> net1=pynet.SymmNet()
>>> addNodes1(net1)
>>> basicTests(net1)
5
2
4.0
{2: 1, 4: 1}
15.0
>>> net2=pynet.Net()
>>> addNodes1(net2)
>>> basicTests(net2)
6
1
2.0
{2: 1, 4: 1}
17.0
>>> net3=pynet.SymmFullNet(10)
>>> addNodes1(net3)
>>> basicTests(net3)
5
2
4.0
{2: 1, 4: 1}
15.0
>>> net4=pynet.FullNet(10)
>>> addNodes1(net4)
>>> basicTests(net4)
6
1
2.0
{2: 1, 4: 1}
17.0
>>> net5=pynet.SymmNet()
>>> addNodes1(net5)
>>> addNodes2(net5)
>>> basicTests(net5)
7
2
4.0
{2: 3, 4: 1}
65.0
"""
__all__=["netio","pynet","netext","percolator","eden","visuals","netanalysis","models","transforms","communities","dialogues"]