Commit f37629d5 authored by VIGNET Pierre's avatar VIGNET Pierre
Browse files

[cmd] Delete redondancy

parent 15bf4435
......@@ -57,7 +57,7 @@ from tools.models import get_transitions, \
get_frontier_places, \
get_identifiers_mapping
from tools.models import get_places_data
from tools.graphs import build_graph, get_json_graph, export_graph
from tools.graphs import build_graph, get_json_graph, export_graph, get_solutions_graph_data
import cadbiom.commons as cm
......@@ -344,11 +344,11 @@ def low_graph_info(model_file, centralities):
Get JSON data with information about the graph based on the model.
:param arg1: File for the model.
:param arg2: If True with, compute centralities
(degree, in_degree, out_degree, closeness, betweenness).
:type arg1: <str>
:type arg2: <boolean>
:param model_file: File for the model.
:param centralities: If True with, compute centralities
(degree, closeness, betweenness).
:type model_file: <str>
:type centralities: <boolean>
:return: Dictionary with the results of measures on the given graph.
keys: measure's name; values: measure's value
......@@ -421,28 +421,16 @@ def low_graph_info(model_file, centralities):
info = {
'modelFile': model_file,
'modelName': model.name,
'graph_nodes': len(G.nodes()),
'graph_edges': len(G.edges()),
'events:': len(transitions_1), # One event can have multiple transitions
'entities': len(all_places_1), # places
'boundaries': len(front_places), # frontier places
'transitions': len(model.transition_list),
}
# Return centralities measures
# TODO: return this only for places (all, frontier, genes) ?
if centralities:
info.update({
'centralities': {
'degree': nx.degree_centrality(G),
'in_degree': nx.in_degree_centrality(G),
'out_degree': nx.out_degree_centrality(G),
'betweenness': nx.betweenness_centrality(G),
'closeness': nx.closeness_centrality(G),
}
})
LOGGER.info(str(info))
get_solutions_graph_data(G, info, centralities)
LOGGER.info("%s", info)
return info, res_1, front_places_str
......
......@@ -326,8 +326,6 @@ def get_solutions_graph_data(G, info, centralities):
}
})
LOGGER.info("%s", info)
def get_json_graph(G):
"""Translate Networkx graph into a dictionary ready to be dumped in a JSON file.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment