@@ -74,6 +74,11 @@ def pack_process(
7474
7575
7676def listify_everything (cwl : dict [str , Any ]) -> dict [str , Any ]:
77+ """
78+ Convert many CWL construct from their map to the list version.
79+
80+ See https://www.commonwl.org/v1.1/Workflow.html#map
81+ """
7782 for port in ["inputs" , "outputs" ]:
7883 cwl [port ] = utils .normalize_to_list (
7984 cwl .get (port , []), key_field = "id" , value_field = "type"
@@ -99,14 +104,8 @@ def listify_everything(cwl: dict[str, Any]) -> dict[str, Any]:
99104 return cwl
100105
101106
102- def dictify_requirements (cwl : dict [str , Any ]) -> dict [str , Any ]:
103- cwl ["requirements" ] = utils .normalize_to_map (
104- cwl .get ("requirements" , {}), key_field = "class"
105- )
106- return cwl
107-
108-
109107def normalize_sources (cwl : dict [str , Any ]) -> dict [str , Any ]:
108+ """Normalize the steps and output of a CWL Workflow."""
110109 if cwl .get ("class" ) != "Workflow" :
111110 return cwl
112111
@@ -147,6 +146,7 @@ def load_schemadefs(
147146 base_url : urllib .parse .ParseResult ,
148147 parent_user_defined_types : Optional [dict [str , Any ]] = None ,
149148) -> tuple [dict [str , Any ], dict [str , Any ]]:
149+ """Internalize any SchemaDefRequirement, and remove it."""
150150 user_defined_types = schemadef .build_user_defined_type_dict (cwl , base_url )
151151 if parent_user_defined_types is not None :
152152 user_defined_types .update (parent_user_defined_types )
@@ -198,6 +198,7 @@ def resolve_steps(
198198 cwl_version : str ,
199199 parent_user_defined_types : Optional [dict [str , Any ]] = None ,
200200) -> dict [str , Any ]:
201+ """Load and pack all "run" sections of the workflow steps."""
201202 if isinstance (cwl , str ):
202203 raise RuntimeError (f"{ base_url .geturl ()} : Expecting a process, found a string" )
203204
@@ -263,6 +264,7 @@ def _add_req(_req_name: str) -> None:
263264
264265
265266def pack (cwl_path : str ) -> dict [str , Any ]:
267+ """Pack a CWL document at the given path."""
266268 sys .stderr .write (f"Packing { cwl_path } \n " )
267269 file_path_url = urllib .parse .urlparse (cwl_path )
268270
0 commit comments