Skip to content

Commit

Permalink
Update functions.py
Browse files Browse the repository at this point in the history
  • Loading branch information
defausti authored Nov 5, 2024
1 parent 8f4344d commit cd63157
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions terra-backend/python-server/modules/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ def build_metrics(self, graph):
},
"closeness": nx.closeness_centrality(graph, distance="inv_weight"),
"betweenness": nx.betweenness_centrality(graph, weight="inv_weight"),
"in_degree": graph.in_degree(weight="weight"),
"distinctiveness": distinctiveness(graph.to_undirected(), alpha = 1, normalize = True, measures = ["D1"])["D1"]}
"in_degree": {
a: b for a, b in graph.in_degree(weight="weight")
},
"distinctiveness": distinctiveness(graph.to_undirected(), alpha = 1, normalize = True, measures = ["D1"])["D1"]
}

self.logger.info("[TERRA] Graph metrics ready!")
Expand Down

0 comments on commit cd63157

Please sign in to comment.