@@ -217,15 +217,14 @@ def process_imports(
217217def v1_0_to_v1_1 (document : CommentedMap , outdir : str ) -> CommentedMap :
218218 """CWL v1.0.x to v1.1 transformation loop."""
219219 _v1_0_to_v1_1 (document , outdir )
220- if isinstance (document , MutableMapping ):
221- for key , value in document .items ():
222- with SourceLine (document , key , Exception ):
223- if isinstance (value , CommentedMap ):
224- document [key ] = _v1_0_to_v1_1 (value , outdir )
225- elif isinstance (value , list ):
226- for index , entry in enumerate (value ):
227- if isinstance (entry , CommentedMap ):
228- value [index ] = _v1_0_to_v1_1 (entry , outdir )
220+ for key , value in document .items ():
221+ with SourceLine (document , key , Exception ):
222+ if isinstance (value , CommentedMap ):
223+ document [key ] = _v1_0_to_v1_1 (value , outdir )
224+ elif isinstance (value , list ):
225+ for index , entry in enumerate (value ):
226+ if isinstance (entry , CommentedMap ):
227+ value [index ] = _v1_0_to_v1_1 (entry , outdir )
229228 document ["cwlVersion" ] = "v1.1"
230229 return sort_v1_0 (document )
231230
@@ -345,12 +344,17 @@ def _v1_0_to_v1_1(document: CommentedMap, outdir: str) -> CommentedMap:
345344 _v1_0_to_v1_1 (process , outdir )
346345 if "cwlVersion" in process :
347346 del process ["cwlVersion" ]
348- elif isinstance (entry ["run" ], str ):
347+ elif (
348+ isinstance (entry ["run" ], str )
349+ and "#" not in entry ["run" ]
350+ ):
349351 path = Path (document .lc .filename ).parent / entry ["run" ]
350352 process = v1_0_to_v1_1 (
351353 load_cwl_document (str (path )), outdir
352354 )
353355 write_cwl_document (process , path .name , outdir )
356+ elif isinstance (entry ["run" ], str ) and "#" in entry ["run" ]:
357+ pass # reference to $graph entry
354358 else :
355359 raise Exception (
356360 "'run' entry was neither a CWL Process nor "
0 commit comments