@@ -23,9 +23,11 @@ def _get_type(tp):
2323
2424def check_types (srctype , sinktype , linkMerge , valueFrom ):
2525 # type: (Any, Any, Optional[Text], Optional[Text]) -> Text
26- """Check if the source and sink types are "pass", "warning", or "exception".
2726 """
27+ Check if the source and sink types are correct.
2828
29+ Acceptable types are "pass", "warning", or "exception".
30+ """
2931 if valueFrom is not None :
3032 return "pass"
3133 if linkMerge is None :
@@ -44,9 +46,7 @@ def check_types(srctype, sinktype, linkMerge, valueFrom):
4446
4547def merge_flatten_type (src ):
4648 # type: (Any) -> Any
47- """Return the merge flattened type of the source type
48- """
49-
49+ """Return the merge flattened type of the source type."""
5050 if isinstance (src , MutableSequence ):
5151 return [merge_flatten_type (t ) for t in src ]
5252 if isinstance (src , MutableMapping ) and src .get ("type" ) == "array" :
@@ -55,15 +55,15 @@ def merge_flatten_type(src):
5555
5656
5757def can_assign_src_to_sink (src , sink , strict = False ): # type: (Any, Any, bool) -> bool
58- """Check for identical type specifications, ignoring extra keys like inputBinding.
58+ """
59+ Check for identical type specifications, ignoring extra keys like inputBinding.
5960
6061 src: admissible source types
6162 sink: admissible sink types
6263
6364 In non-strict comparison, at least one source type must match one sink type.
6465 In strict comparison, all source types must match at least one sink type.
6566 """
66-
6767 if src == "Any" or sink == "Any" :
6868 return True
6969 if isinstance (src , MutableMapping ) and isinstance (sink , MutableMapping ):
@@ -100,12 +100,12 @@ def can_assign_src_to_sink(src, sink, strict=False): # type: (Any, Any, bool) -
100100
101101def _compare_records (src , sink , strict = False ):
102102 # type: (MutableMapping[Text, Any], MutableMapping[Text, Any], bool) -> bool
103- """Compare two records, ensuring they have compatible fields.
103+ """
104+ Compare two records, ensuring they have compatible fields.
104105
105106 This handles normalizing record names, which will be relative to workflow
106107 step, so that they can be compared.
107108 """
108-
109109 def _rec_fields (rec ): # type: (MutableMapping[Text, Any]) -> MutableMapping[Text, Any]
110110 out = {}
111111 for field in rec ["fields" ]:
@@ -136,9 +136,7 @@ def missing_subset(fullset, subset):
136136
137137def static_checker (workflow_inputs , workflow_outputs , step_inputs , step_outputs , param_to_step ):
138138 # type: (List[Dict[Text, Any]], List[Dict[Text, Any]], List[Dict[Text, Any]], List[Dict[Text, Any]], Dict[Text, Dict[Text, Any]]) -> None
139- """Check if all source and sink types of a workflow are compatible before run time.
140- """
141-
139+ """Check if all source and sink types of a workflow are compatible before run time."""
142140 # source parameters: workflow_inputs and step_outputs
143141 # sink parameters: step_inputs and workflow_outputs
144142
@@ -225,10 +223,11 @@ def static_checker(workflow_inputs, workflow_outputs, step_inputs, step_outputs,
225223
226224def check_all_types (src_dict , sinks , sourceField ):
227225 # type: (Dict[Text, Any], List[Dict[Text, Any]], Text) -> Dict[Text, List[SrcSink]]
228- # sourceField is either "soure" or "outputSource"
229- """Given a list of sinks, check if their types match with the types of their sources.
230226 """
227+ Given a list of sinks, check if their types match with the types of their sources.
231228
229+ sourceField is either "soure" or "outputSource"
230+ """
232231 validation = {"warning" : [], "exception" : []} # type: Dict[Text, List[SrcSink]]
233232 for sink in sinks :
234233 if sourceField in sink :
0 commit comments