Пример #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)
Пример #2
0
 def time_betweenness_centrality_local(self):
     mm.betweenness_centrality(self.network, radius=5, weight=None)
Пример #3
0
 def time_betweenness_centrality_edges(self):
     mm.betweenness_centrality(self.network, mode="edges")
Пример #4
0
 def time_betweenness_centrality_angular(self):
     mm.betweenness_centrality(self.dual, weight="angle")
Пример #5
0
 def time_betweenness_centrality_nodes(self):
     mm.betweenness_centrality(self.network)