Esempio n. 1
0
 def test_betweenness_centrality(self):
     net = mm.betweenness_centrality(self.network)
     net2 = mm.betweenness_centrality(self.network, mode="edges")
     angular = mm.betweenness_centrality(self.dual, weight="angle")
     with pytest.raises(ValueError):
         mm.betweenness_centrality(self.network, mode="nonexistent")
     node = 0.2413793103448276
     edge = 0.16995073891625617
     ang_b = 0.16470588235294117
     assert net.nodes[(1603650.450422848,
                       6464368.600601688)]["betweenness"] == node
     assert (net2.edges[(1603226.9576840235, 6464160.158361825),
                        (1603039.9632033885, 6464087.491175889),
                        8, ]["betweenness"] == edge)
     assert (angular.nodes[(1603315.3564306537,
                            6464044.376339891)]["betweenness"] == ang_b)
Esempio n. 2
0
 def time_betweenness_centrality_local(self):
     mm.betweenness_centrality(self.network, radius=5, weight=None)
Esempio n. 3
0
 def time_betweenness_centrality_edges(self):
     mm.betweenness_centrality(self.network, mode="edges")
Esempio n. 4
0
 def time_betweenness_centrality_angular(self):
     mm.betweenness_centrality(self.dual, weight="angle")
Esempio n. 5
0
 def time_betweenness_centrality_nodes(self):
     mm.betweenness_centrality(self.network)