1- import argparse
21import copy
32from pathlib import Path
43from typing import Any , Dict , List
@@ -102,7 +101,7 @@ def add_yamldict_keyval_out(steps_i: Yaml, step_key: str, strs: List[str]) -> Ya
102101 return steps_i
103102
104103
105- def get_workflow_outputs (args : argparse . Namespace ,
104+ def get_workflow_outputs (graph_settings : Dict [ str , Any ] ,
106105 namespaces : Namespaces ,
107106 is_root : bool ,
108107 yaml_stem : str ,
@@ -116,7 +115,7 @@ def get_workflow_outputs(args: argparse.Namespace,
116115 """Chooses a subset of the CWL outputs: to actually output
117116
118117 Args:
119- args (argparse.Namespace ): The command line arguments
118+ graph_settings (Dict[str, Any] ): The settings dict for graphpviz graphs
120119 namespaces (Namespaces): Specifies the path in the AST of the current subworkflow
121120 is_root (bool): True if this is the root workflow
122121 yaml_stem (str): The name of the current subworkflow (stem of the yaml filepath)
@@ -148,7 +147,7 @@ def get_workflow_outputs(args: argparse.Namespace,
148147 out_var = f'{ step_name_or_key } /{ out_key } '
149148 # Avoid duplicating intermediate outputs in GraphViz
150149 out_key_no_namespace = out_key .split ('___' )[- 1 ]
151- if args . graph_show_outputs :
150+ if graph_settings [ ' graph_show_outputs' ] :
152151 vars_nss = [var .replace ('/' , '___' ) for var in vars_workflow_output_internal ]
153152 case1 = (tool_i ['class' ] == 'Workflow' ) and (not out_key in vars_nss )
154153 # Avoid duplicating outputs from subgraphs in parent graphs.
@@ -164,8 +163,8 @@ def get_workflow_outputs(args: argparse.Namespace,
164163 attrs = {'label' : out_key_no_namespace , 'shape' : 'box' ,
165164 'style' : 'rounded, filled' , 'fillcolor' : 'lightyellow' }
166165 graph_gv .node (namespaced_output_name , ** attrs )
167- font_edge_color = 'black' if args . graph_dark_theme else 'white'
168- if args . graph_label_edges :
166+ font_edge_color = 'black' if graph_settings [ ' graph_dark_theme' ] else 'white'
167+ if graph_settings [ ' graph_label_edges' ] :
169168 graph_gv .edge (step_node_name , namespaced_output_name , color = font_edge_color ,
170169 label = out_key_no_namespace ) # Is labeling necessary?
171170 else :
0 commit comments