Commit 968e9f77 authored by VIGNET Pierre's avatar VIGNET Pierre
Browse files

Update doc for draw_graph

parent f1ce1dd5
......@@ -103,39 +103,39 @@ def draw_graph(output_dir, solution, solution_index, G,
- white: middle edges,
- blue: transition edges
:param arg1: Output directory for GraphML files.
:param arg2: Solution string (mostly a set of frontier places).
:param arg3: Index of the solution in the Cadbiom result file
:param output_dir: Output directory for GraphML files.
:param solution: Solution string (mostly a set of frontier places).
:param solution_index: Index of the solution in the Cadbiom result file
(used to distinguish exported filenames).
:param arg4: Networkx graph object.
:param arg5: Nodes corresponding to transitions with conditions.
:param G: Networkx graph object.
:param transition_nodes: Nodes corresponding to transitions with conditions.
List of tuples: event, node
:param arg6: All nodes in the model
:param arg7: Edges between transition node and nodes in condition
:param arg8: Normal transitions without condition
:param arg9: If True, an image is exported by matplotlib (optional).
:type arg1: <str>
:type arg2: <str>
:type arg3: <int> or <str>
:type arg4: <networkx.classes.digraph.DiGraph>
:type arg5: <list>
:type arg6: <list>
:type arg7: <list>
:type arg7: <list>
:type arg8: <boolean>
:param all_nodes: All nodes in the model
:param edges_in_cond: Edges between transition node and nodes in condition
:param edges: Normal transitions without condition
:param matplotlib_export: (Optional) If True, instead of creating a GraphML
file, an image is exported via matplotlib.
:type output_dir: <str>
:type solution: <str>
:type solution_index: <int> or <str>
:type G: <networkx.classes.digraph.DiGraph>
:type transition_nodes: <list>
:type all_nodes: <list>
:type edges_in_cond: <list>
:type edges: <list>
:type matplotlib_export: <boolean>
"""
creation_date = dt.datetime.now().strftime("%H-%M-%S")
# Save & show
filename = "{}{}_{}_{}".format(
output_dir, creation_date, solution_index, solution[:75]
)
# Save #####################################################################
if not matplotlib_export:
# Save the graph without matplotlib requirement
# PS: inhibitors will still have not the attribute 'color' = 'white'
nx.write_graphml(
G,
"{}{}_{}_{}.graphml".format(
output_dir, creation_date, solution_index, solution[:75]
)
)
nx.write_graphml(G, filename + ".graphml")
return
# Drawing ##################################################################
......
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