comparison env/lib/python3.9/site-packages/networkx/algorithms/assortativity/tests/base_test.py @ 0:4f3585e2f14b draft default tip

"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
author shellac
date Mon, 22 Mar 2021 18:12:50 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4f3585e2f14b
1 import networkx as nx
2
3
4 class BaseTestAttributeMixing:
5 @classmethod
6 def setup_class(cls):
7 G = nx.Graph()
8 G.add_nodes_from([0, 1], fish="one")
9 G.add_nodes_from([2, 3], fish="two")
10 G.add_nodes_from([4], fish="red")
11 G.add_nodes_from([5], fish="blue")
12 G.add_edges_from([(0, 1), (2, 3), (0, 4), (2, 5)])
13 cls.G = G
14
15 D = nx.DiGraph()
16 D.add_nodes_from([0, 1], fish="one")
17 D.add_nodes_from([2, 3], fish="two")
18 D.add_nodes_from([4], fish="red")
19 D.add_nodes_from([5], fish="blue")
20 D.add_edges_from([(0, 1), (2, 3), (0, 4), (2, 5)])
21 cls.D = D
22
23 M = nx.MultiGraph()
24 M.add_nodes_from([0, 1], fish="one")
25 M.add_nodes_from([2, 3], fish="two")
26 M.add_nodes_from([4], fish="red")
27 M.add_nodes_from([5], fish="blue")
28 M.add_edges_from([(0, 1), (0, 1), (2, 3)])
29 cls.M = M
30
31 S = nx.Graph()
32 S.add_nodes_from([0, 1], fish="one")
33 S.add_nodes_from([2, 3], fish="two")
34 S.add_nodes_from([4], fish="red")
35 S.add_nodes_from([5], fish="blue")
36 S.add_edge(0, 0)
37 S.add_edge(2, 2)
38 cls.S = S
39
40
41 class BaseTestDegreeMixing:
42 @classmethod
43 def setup_class(cls):
44 cls.P4 = nx.path_graph(4)
45 cls.D = nx.DiGraph()
46 cls.D.add_edges_from([(0, 2), (0, 3), (1, 3), (2, 3)])
47 cls.M = nx.MultiGraph()
48 nx.add_path(cls.M, range(4))
49 cls.M.add_edge(0, 1)
50 cls.S = nx.Graph()
51 cls.S.add_edges_from([(0, 0), (1, 1)])