Commit 2f78dd9e authored by VIGNET Pierre's avatar VIGNET Pierre
Browse files

[cmd] Rename functions

parent 4d4e0e1c
......@@ -248,7 +248,7 @@ def solutions_2_graphs(output_dir, model_file, path):
if os.path.isfile(path):
# The given path is a solution file
convert_solution_file_to_graphs(
save_solutions_to_graphs(
output_dir,
load_solutions(path),
model_transitions
......@@ -263,7 +263,7 @@ def solutions_2_graphs(output_dir, model_file, path):
for file_number, solution_file in \
enumerate(glob.glob(path + '*mac_complete.txt'), 1):
convert_solution_file_to_graphs(
save_solutions_to_graphs(
output_dir,
load_solutions(solution_file),
model_transitions
......@@ -273,8 +273,8 @@ def solutions_2_graphs(output_dir, model_file, path):
assert file_number != 0, "No *mac_complete.txt files found!"
def convert_solution_file_to_graphs(output_dir, sol_steps, transitions):
"""Build and write graphs based on the given solutions
def save_solutions_to_graphs(output_dir, sol_steps, transitions):
"""Build and export graphs based on the given solutions
Each solution is composed of a set of frontier places and steps,
themselves composed of events.
......@@ -330,7 +330,8 @@ def get_solution_graphs(sol_steps, transitions):
yield build_graph(sol, steps, transitions)[0]
def solutions_2_common_graph(output_dir, model_file, path):
def queries_2_common_graph(output_dir, model_file, path,
make_graphs=True, make_csv=False, make_json=True): # force option
"""Entry point for solutions_2_common_graph
Create a GraphML formated file containing a unique representation of **all**
......@@ -358,7 +359,7 @@ def solutions_2_common_graph(output_dir, model_file, path):
if os.path.isfile(path):
# The given path is a solution file
graphs = get_solution_graph(
graphs = get_solution_graphs(
load_solutions(path),
model_transitions
)
......@@ -382,8 +383,10 @@ def solutions_2_common_graph(output_dir, model_file, path):
LOGGER.info("Processing %s query...", query)
graphs = get_solution_graph(
load_solutions(solution_file),
# generator of ("Ax Bx", [['h2', 'h00'], ['h3'], ['h0', 'h1'], ['hlast']])
solutions = tuple(load_solutions(solution_file))
graphs = get_solution_graphs(
solutions,
model_transitions
)
......
Supports Markdown
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