Commit 6bb10b12 authored by VIGNET Pierre's avatar VIGNET Pierre
Browse files

Forgotten doc; return dict in graph_infos()

parent 98a61e48
......@@ -837,8 +837,14 @@ def graph_isomorph_test(model_file_1, model_file_2, output_dir='graphs/',
:param arg1: File for the model 1.
:param arg2: File for the model 2.
:param arg3: Output path.
:param arg4: If True, make a graphml file in output path.
:param arg5: If True, make a json dump of results in output path.
:type arg1: <str>
:type arg2: <str>
:type arg3: <str>
:type arg4: <boolean>
:type arg5: <boolean>
:return: Dictionary with the results of tests.
keys: 'topology', 'nodes', 'edges'; values: booleans
:rtype: <dict <str>: <boolean>>
......@@ -903,6 +909,18 @@ def graph_isomorph_test(model_file_1, model_file_2, output_dir='graphs/',
def graph_infos(model_file, output_dir='graphs/',
make_graph=True, make_json=True):
"""Entry point for model stats.
:param arg1: File for the model.
:param arg2: Output path.
:param arg3: If True, make a graphml file in output path.
:param arg4: If True, make a json dump of results in output path.
:type arg1: <str>
:type arg2: <str>
:type arg3: <boolean>
:type arg4: <boolean>
:return: Dictionary with the results of measures on the given graph.
keys: measure's name; values: measure's value
:rtype: <dict>
"""
# Load transitions in the model
......@@ -944,6 +962,8 @@ def graph_infos(model_file, output_dir='graphs/',
with open(output_dir + "infos_results.json", 'w') as fd:
fd.write(json.dumps(infos, sort_keys=True, indent=4) + '\n')
return infos
if __name__ == "__main__":
......
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