Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
VIGNET Pierre
cadbiom
Commits
4d4e0e1c
Commit
4d4e0e1c
authored
Jan 22, 2020
by
VIGNET Pierre
Browse files
[cmd] Move get_solution_graphs() outside queries_2_common_graph()
parent
55d54406
Changes
2
Show whitespace changes
Inline
Side-by-side
command_line/cadbiom_cmd/cadbiom_cmd.py
View file @
4d4e0e1c
...
...
@@ -146,7 +146,7 @@ def solutions_2_common_graph(args):
# Module import
import
solution_sort
solution_sort
.
solution
s_2_common_graph
(
solution_sort
.
querie
s_2_common_graph
(
args
[
'output'
],
args
[
'model_file'
],
args
[
'path'
]
...
...
command_line/cadbiom_cmd/solution_sort.py
View file @
4d4e0e1c
...
...
@@ -317,6 +317,19 @@ def convert_solution_file_to_graphs(output_dir, sol_steps, transitions):
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
):
"""Entry point for solutions_2_common_graph
...
...
@@ -337,21 +350,6 @@ def solutions_2_common_graph(output_dir, model_file, path):
: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
assert
os
.
path
.
isfile
(
path
)
or
os
.
path
.
isdir
(
path
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment