Commit 4d4e0e1c authored by VIGNET Pierre's avatar VIGNET Pierre
Browse files

[cmd] Move get_solution_graphs() outside queries_2_common_graph()

parent 55d54406
...@@ -146,7 +146,7 @@ def solutions_2_common_graph(args): ...@@ -146,7 +146,7 @@ def solutions_2_common_graph(args):
# Module import # Module import
import solution_sort import solution_sort
solution_sort.solutions_2_common_graph( solution_sort.queries_2_common_graph(
args['output'], args['output'],
args['model_file'], args['model_file'],
args['path'] args['path']
......
...@@ -317,6 +317,19 @@ def convert_solution_file_to_graphs(output_dir, sol_steps, transitions): ...@@ -317,6 +317,19 @@ def convert_solution_file_to_graphs(output_dir, sol_steps, transitions):
build_graph(sol, steps, transitions)[0]) build_graph(sol, steps, transitions)[0])
def get_solution_graphs(sol_steps, transitions):
"""Generator that yields the graphs of the given solutions.
.. note:: See the doc of a similar function
:meth:`~cadbiom_cmd.solution_sort.save_solutions_to_graphs`.
"""
for sol, steps in sol_steps:
# build_graph() returns :
# G, transition_nodes, all_nodes, edges_in_cond, edges
# Python 3: partial unpacking: G, *_
yield build_graph(sol, steps, transitions)[0]
def solutions_2_common_graph(output_dir, model_file, path): def solutions_2_common_graph(output_dir, model_file, path):
"""Entry point for solutions_2_common_graph """Entry point for solutions_2_common_graph
...@@ -337,21 +350,6 @@ def solutions_2_common_graph(output_dir, model_file, path): ...@@ -337,21 +350,6 @@ def solutions_2_common_graph(output_dir, model_file, path):
:type path: <str> :type path: <str>
""" """
def get_solution_graph(sol_steps, transitions):
"""Generator that yields the graph of the given solutions.
.. note:: See the doc of a similar function
:meth:`~cadbiom_cmd.solution_sort.convert_solution_file_to_graphs`.
"""
for sol, steps in sol_steps:
# build_graph() returns :
# G, transition_nodes, all_nodes, edges_in_cond, edges
# Python 3: partial unpacking: G, *_
yield build_graph(sol, steps, transitions)[0]
# Check valid input file/directory # Check valid input file/directory
assert os.path.isfile(path) or os.path.isdir(path) assert os.path.isfile(path) or os.path.isdir(path)
......
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