1111from typing import Any , cast
1212
1313from ruamel import yaml
14+ from schema_salad .metaschema import ArraySchema , RecordSchema
15+ from schema_salad .runtime import LoadingOptions
1416from schema_salad .sourceline import SourceLine
1517from schema_salad .utils import json_dumps
1618
@@ -71,12 +73,12 @@ def escape_expression_field(contents: str) -> str:
7173def _clean_type_ids (
7274 cwltype : InputTypeSchemas | CommandOutputTypeSchemas ,
7375) -> None :
74- if isinstance (cwltype , cwl . ArraySchema ):
76+ if isinstance (cwltype , ArraySchema ):
7577 if is_sequence (cwltype .items ):
7678 for item in cwltype .items :
7779 if hasattr (item , "id" ):
7880 item .id = item .id .split ("#" )[- 1 ]
79- elif isinstance (cwltype .items , cwl . RecordSchema ):
81+ elif isinstance (cwltype .items , RecordSchema ):
8082 if (
8183 isinstance (
8284 cwltype .items ,
@@ -88,7 +90,7 @@ def _clean_type_ids(
8890 if cwltype .items .fields :
8991 for field in cwltype .items .fields :
9092 field .name = field .name .split ("/" )[- 1 ]
91- elif isinstance (cwltype , cwl . RecordSchema ):
93+ elif isinstance (cwltype , RecordSchema ):
9294 if cwltype .name :
9395 cwltype .name = cwltype .name .split ("/" )[- 1 ]
9496 if cwltype .fields :
@@ -983,7 +985,7 @@ def process_workflow_inputs_and_outputs(
983985 else :
984986 sources = [s .split ("#" )[- 1 ] for s in param2 .outputSource ]
985987 source_type_items = utils .type_for_source (workflow , sources )
986- if isinstance (source_type_items , cwl . ArraySchema ):
988+ if isinstance (source_type_items , ArraySchema ):
987989 if is_sequence (source_type_items .items ):
988990 if "null" not in source_type_items .items :
989991 new_source_type_items_items = list (source_type_items .items )
@@ -1650,7 +1652,7 @@ def process_level_reqs(
16501652
16511653
16521654def add_input_to_process (
1653- process : cwl .Process , name : str , inptype : Any , loadingOptions : cwl . LoadingOptions
1655+ process : cwl .Process , name : str , inptype : Any , loadingOptions : LoadingOptions
16541656) -> None :
16551657 """Add a new InputParameter to the given CommandLineTool."""
16561658 if isinstance (process , cwl .CommandLineTool ):
@@ -1726,7 +1728,7 @@ def traverse_CommandLineTool(
17261728 )
17271729 new_target_clt_arguments = list (target_clt .arguments or [])
17281730 new_target_clt_arguments [index ] = cwl .CommandLineBinding (
1729- valueFrom = "$(inputs.{})" . format ( inp_id )
1731+ valueFrom = f "$(inputs.{ inp_id } )"
17301732 )
17311733 target_clt .arguments = new_target_clt_arguments
17321734 new_target_clt_inputs = list (target_clt .inputs )
0 commit comments