Commit 24f115e0 authored by VIGNET Pierre's avatar VIGNET Pierre
Browse files

[cmd] Fix typos; rename solutions_2_graph command to solutions_2_graphs

1 graph per solution => multiple graphs per solution files
parent 98fd0439
......@@ -76,7 +76,7 @@ def solutions_sort(args):
@check_output_dir
def solutions_2_graph(args):
def solutions_2_graphs(args):
"""Create GraphML formated files containing a representation of the
trajectories for every solution in complete MAC files (*mac_complete files).
......@@ -86,7 +86,7 @@ def solutions_2_graph(args):
# Module import
import solution_sort
solution_sort.solutions_2_graph(
solution_sort.solutions_2_graphs(
args['output'],
args['model_file'],
args['path']
......@@ -407,8 +407,8 @@ def main():
# Model file (xml : cadbiom language)
# Solution file (mac_complete)
parser_trajectories = subparsers.add_parser(
'solutions_2_graph',
help=solutions_2_graph.__doc__,
'solutions_2_graphs',
help=solutions_2_graphs.__doc__,
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser_trajectories.add_argument('model_file',
help="bcx model file.")
......@@ -418,7 +418,7 @@ def main():
parser_trajectories.add_argument('--output', action=ReadableDir,
nargs='?', default='graphs/',
help="Output directory for GraphML files.")
parser_trajectories.set_defaults(func=solutions_2_graph)
parser_trajectories.set_defaults(func=solutions_2_graphs)
# subparser: Decompilation of trajectories of MACs in a complete file/dir.
......
......@@ -29,7 +29,7 @@ files of Cadbiom.
Entry points:
* :meth:`~cadbiom_cmd.solution_sort.solutions_2_json`
* :meth:`~cadbiom_cmd.solution_sort.solutions_2_graph`
* :meth:`~cadbiom_cmd.solution_sort.solutions_2_graphs`
* :meth:`~cadbiom_cmd.solution_sort.solutions_2_common_graph`
:Example of the content of a complete solution file:
......@@ -222,8 +222,8 @@ def solutions_2_json(output_dir, model_file, path, conditions=True):
assert file_number != 0, "No *mac_complete.txt files found!"
def solutions_2_graph(output_dir, model_file, path):
"""Entry point for solutions_2_graph
def solutions_2_graphs(output_dir, model_file, path):
"""Entry point for solutions_2_graphs
Create GraphML formated files containing a representation of the
trajectories for every solution in complete MAC files (\*mac_complete files).
......@@ -348,9 +348,6 @@ def solutions_2_common_graph(output_dir, model_file, path):
# build_graph() returns :
# G, transition_nodes, all_nodes, edges_in_cond, edges
# sol_index is used to order files according to the order of appearance
# in the file
# Python 3: partial unpacking: G, *_
yield build_graph(sol, steps, transitions)[0]
......
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