diff --git a/create_cwl_from_objects.py b/create_cwl_from_objects.py index 002678c4..a41fbd75 100755 --- a/create_cwl_from_objects.py +++ b/create_cwl_from_objects.py @@ -9,11 +9,11 @@ def main() -> None: """Generate a CWL object to match "cat-tool.cwl".""" - inputs = [cwl.CommandInputParameter(id="file1", type="File")] + inputs = [cwl.CommandInputParameter(id="file1", type_="File")] outputs = [ cwl.CommandOutputParameter( id="output", - type="File", + type_="File", outputBinding=cwl.CommandOutputBinding(glob="output"), ) ] diff --git a/cwl_utils/cwl_v1_0_expression_refactor.py b/cwl_utils/cwl_v1_0_expression_refactor.py index e5d86fd7..150aed46 100755 --- a/cwl_utils/cwl_v1_0_expression_refactor.py +++ b/cwl_utils/cwl_v1_0_expression_refactor.py @@ -35,7 +35,7 @@ def expand_stream_shortcuts(process: cwl.CommandLineTool) -> cwl.CommandLineTool return process result = None for index, output in enumerate(process.outputs): - if output.type == "stdout": # TODO: add 'stdin' for CWL v1.1 + if output.type_ == "stdout": # TODO: add 'stdin' for CWL v1.1 if not result: result = copy.deepcopy(process) stdout_path = process.stdout @@ -46,7 +46,7 @@ def expand_stream_shortcuts(process: cwl.CommandLineTool) -> cwl.CommandLineTool ).hexdigest() ) result.stdout = stdout_path - result.outputs[index].type = "File" + result.outputs[index].type_ = "File" output.outputBinding = cwl.CommandOutputBinding(stdout_path, None, None) if result: return result @@ -156,7 +156,7 @@ def etool_to_cltool( doc=inp.doc, format=inp.format, default=inp.default, - type=inp.type, + type_=inp.type_, extension_fields=inp.extension_fields, loadingOptions=inp.loadingOptions, ) @@ -171,7 +171,7 @@ def etool_to_cltool( streamable=outp.streamable, doc=outp.doc, format=outp.format, - type=outp.type, + type_=outp.type_, extension_fields=outp.extension_fields, loadingOptions=outp.loadingOptions, ) @@ -244,7 +244,7 @@ def traverse( doc=inp.doc, format=inp.format, default=inp.default, - type=inp.type, + type_=inp.type_, extension_fields=inp.extension_fields, loadingOptions=inp.loadingOptions, ) @@ -262,7 +262,7 @@ def traverse( doc=outp.doc, format=outp.format, outputSource=f"main/{outp_id}", - type=outp.type, + type_=outp.type_, extension_fields=outp.extension_fields, loadingOptions=outp.loadingOptions, ) @@ -346,9 +346,9 @@ def generate_etool_from_expr( new_type: Union[ List[Union[cwl.ArraySchema, cwl.InputRecordSchema]], Union[cwl.ArraySchema, cwl.InputRecordSchema], - ] = [clean_type_ids(t.type) for t in self_type if t.type] - elif self_type.type: - new_type = clean_type_ids(self_type.type) + ] = [clean_type_ids(t.type_) for t in self_type if t.type_] + elif self_type.type_: + new_type = clean_type_ids(self_type.type_) else: raise WorkflowException(f"Don't know how to make type from {self_type!r}.") inputs.append( @@ -363,7 +363,7 @@ def generate_etool_from_expr( else None, doc=self_type.doc if not isinstance(self_type, list) else None, format=self_type.format if not isinstance(self_type, list) else None, - type=new_type, + type_=new_type, extension_fields=self_type.extension_fields if not isinstance(self_type, list) else None, @@ -381,7 +381,7 @@ def generate_etool_from_expr( streamable=target.streamable, doc=target.doc, format=target.format, - type=target.type, + type_=target.type_, extension_fields=target.extension_fields, loadingOptions=target.loadingOptions, ) @@ -527,7 +527,7 @@ def empty_inputs( result = {} if isinstance(process_or_step, cwl.Process): for param in process_or_step.inputs: - result[param.id.split("#")[-1]] = example_input(param.type) + result[param.id.split("#")[-1]] = example_input(param.type_) else: for param in process_or_step.in_: param_id = param.id.split("/")[-1] @@ -681,7 +681,7 @@ def process_workflow_reqs_and_hints( modified = True target = cwl.InputParameter( id=None, - type="string", + type_="string", ) etool_id = ( "_expression_workflow_EnvVarRequirement_{}".format( @@ -710,7 +710,7 @@ def process_workflow_reqs_and_hints( expression = get_expression(this_attr, inputs, None) if expression: modified = True - target = cwl.InputParameter(id=None, type="long") + target = cwl.InputParameter(id=None, type_="long") etool_id = ( "_expression_workflow_ResourceRequirement_{}".format( attr @@ -739,7 +739,7 @@ def process_workflow_reqs_and_hints( modified = True target = cwl.InputParameter( id=None, - type=cwl.InputArraySchema( + type_=cwl.InputArraySchema( ["File", "Directory"], "array", None, None ), ) @@ -765,7 +765,7 @@ def process_workflow_reqs_and_hints( modified = True target = cwl.InputParameter( id=None, - type=cwl.InputArraySchema( + type_=cwl.InputArraySchema( ["File", "Directory"], "array", None, None ), ) @@ -808,7 +808,7 @@ def process_workflow_reqs_and_hints( ): target = cwl.InputParameter( id=None, - type=expr_result["class"], + type_=expr_result["class"], ) replace_expr_with_etool( expr, @@ -829,7 +829,7 @@ def process_workflow_reqs_and_hints( elif isinstance(expr_result, str): target = cwl.InputParameter( id=None, - type=["File"], + type_=["File"], ) if entry.entryname is None: raise SourceLine( @@ -872,7 +872,7 @@ def process_workflow_reqs_and_hints( modified = True target = cwl.InputParameter( id=None, - type="string", + type_="string", ) etool_id = "_expression_workflow_InitialWorkDirRequirement_{}".format( index @@ -1002,7 +1002,7 @@ def process_level_reqs( expression = get_expression(envDef.envValue, inputs, None) if expression: modified = True - target = cwl.InputParameter(id=None, type="string") + target = cwl.InputParameter(id=None, type_="string") etool_id = "_expression_{}_EnvVarRequirement_{}".format( step_name, env_index ) @@ -1026,7 +1026,7 @@ def process_level_reqs( expression = get_expression(this_attr, inputs, None) if expression: modified = True - target = cwl.InputParameter(id=None, type="long") + target = cwl.InputParameter(id=None, type_="long") etool_id = "_expression_{}_ResourceRequirement_{}".format( step_name, attr ) @@ -1053,7 +1053,7 @@ def process_level_reqs( target_type = cwl.InputArraySchema( ["File", "Directory"], "array", None, None ) - target = cwl.InputParameter(id=None, type=target_type) + target = cwl.InputParameter(id=None, type_=target_type) etool_id = "_expression_{}_InitialWorkDirRequirement".format( step_name ) @@ -1091,7 +1091,7 @@ def process_level_reqs( ) target = cwl.InputParameter( id=None, - type=target_type, + type_=target_type, ) etool_id = ( "_expression_{}_InitialWorkDirRequirement_{}".format( @@ -1148,7 +1148,7 @@ def process_level_reqs( d_target_type = ["File", "Directory"] target = cwl.InputParameter( id=None, - type=d_target_type, + type_=d_target_type, ) etool_id = "_expression_{}_InitialWorkDirRequirement_{}".format( step_name, listing_index @@ -1178,7 +1178,7 @@ def process_level_reqs( modified = True target = cwl.InputParameter( id=None, - type="string", + type_="string", ) etool_id = "_expression_{}_InitialWorkDirRequirement_{}".format( step_name, listing_index @@ -1223,7 +1223,7 @@ def add_input_to_process( process.inputs.append( cwl.CommandInputParameter( id=name, - type=inptype, + type_=inptype, loadingOptions=loadingOptions, ) ) @@ -1254,7 +1254,7 @@ def traverse_CommandLineTool( inp_id = f"_arguments_{index}" etool_id = f"_expression_{step_id}{inp_id}" target_type = "Any" - target = cwl.InputParameter(id=None, type=target_type) + target = cwl.InputParameter(id=None, type_=target_type) replace_step_clt_expr_with_etool( expression, etool_id, parent, target, step, replace_etool ) @@ -1264,7 +1264,7 @@ def traverse_CommandLineTool( target_clt.inputs.append( cwl.CommandInputParameter( id=inp_id, - type=target_type, + type_=target_type, ) ) step.in_.append( @@ -1280,7 +1280,7 @@ def traverse_CommandLineTool( inp_id = f"_arguments_{index}" etool_id = f"_expression_{step_id}{inp_id}" target_type = "Any" - target = cwl.InputParameter(id=None, type=target_type) + target = cwl.InputParameter(id=None, type_=target_type) replace_step_clt_expr_with_etool( expression, etool_id, parent, target, step, replace_etool ) @@ -1290,7 +1290,7 @@ def traverse_CommandLineTool( target_clt.inputs.append( cwl.CommandInputParameter( id=inp_id, - type=target_type, + type_=target_type, ) ) step.in_.append( @@ -1306,13 +1306,13 @@ def traverse_CommandLineTool( inp_id = f"_{streamtype}" etool_id = f"_expression_{step_id}{inp_id}" target_type = "string" - target = cwl.InputParameter(id=None, type=target_type) + target = cwl.InputParameter(id=None, type_=target_type) replace_step_clt_expr_with_etool( expression, etool_id, parent, target, step, replace_etool ) setattr(target_clt, streamtype, f"$(inputs.{inp_id})") target_clt.inputs.append( - cwl.CommandInputParameter(id=inp_id, type=target_type) + cwl.CommandInputParameter(id=inp_id, type_=target_type) ) step.in_.append( cwl.WorkflowStepInput(id=inp_id, source=f"{etool_id}/result") @@ -1320,7 +1320,7 @@ def traverse_CommandLineTool( for inp in clt.inputs: if not skip_command_line1 and inp.inputBinding and inp.inputBinding.valueFrom: expression = get_expression( - inp.inputBinding.valueFrom, inputs, example_input(inp.type) + inp.inputBinding.valueFrom, inputs, example_input(inp.type_) ) if expression: modified = True @@ -1332,7 +1332,7 @@ def traverse_CommandLineTool( ) inp.inputBinding.valueFrom = f"$(inputs.{inp_id})" target_clt.inputs.append( - cwl.CommandInputParameter(id=inp_id, type=inp.type) + cwl.CommandInputParameter(id=inp_id, type_=inp.type_) ) step.in_.append( cwl.WorkflowStepInput(id=inp_id, source=f"{etool_id}/result") @@ -1346,7 +1346,7 @@ def traverse_CommandLineTool( inp_id = "_{}_glob".format(outp.id.split("#")[-1]) etool_id = f"_expression_{step_id}{inp_id}" glob_target_type = ["string", cwl.ArraySchema("string", "array")] - target = cwl.InputParameter(id=None, type=glob_target_type) + target = cwl.InputParameter(id=None, type_=glob_target_type) replace_step_clt_expr_with_etool( expression, etool_id, parent, target, step, replace_etool ) @@ -1354,7 +1354,7 @@ def traverse_CommandLineTool( target_clt.inputs.append( cwl.CommandInputParameter( id=inp_id, - type=glob_target_type, + type_=glob_target_type, ) ) step.in_.append( @@ -1384,13 +1384,13 @@ def traverse_CommandLineTool( ) self_type = cwl.InputParameter( id=None, - type=cwl.InputArraySchema("File", "array", None, None), + type_=cwl.InputArraySchema("File", "array", None, None), ) etool = generate_etool_from_expr( expression, outp, False, self_type, [clt, step, parent] ) if outp.outputBinding.loadContents: - etool.inputs[0].type.inputBinding = cwl.CommandLineBinding( + etool.inputs[0].type_.inputBinding = cwl.CommandLineBinding( loadContents=True ) etool.inputs.extend(cltool_inputs_to_etool_inputs(clt)) @@ -1441,16 +1441,16 @@ def traverse_CommandLineTool( cwl.ExpressionToolOutputParameter, ), ): - new_outp.type = cwl.OutputArraySchema( - items="File", type="array" + new_outp.type_ = cwl.OutputArraySchema( + items="File", type_="array" ) elif isinstance(new_outp, cwl.CommandOutputParameter): if new_outp.outputBinding: new_outp.outputBinding.outputEval = None new_outp.outputBinding.loadContents = None - new_outp.type = cwl.CommandOutputArraySchema( + new_outp.type_ = cwl.CommandOutputArraySchema( items="File", - type="array", + type_="array", ) else: raise Exception( @@ -1645,7 +1645,7 @@ def cltool_inputs_to_etool_inputs( doc=clt_inp.doc, format=clt_inp.format, default=clt_inp.default, - type=clt_inp.type, + type_=clt_inp.type_, extension_fields=clt_inp.extension_fields, loadingOptions=clt_inp.loadingOptions, ) @@ -1683,7 +1683,7 @@ def cltool_step_outputs_to_workflow_outputs( doc=clt_out.doc, format=clt_out.format, outputSource=outputSource, - type=clt_out.type, + type_=clt_out.type_, extension_fields=clt_out.extension_fields, loadingOptions=clt_out.loadingOptions, ) @@ -1711,7 +1711,7 @@ def generate_etool_from_expr2( streamable=target.streamable, doc=target.doc, format=target.format, - type=target.type, + type_=target.type_, ) ) expression = "${" @@ -1789,9 +1789,9 @@ def traverse_step( ) if isinstance(scattered_source_type, list): for stype in scattered_source_type: - self.append(example_input(stype.type)) + self.append(example_input(stype.type_)) else: - self.append(example_input(scattered_source_type.type)) + self.append(example_input(scattered_source_type.type_)) else: if not step.scatter: self = example_input( @@ -1802,9 +1802,9 @@ def traverse_step( parent, inp.source ) if isinstance(scattered_source_type2, list): - self = example_input(scattered_source_type2[0].type) + self = example_input(scattered_source_type2[0].type_) else: - self = example_input(scattered_source_type2.type) + self = example_input(scattered_source_type2.type_) expression = get_expression(inp.valueFrom, inputs, self) if expression: modified = True @@ -1835,7 +1835,7 @@ def traverse_step( source_types.append(temp_type) source_type = cwl.InputParameter( id=None, - type=cwl.ArraySchema(source_types, "array"), + type_=cwl.ArraySchema(source_types, "array"), ) else: input_source_id = inp.source.split("#")[-1] @@ -1915,20 +1915,20 @@ def workflow_step_to_InputParameters( ) if isinstance(param, list): for p in param: - if not p.type: + if not p.type_: raise WorkflowException( f"Don't know how to get type id for {p!r}." ) p.id = inp_id - p.type = clean_type_ids(p.type) + p.type_ = clean_type_ids(p.type_) params.append(p) else: - if not param.type: + if not param.type_: raise WorkflowException( f"Don't know how to get type id for {param!r}." ) param.id = inp_id - param.type = clean_type_ids(param.type) + param.type_ = clean_type_ids(param.type_) params.append(param) return params @@ -1954,7 +1954,7 @@ def replace_step_valueFrom_expr_with_etool( original_step_ins, workflow, step_inp_id ) if source: - source_param = cwl.InputParameter(id="self", type="Any") + source_param = cwl.InputParameter(id="self", type_="Any") # TODO: would be nicer to derive a proper type; but in the face of linkMerge, this is easier for now etool_inputs.append(source_param) temp_etool = generate_etool_from_expr2( diff --git a/cwl_utils/cwl_v1_1_expression_refactor.py b/cwl_utils/cwl_v1_1_expression_refactor.py index 195039ff..801df8fc 100755 --- a/cwl_utils/cwl_v1_1_expression_refactor.py +++ b/cwl_utils/cwl_v1_1_expression_refactor.py @@ -35,7 +35,7 @@ def expand_stream_shortcuts(process: cwl.CommandLineTool) -> cwl.CommandLineTool return process result = None for index, output in enumerate(process.outputs): - if output.type == "stdout": # TODO: add 'stdin' for CWL v1.1 + if output.type_ == "stdout": # TODO: add 'stdin' for CWL v1.1 if not result: result = copy.deepcopy(process) stdout_path = process.stdout @@ -46,7 +46,7 @@ def expand_stream_shortcuts(process: cwl.CommandLineTool) -> cwl.CommandLineTool ).hexdigest() ) result.stdout = stdout_path - result.outputs[index].type = "File" + result.outputs[index].type_ = "File" output.outputBinding = cwl.CommandOutputBinding(stdout_path, None, None) if result: return result @@ -156,7 +156,7 @@ def etool_to_cltool( doc=inp.doc, format=inp.format, default=inp.default, - type=inp.type, + type_=inp.type_, extension_fields=inp.extension_fields, loadingOptions=inp.loadingOptions, ) @@ -171,7 +171,7 @@ def etool_to_cltool( streamable=outp.streamable, doc=outp.doc, format=outp.format, - type=outp.type, + type_=outp.type_, extension_fields=outp.extension_fields, loadingOptions=outp.loadingOptions, ) @@ -244,7 +244,7 @@ def traverse( doc=inp.doc, format=inp.format, default=inp.default, - type=inp.type, + type_=inp.type_, extension_fields=inp.extension_fields, loadingOptions=inp.loadingOptions, ) @@ -262,7 +262,7 @@ def traverse( doc=outp.doc, format=outp.format, outputSource=f"main/{outp_id}", - type=outp.type, + type_=outp.type_, extension_fields=outp.extension_fields, loadingOptions=outp.loadingOptions, ) @@ -346,9 +346,9 @@ def generate_etool_from_expr( new_type: Union[ List[Union[cwl.ArraySchema, cwl.InputRecordSchema]], Union[cwl.ArraySchema, cwl.InputRecordSchema], - ] = [clean_type_ids(t.type) for t in self_type] + ] = [clean_type_ids(t.type_) for t in self_type] else: - new_type = clean_type_ids(self_type.type) + new_type = clean_type_ids(self_type.type_) inputs.append( cwl.WorkflowInputParameter( id="self", @@ -361,7 +361,7 @@ def generate_etool_from_expr( else None, doc=self_type.doc if not isinstance(self_type, list) else None, format=self_type.format if not isinstance(self_type, list) else None, - type=new_type, + type_=new_type, extension_fields=self_type.extension_fields if not isinstance(self_type, list) else None, @@ -379,7 +379,7 @@ def generate_etool_from_expr( streamable=target.streamable, doc=target.doc, format=target.format, - type=target.type, + type_=target.type_, extension_fields=target.extension_fields, loadingOptions=target.loadingOptions, ) @@ -525,7 +525,7 @@ def empty_inputs( result = {} if isinstance(process_or_step, cwl.Process): for param in process_or_step.inputs: - result[param.id.split("#")[-1]] = example_input(param.type) + result[param.id.split("#")[-1]] = example_input(param.type_) else: for param in process_or_step.in_: param_id = param.id.split("/")[-1] @@ -681,7 +681,7 @@ def process_workflow_reqs_and_hints( modified = True target = cwl.WorkflowInputParameter( id=None, - type="string", + type_="string", ) etool_id = ( "_expression_workflow_EnvVarRequirement_{}".format( @@ -710,7 +710,7 @@ def process_workflow_reqs_and_hints( expression = get_expression(this_attr, inputs, None) if expression: modified = True - target = cwl.WorkflowInputParameter(id=None, type="long") + target = cwl.WorkflowInputParameter(id=None, type_="long") etool_id = ( "_expression_workflow_ResourceRequirement_{}".format( attr @@ -739,7 +739,7 @@ def process_workflow_reqs_and_hints( modified = True target = cwl.WorkflowInputParameter( id=None, - type=cwl.InputArraySchema( + type_=cwl.InputArraySchema( ["File", "Directory"], "array", None, None ), ) @@ -765,7 +765,7 @@ def process_workflow_reqs_and_hints( modified = True target = cwl.WorkflowInputParameter( id=None, - type=cwl.InputArraySchema( + type_=cwl.InputArraySchema( ["File", "Directory"], "array", None, None ), ) @@ -808,7 +808,7 @@ def process_workflow_reqs_and_hints( ): target = cwl.WorkflowInputParameter( id=None, - type=expr_result["class"], + type_=expr_result["class"], ) replace_expr_with_etool( expr, @@ -829,7 +829,7 @@ def process_workflow_reqs_and_hints( elif isinstance(expr_result, str): target = cwl.WorkflowInputParameter( id=None, - type=["File"], + type_=["File"], ) if entry.entryname is None: raise SourceLine( @@ -872,7 +872,7 @@ def process_workflow_reqs_and_hints( modified = True target = cwl.WorkflowInputParameter( id=None, - type="string", + type_="string", ) etool_id = "_expression_workflow_InitialWorkDirRequirement_{}".format( index @@ -1002,7 +1002,7 @@ def process_level_reqs( expression = get_expression(envDef.envValue, inputs, None) if expression: modified = True - target = cwl.WorkflowInputParameter(id=None, type="string") + target = cwl.WorkflowInputParameter(id=None, type_="string") etool_id = "_expression_{}_EnvVarRequirement_{}".format( step_name, env_index ) @@ -1026,7 +1026,7 @@ def process_level_reqs( expression = get_expression(this_attr, inputs, None) if expression: modified = True - target = cwl.WorkflowInputParameter(id=None, type="long") + target = cwl.WorkflowInputParameter(id=None, type_="long") etool_id = "_expression_{}_ResourceRequirement_{}".format( step_name, attr ) @@ -1053,7 +1053,7 @@ def process_level_reqs( target_type = cwl.InputArraySchema( ["File", "Directory"], "array", None, None ) - target = cwl.WorkflowInputParameter(id=None, type=target_type) + target = cwl.WorkflowInputParameter(id=None, type_=target_type) etool_id = "_expression_{}_InitialWorkDirRequirement".format( step_name ) @@ -1091,7 +1091,7 @@ def process_level_reqs( ) target = cwl.WorkflowInputParameter( id=None, - type=target_type, + type_=target_type, ) etool_id = ( "_expression_{}_InitialWorkDirRequirement_{}".format( @@ -1148,7 +1148,7 @@ def process_level_reqs( d_target_type = ["File", "Directory"] target = cwl.WorkflowInputParameter( id=None, - type=d_target_type, + type_=d_target_type, ) etool_id = "_expression_{}_InitialWorkDirRequirement_{}".format( step_name, listing_index @@ -1178,7 +1178,7 @@ def process_level_reqs( modified = True target = cwl.WorkflowInputParameter( id=None, - type="string", + type_="string", ) etool_id = "_expression_{}_InitialWorkDirRequirement_{}".format( step_name, listing_index @@ -1223,7 +1223,7 @@ def add_input_to_process( process.inputs.append( cwl.CommandInputParameter( id=name, - type=inptype, + type_=inptype, loadingOptions=loadingOptions, ) ) @@ -1254,7 +1254,7 @@ def traverse_CommandLineTool( inp_id = f"_arguments_{index}" etool_id = f"_expression_{step_id}{inp_id}" target_type = "Any" - target = cwl.WorkflowInputParameter(id=None, type=target_type) + target = cwl.WorkflowInputParameter(id=None, type_=target_type) replace_step_clt_expr_with_etool( expression, etool_id, parent, target, step, replace_etool ) @@ -1264,7 +1264,7 @@ def traverse_CommandLineTool( target_clt.inputs.append( cwl.CommandInputParameter( id=inp_id, - type=target_type, + type_=target_type, ) ) step.in_.append( @@ -1280,7 +1280,7 @@ def traverse_CommandLineTool( inp_id = f"_arguments_{index}" etool_id = f"_expression_{step_id}{inp_id}" target_type = "Any" - target = cwl.WorkflowInputParameter(id=None, type=target_type) + target = cwl.WorkflowInputParameter(id=None, type_=target_type) replace_step_clt_expr_with_etool( expression, etool_id, parent, target, step, replace_etool ) @@ -1290,7 +1290,7 @@ def traverse_CommandLineTool( target_clt.inputs.append( cwl.CommandInputParameter( id=inp_id, - type=target_type, + type_=target_type, ) ) step.in_.append( @@ -1306,13 +1306,13 @@ def traverse_CommandLineTool( inp_id = f"_{streamtype}" etool_id = f"_expression_{step_id}{inp_id}" target_type = "string" - target = cwl.WorkflowInputParameter(id=None, type=target_type) + target = cwl.WorkflowInputParameter(id=None, type_=target_type) replace_step_clt_expr_with_etool( expression, etool_id, parent, target, step, replace_etool ) setattr(target_clt, streamtype, f"$(inputs.{inp_id})") target_clt.inputs.append( - cwl.CommandInputParameter(id=inp_id, type=target_type) + cwl.CommandInputParameter(id=inp_id, type_=target_type) ) step.in_.append( cwl.WorkflowStepInput(id=inp_id, source=f"{etool_id}/result") @@ -1320,7 +1320,7 @@ def traverse_CommandLineTool( for inp in clt.inputs: if not skip_command_line1 and inp.inputBinding and inp.inputBinding.valueFrom: expression = get_expression( - inp.inputBinding.valueFrom, inputs, example_input(inp.type) + inp.inputBinding.valueFrom, inputs, example_input(inp.type_) ) if expression: modified = True @@ -1332,7 +1332,7 @@ def traverse_CommandLineTool( ) inp.inputBinding.valueFrom = f"$(inputs.{inp_id})" target_clt.inputs.append( - cwl.CommandInputParameter(id=inp_id, type=inp.type) + cwl.CommandInputParameter(id=inp_id, type_=inp.type_) ) step.in_.append( cwl.WorkflowStepInput(id=inp_id, source=f"{etool_id}/result") @@ -1346,7 +1346,7 @@ def traverse_CommandLineTool( inp_id = "_{}_glob".format(outp.id.split("#")[-1]) etool_id = f"_expression_{step_id}{inp_id}" glob_target_type = ["string", cwl.ArraySchema("string", "array")] - target = cwl.WorkflowInputParameter(id=None, type=glob_target_type) + target = cwl.WorkflowInputParameter(id=None, type_=glob_target_type) replace_step_clt_expr_with_etool( expression, etool_id, parent, target, step, replace_etool ) @@ -1354,7 +1354,7 @@ def traverse_CommandLineTool( target_clt.inputs.append( cwl.CommandInputParameter( id=inp_id, - type=glob_target_type, + type_=glob_target_type, ) ) step.in_.append( @@ -1384,13 +1384,13 @@ def traverse_CommandLineTool( ) self_type = cwl.WorkflowInputParameter( id=None, - type=cwl.InputArraySchema("File", "array", None, None), + type_=cwl.InputArraySchema("File", "array", None, None), ) etool = generate_etool_from_expr( expression, outp, False, self_type, [clt, step, parent] ) if outp.outputBinding.loadContents: - etool.inputs[0].type.inputBinding = cwl.CommandLineBinding( + etool.inputs[0].type_.inputBinding = cwl.CommandLineBinding( loadContents=True ) etool.inputs.extend(cltool_inputs_to_etool_inputs(clt)) @@ -1441,16 +1441,16 @@ def traverse_CommandLineTool( cwl.ExpressionToolOutputParameter, ), ): - new_outp.type = cwl.OutputArraySchema( - items="File", type="array" + new_outp.type_ = cwl.OutputArraySchema( + items="File", type_="array" ) elif isinstance(new_outp, cwl.CommandOutputParameter): if new_outp.outputBinding: new_outp.outputBinding.outputEval = None new_outp.outputBinding.loadContents = None - new_outp.type = cwl.CommandOutputArraySchema( + new_outp.type_ = cwl.CommandOutputArraySchema( items="File", - type="array", + type_="array", ) else: raise Exception( @@ -1645,7 +1645,7 @@ def cltool_inputs_to_etool_inputs( doc=clt_inp.doc, format=clt_inp.format, default=clt_inp.default, - type=clt_inp.type, + type_=clt_inp.type_, extension_fields=clt_inp.extension_fields, loadingOptions=clt_inp.loadingOptions, ) @@ -1683,7 +1683,7 @@ def cltool_step_outputs_to_workflow_outputs( doc=clt_out.doc, format=clt_out.format, outputSource=outputSource, - type=clt_out.type, + type_=clt_out.type_, extension_fields=clt_out.extension_fields, loadingOptions=clt_out.loadingOptions, ) @@ -1711,7 +1711,7 @@ def generate_etool_from_expr2( streamable=target.streamable, doc=target.doc, format=target.format, - type=target.type, + type_=target.type_, ) ) expression = "${" @@ -1789,9 +1789,9 @@ def traverse_step( ) if isinstance(scattered_source_type, list): for stype in scattered_source_type: - self.append(example_input(stype.type)) + self.append(example_input(stype.type_)) else: - self.append(example_input(scattered_source_type.type)) + self.append(example_input(scattered_source_type.type_)) else: if not step.scatter: self = example_input( @@ -1802,9 +1802,9 @@ def traverse_step( parent, inp.source ) if isinstance(scattered_source_type2, list): - self = example_input(scattered_source_type2[0].type) + self = example_input(scattered_source_type2[0].type_) else: - self = example_input(scattered_source_type2.type) + self = example_input(scattered_source_type2.type_) expression = get_expression(inp.valueFrom, inputs, self) if expression: modified = True @@ -1835,7 +1835,7 @@ def traverse_step( source_types.append(temp_type) source_type = cwl.WorkflowInputParameter( id=None, - type=cwl.ArraySchema(source_types, "array"), + type_=cwl.ArraySchema(source_types, "array"), ) else: input_source_id = inp.source.split("#")[-1] @@ -1916,11 +1916,11 @@ def workflow_step_to_WorkflowInputParameters( if isinstance(param, list): for p in param: p.id = inp_id - p.type = clean_type_ids(p.type) + p.type_ = clean_type_ids(p.type_) params.append(p) else: param.id = inp_id - param.type = clean_type_ids(param.type) + param.type_ = clean_type_ids(param.type_) params.append(param) return params @@ -1948,7 +1948,7 @@ def replace_step_valueFrom_expr_with_etool( original_step_ins, workflow, step_inp_id ) if source: - source_param = cwl.WorkflowInputParameter(id="self", type="Any") + source_param = cwl.WorkflowInputParameter(id="self", type_="Any") # TODO: would be nicer to derive a proper type; but in the face of linkMerge, this is easier for now etool_inputs.append(source_param) temp_etool = generate_etool_from_expr2( diff --git a/cwl_utils/cwl_v1_2_expression_refactor.py b/cwl_utils/cwl_v1_2_expression_refactor.py index a7928fa5..7f7d2dc3 100755 --- a/cwl_utils/cwl_v1_2_expression_refactor.py +++ b/cwl_utils/cwl_v1_2_expression_refactor.py @@ -35,7 +35,7 @@ def expand_stream_shortcuts(process: cwl.CommandLineTool) -> cwl.CommandLineTool return process result = None for index, output in enumerate(process.outputs): - if output.type == "stdout": # TODO: add 'stdin' for CWL v1.1 + if output.type_ == "stdout": # TODO: add 'stdin' for CWL v1.1 if not result: result = copy.deepcopy(process) stdout_path = process.stdout @@ -46,7 +46,7 @@ def expand_stream_shortcuts(process: cwl.CommandLineTool) -> cwl.CommandLineTool ).hexdigest() ) result.stdout = stdout_path - result.outputs[index].type = "File" + result.outputs[index].type_ = "File" output.outputBinding = cwl.CommandOutputBinding(stdout_path, None, None) if result: return result @@ -156,7 +156,7 @@ def etool_to_cltool( doc=inp.doc, format=inp.format, default=inp.default, - type=inp.type, + type_=inp.type_, extension_fields=inp.extension_fields, loadingOptions=inp.loadingOptions, ) @@ -171,7 +171,7 @@ def etool_to_cltool( streamable=outp.streamable, doc=outp.doc, format=outp.format, - type=outp.type, + type_=outp.type_, extension_fields=outp.extension_fields, loadingOptions=outp.loadingOptions, ) @@ -244,7 +244,7 @@ def traverse( doc=inp.doc, format=inp.format, default=inp.default, - type=inp.type, + type_=inp.type_, extension_fields=inp.extension_fields, loadingOptions=inp.loadingOptions, ) @@ -262,7 +262,7 @@ def traverse( doc=outp.doc, format=outp.format, outputSource=f"main/{outp_id}", - type=outp.type, + type_=outp.type_, extension_fields=outp.extension_fields, loadingOptions=outp.loadingOptions, ) @@ -346,9 +346,9 @@ def generate_etool_from_expr( new_type: Union[ List[Union[cwl.ArraySchema, cwl.InputRecordSchema]], Union[cwl.ArraySchema, cwl.InputRecordSchema], - ] = [clean_type_ids(t.type) for t in self_type] + ] = [clean_type_ids(t.type_) for t in self_type] else: - new_type = clean_type_ids(self_type.type) + new_type = clean_type_ids(self_type.type_) inputs.append( cwl.WorkflowInputParameter( id="self", @@ -361,7 +361,7 @@ def generate_etool_from_expr( else None, doc=self_type.doc if not isinstance(self_type, list) else None, format=self_type.format if not isinstance(self_type, list) else None, - type=new_type, + type_=new_type, extension_fields=self_type.extension_fields if not isinstance(self_type, list) else None, @@ -379,7 +379,7 @@ def generate_etool_from_expr( streamable=target.streamable, doc=target.doc, format=target.format, - type=target.type, + type_=target.type_, extension_fields=target.extension_fields, loadingOptions=target.loadingOptions, ) @@ -525,7 +525,7 @@ def empty_inputs( result = {} if isinstance(process_or_step, cwl.Process): for param in process_or_step.inputs: - result[param.id.split("#")[-1]] = example_input(param.type) + result[param.id.split("#")[-1]] = example_input(param.type_) else: for param in process_or_step.in_: param_id = param.id.split("/")[-1] @@ -697,10 +697,10 @@ def process_workflow_inputs_and_outputs( etool_id = "_pickValue_workflow_step_{}".format( param2.id.split("#")[-1] ) - target_type = copy.deepcopy(param2.type) + target_type = copy.deepcopy(param2.type_) if isinstance(target_type, cwl.OutputArraySchema): target_type.name = None - target = cwl.WorkflowInputParameter(id=None, type=target_type) + target = cwl.WorkflowInputParameter(id=None, type_=target_type) if not isinstance(param2.outputSource, list): sources = param2.outputSource.split("#")[-1] else: @@ -717,7 +717,7 @@ def process_workflow_inputs_and_outputs( source_type_items.append("null") elif source_type_items != "null": source_type_items = ["null", source_type_items] - source_type = cwl.CommandInputParameter(type=source_type_items) + source_type = cwl.CommandInputParameter(type_=source_type_items) replace_expr_with_etool( expression, etool_id, @@ -776,7 +776,7 @@ def process_workflow_reqs_and_hints( modified = True target = cwl.WorkflowInputParameter( id=None, - type="string", + type_="string", ) etool_id = ( "_expression_workflow_EnvVarRequirement_{}".format( @@ -805,7 +805,7 @@ def process_workflow_reqs_and_hints( expression = get_expression(this_attr, inputs, None) if expression: modified = True - target = cwl.WorkflowInputParameter(id=None, type="long") + target = cwl.WorkflowInputParameter(id=None, type_="long") etool_id = ( "_expression_workflow_ResourceRequirement_{}".format( attr @@ -834,7 +834,7 @@ def process_workflow_reqs_and_hints( modified = True target = cwl.WorkflowInputParameter( id=None, - type=cwl.InputArraySchema( + type_=cwl.InputArraySchema( ["File", "Directory"], "array", None, None ), ) @@ -860,7 +860,7 @@ def process_workflow_reqs_and_hints( modified = True target = cwl.WorkflowInputParameter( id=None, - type=cwl.InputArraySchema( + type_=cwl.InputArraySchema( ["File", "Directory"], "array", None, None ), ) @@ -903,7 +903,7 @@ def process_workflow_reqs_and_hints( ): target = cwl.WorkflowInputParameter( id=None, - type=expr_result["class"], + type_=expr_result["class"], ) replace_expr_with_etool( expr, @@ -924,7 +924,7 @@ def process_workflow_reqs_and_hints( elif isinstance(expr_result, str): target = cwl.WorkflowInputParameter( id=None, - type=["File"], + type_=["File"], ) if entry.entryname is None: raise SourceLine( @@ -967,7 +967,7 @@ def process_workflow_reqs_and_hints( modified = True target = cwl.WorkflowInputParameter( id=None, - type="string", + type_="string", ) etool_id = "_expression_workflow_InitialWorkDirRequirement_{}".format( index @@ -1097,7 +1097,7 @@ def process_level_reqs( expression = get_expression(envDef.envValue, inputs, None) if expression: modified = True - target = cwl.WorkflowInputParameter(id=None, type="string") + target = cwl.WorkflowInputParameter(id=None, type_="string") etool_id = "_expression_{}_EnvVarRequirement_{}".format( step_name, env_index ) @@ -1121,7 +1121,7 @@ def process_level_reqs( expression = get_expression(this_attr, inputs, None) if expression: modified = True - target = cwl.WorkflowInputParameter(id=None, type="long") + target = cwl.WorkflowInputParameter(id=None, type_="long") etool_id = "_expression_{}_ResourceRequirement_{}".format( step_name, attr ) @@ -1148,7 +1148,7 @@ def process_level_reqs( target_type = cwl.InputArraySchema( ["File", "Directory"], "array", None, None ) - target = cwl.WorkflowInputParameter(id=None, type=target_type) + target = cwl.WorkflowInputParameter(id=None, type_=target_type) etool_id = "_expression_{}_InitialWorkDirRequirement".format( step_name ) @@ -1186,7 +1186,7 @@ def process_level_reqs( ) target = cwl.WorkflowInputParameter( id=None, - type=target_type, + type_=target_type, ) etool_id = ( "_expression_{}_InitialWorkDirRequirement_{}".format( @@ -1243,7 +1243,7 @@ def process_level_reqs( d_target_type = ["File", "Directory"] target = cwl.WorkflowInputParameter( id=None, - type=d_target_type, + type_=d_target_type, ) etool_id = "_expression_{}_InitialWorkDirRequirement_{}".format( step_name, listing_index @@ -1273,7 +1273,7 @@ def process_level_reqs( modified = True target = cwl.WorkflowInputParameter( id=None, - type="string", + type_="string", ) etool_id = "_expression_{}_InitialWorkDirRequirement_{}".format( step_name, listing_index @@ -1318,7 +1318,7 @@ def add_input_to_process( process.inputs.append( cwl.CommandInputParameter( id=name, - type=inptype, + type_=inptype, loadingOptions=loadingOptions, ) ) @@ -1349,7 +1349,7 @@ def traverse_CommandLineTool( inp_id = f"_arguments_{index}" etool_id = f"_expression_{step_id}{inp_id}" target_type = "Any" - target = cwl.WorkflowInputParameter(id=None, type=target_type) + target = cwl.WorkflowInputParameter(id=None, type_=target_type) replace_step_clt_expr_with_etool( expression, etool_id, parent, target, step, replace_etool ) @@ -1359,7 +1359,7 @@ def traverse_CommandLineTool( target_clt.inputs.append( cwl.CommandInputParameter( id=inp_id, - type=target_type, + type_=target_type, ) ) step.in_.append( @@ -1375,7 +1375,7 @@ def traverse_CommandLineTool( inp_id = f"_arguments_{index}" etool_id = f"_expression_{step_id}{inp_id}" target_type = "Any" - target = cwl.WorkflowInputParameter(id=None, type=target_type) + target = cwl.WorkflowInputParameter(id=None, type_=target_type) replace_step_clt_expr_with_etool( expression, etool_id, parent, target, step, replace_etool ) @@ -1385,7 +1385,7 @@ def traverse_CommandLineTool( target_clt.inputs.append( cwl.CommandInputParameter( id=inp_id, - type=target_type, + type_=target_type, ) ) step.in_.append( @@ -1401,13 +1401,13 @@ def traverse_CommandLineTool( inp_id = f"_{streamtype}" etool_id = f"_expression_{step_id}{inp_id}" target_type = "string" - target = cwl.WorkflowInputParameter(id=None, type=target_type) + target = cwl.WorkflowInputParameter(id=None, type_=target_type) replace_step_clt_expr_with_etool( expression, etool_id, parent, target, step, replace_etool ) setattr(target_clt, streamtype, f"$(inputs.{inp_id})") target_clt.inputs.append( - cwl.CommandInputParameter(id=inp_id, type=target_type) + cwl.CommandInputParameter(id=inp_id, type_=target_type) ) step.in_.append( cwl.WorkflowStepInput(id=inp_id, source=f"{etool_id}/result") @@ -1415,7 +1415,7 @@ def traverse_CommandLineTool( for inp in clt.inputs: if not skip_command_line1 and inp.inputBinding and inp.inputBinding.valueFrom: expression = get_expression( - inp.inputBinding.valueFrom, inputs, example_input(inp.type) + inp.inputBinding.valueFrom, inputs, example_input(inp.type_) ) if expression: modified = True @@ -1427,7 +1427,7 @@ def traverse_CommandLineTool( ) inp.inputBinding.valueFrom = f"$(inputs.{inp_id})" target_clt.inputs.append( - cwl.CommandInputParameter(id=inp_id, type=inp.type) + cwl.CommandInputParameter(id=inp_id, type_=inp.type_) ) step.in_.append( cwl.WorkflowStepInput(id=inp_id, source=f"{etool_id}/result") @@ -1441,7 +1441,7 @@ def traverse_CommandLineTool( inp_id = "_{}_glob".format(outp.id.split("#")[-1]) etool_id = f"_expression_{step_id}{inp_id}" glob_target_type = ["string", cwl.ArraySchema("string", "array")] - target = cwl.WorkflowInputParameter(id=None, type=glob_target_type) + target = cwl.WorkflowInputParameter(id=None, type_=glob_target_type) replace_step_clt_expr_with_etool( expression, etool_id, parent, target, step, replace_etool ) @@ -1449,7 +1449,7 @@ def traverse_CommandLineTool( target_clt.inputs.append( cwl.CommandInputParameter( id=inp_id, - type=glob_target_type, + type_=glob_target_type, ) ) step.in_.append( @@ -1479,13 +1479,13 @@ def traverse_CommandLineTool( ) self_type = cwl.WorkflowInputParameter( id=None, - type=cwl.InputArraySchema("File", "array", None, None), + type_=cwl.InputArraySchema("File", "array", None, None), ) etool = generate_etool_from_expr( expression, outp, False, self_type, [clt, step, parent] ) if outp.outputBinding.loadContents: - etool.inputs[0].type.inputBinding = cwl.CommandLineBinding( + etool.inputs[0].type_.inputBinding = cwl.CommandLineBinding( loadContents=True ) etool.inputs.extend(cltool_inputs_to_etool_inputs(clt)) @@ -1536,16 +1536,16 @@ def traverse_CommandLineTool( cwl.ExpressionToolOutputParameter, ), ): - new_outp.type = cwl.OutputArraySchema( - items="File", type="array" + new_outp.type_ = cwl.OutputArraySchema( + items="File", type_="array" ) elif isinstance(new_outp, cwl.CommandOutputParameter): if new_outp.outputBinding: new_outp.outputBinding.outputEval = None new_outp.outputBinding.loadContents = None - new_outp.type = cwl.CommandOutputArraySchema( + new_outp.type_ = cwl.CommandOutputArraySchema( items="File", - type="array", + type_="array", ) else: raise Exception( @@ -1740,7 +1740,7 @@ def cltool_inputs_to_etool_inputs( doc=clt_inp.doc, format=clt_inp.format, default=clt_inp.default, - type=clt_inp.type, + type_=clt_inp.type_, extension_fields=clt_inp.extension_fields, loadingOptions=clt_inp.loadingOptions, ) @@ -1778,7 +1778,7 @@ def cltool_step_outputs_to_workflow_outputs( doc=clt_out.doc, format=clt_out.format, outputSource=outputSource, - type=clt_out.type, + type_=clt_out.type_, extension_fields=clt_out.extension_fields, loadingOptions=clt_out.loadingOptions, ) @@ -1806,7 +1806,7 @@ def generate_etool_from_expr2( streamable=target.streamable, doc=target.doc, format=target.format, - type=target.type, + type_=target.type_, ) ) expression = "${" @@ -1884,9 +1884,9 @@ def traverse_step( ) if isinstance(scattered_source_type, list): for stype in scattered_source_type: - self.append(example_input(stype.type)) + self.append(example_input(stype.type_)) else: - self.append(example_input(scattered_source_type.type)) + self.append(example_input(scattered_source_type.type_)) else: if not step.scatter: self = example_input( @@ -1897,9 +1897,9 @@ def traverse_step( parent, inp.source ) if isinstance(scattered_source_type2, list): - self = example_input(scattered_source_type2[0].type) + self = example_input(scattered_source_type2[0].type_) else: - self = example_input(scattered_source_type2.type) + self = example_input(scattered_source_type2.type_) expression = get_expression(inp.valueFrom, inputs, self) if expression: modified = True @@ -1930,7 +1930,7 @@ def traverse_step( source_types.append(temp_type) source_type = cwl.WorkflowInputParameter( id=None, - type=cwl.ArraySchema(source_types, "array"), + type_=cwl.ArraySchema(source_types, "array"), ) else: input_source_id = inp.source.split("#")[-1] @@ -2019,11 +2019,11 @@ def workflow_step_to_WorkflowInputParameters( if isinstance(param, list): for p in param: p.id = inp_id - p.type = clean_type_ids(p.type) + p.type_ = clean_type_ids(p.type_) params.append(p) else: param.id = inp_id - param.type = clean_type_ids(param.type) + param.type_ = clean_type_ids(param.type_) params.append(param) return params @@ -2051,7 +2051,7 @@ def replace_step_valueFrom_expr_with_etool( original_step_ins, workflow, step_inp_id ) if source: - source_param = cwl.WorkflowInputParameter(id="self", type="Any") + source_param = cwl.WorkflowInputParameter(id="self", type_="Any") # TODO: would be nicer to derive a proper type; but in the face of linkMerge, this is easier for now etool_inputs.append(source_param) temp_etool = generate_etool_from_expr2( @@ -2130,7 +2130,7 @@ def replace_step_when_expr_with_etool( ) temp_etool = generate_etool_from_expr2( expr, - cwl.WorkflowInputParameter(id=None, type="boolean"), + cwl.WorkflowInputParameter(id=None, type_="boolean"), etool_inputs, None, None, diff --git a/cwl_utils/parser/cwl_v1_0.py b/cwl_utils/parser/cwl_v1_0.py index d01d07b4..2d1c6e0d 100644 --- a/cwl_utils/parser/cwl_v1_0.py +++ b/cwl_utils/parser/cwl_v1_0.py @@ -61,6 +61,7 @@ class LoadingOptions: imports: List[str] includes: List[str] no_link_check: Optional[bool] + container: Optional[str] def __init__( self, @@ -75,7 +76,8 @@ def __init__( idx: Optional[IdxType] = None, imports: Optional[List[str]] = None, includes: Optional[List[str]] = None, - no_link_check: bool = False, + no_link_check: Optional[bool] = None, + container: Optional[str] = None, ) -> None: """Create a LoadingOptions object.""" self.original_doc = original_doc @@ -120,7 +122,15 @@ def __init__( else: self.includes = copyfrom.includes if copyfrom is not None else [] - self.no_link_check = no_link_check + if no_link_check is not None: + self.no_link_check = no_link_check + else: + self.no_link_check = copyfrom.no_link_check if copyfrom is not None else False + + if container is not None: + self.container = container + else: + self.container = copyfrom.container if copyfrom is not None else None if fetcher is not None: self.fetcher = fetcher @@ -462,9 +472,8 @@ def __repr__(self) -> str: class _ArrayLoader(_Loader): - def __init__(self, items: _Loader, flatten: bool = True) -> None: + def __init__(self, items: _Loader) -> None: self.items = items - self.flatten = flatten def load( self, @@ -487,7 +496,8 @@ def load( lf = load_field( doc[i], _UnionLoader(([self, self.items])), baseuri, loadingOptions, lc=lc ) - if self.flatten and isinstance(lf, MutableSequence): + flatten = loadingOptions.container != "@list" + if flatten and isinstance(lf, MutableSequence): r.extend(lf) else: r.append(lf) @@ -519,9 +529,17 @@ def __repr__(self) -> str: class _MapLoader(_Loader): - def __init__(self, values: _Loader, name: Optional[str] = None) -> None: + def __init__( + self, + values: _Loader, + name: Optional[str] = None, + container: Optional[str] = None, + no_link_check: Optional[bool] = None, + ) -> None: self.values = values self.name = name + self.container = container + self.no_link_check = no_link_check def load( self, @@ -533,6 +551,10 @@ def load( ) -> Any: if not isinstance(doc, MutableMapping): raise ValidationException(f"Expected a map, was {type(doc)}") + if self.container is not None or self.no_link_check is not None: + loadingOptions = LoadingOptions( + copyfrom=loadingOptions, container=self.container, no_link_check=self.no_link_check + ) r: Dict[str, Any] = {} errors: List[SchemaSaladException] = [] for k, v in doc.items(): @@ -643,8 +665,15 @@ def load( class _RecordLoader(_Loader): - def __init__(self, classtype: Type[Saveable]) -> None: + def __init__( + self, + classtype: Type[Saveable], + container: Optional[str] = None, + no_link_check: Optional[bool] = None, + ) -> None: self.classtype = classtype + self.container = container + self.no_link_check = no_link_check def load( self, @@ -659,6 +688,10 @@ def load( f"Value is a {convert_typing(extract_type(type(doc)))}, " f"but valid type for this field is an object." ) + if self.container is not None or self.no_link_check is not None: + loadingOptions = LoadingOptions( + copyfrom=loadingOptions, container=self.container, no_link_check=self.no_link_check + ) return self.classtype.fromDoc(doc, baseuri, loadingOptions, docRoot=docRoot) def __repr__(self) -> str: @@ -1837,7 +1870,6 @@ def __init__( self, items: Any, type_: Any, - flatten: Optional[Any] = None, extension_fields: Optional[Dict[str, Any]] = None, loadingOptions: Optional[LoadingOptions] = None, ) -> None: @@ -1849,21 +1881,16 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.flatten = flatten self.items = items self.type_ = type_ def __eq__(self, other: Any) -> bool: if isinstance(other, ArraySchema): - return bool( - self.flatten == other.flatten - and self.items == other.items - and self.type_ == other.type_ - ) + return bool(self.items == other.items and self.type_ == other.type_) return False def __hash__(self) -> int: - return hash((self.flatten, self.items, self.type_)) + return hash((self.items, self.type_)) @classmethod def fromDoc( @@ -1879,48 +1906,6 @@ def fromDoc( _doc.lc.data = doc.lc.data _doc.lc.filename = doc.lc.filename _errors__ = [] - if "flatten" in _doc: - try: - flatten = load_field( - _doc.get("flatten"), - uri_union_of_None_type_or_booltype_False_True_2_None, - baseuri, - loadingOptions, - lc=_doc.get("flatten") - ) - - except ValidationException as e: - error_message, to_print, verb_tensage = parse_errors(str(e)) - - if str(e) == "missing required field `flatten`": - _errors__.append( - ValidationException( - str(e), - None - ) - ) - else: - if error_message != str(e): - val_type = convert_typing(extract_type(type(_doc.get("flatten")))) - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [ValidationException(f"Value is a {val_type}, " - f"but valid {to_print} for this field " - f"{verb_tensage} {error_message}")], - ) - ) - else: - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [e], - ) - ) - else: - flatten = None try: if _doc.get("items") is None: raise ValidationException("missing required field `items`", None, []) @@ -2020,7 +2005,7 @@ def fromDoc( else: _errors__.append( ValidationException( - "invalid field `{}`, expected one of: `flatten`, `items`, `type`".format( + "invalid field `{}`, expected one of: `items`, `type`".format( k ), SourceLine(_doc, k, str), @@ -2030,7 +2015,6 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - flatten=flatten, items=items, type_=type_, extension_fields=extension_fields, @@ -2049,9 +2033,6 @@ def save( else: for ef in self.extension_fields: r[ef] = self.extension_fields[ef] - if self.flatten is not None: - u = save_relative_uri(self.flatten, base_url, False, 2, relative_uris) - r["flatten"] = u if self.items is not None: u = save_relative_uri(self.items, base_url, False, 2, relative_uris) r["items"] = u @@ -2068,7 +2049,7 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["flatten", "items", "type"]) + attrs = frozenset(["items", "type"]) class MapSchema(Saveable): @@ -2450,7 +2431,6 @@ def __init__( self, items: Any, type_: Any, - flatten: Optional[Any] = None, extension_fields: Optional[Dict[str, Any]] = None, loadingOptions: Optional[LoadingOptions] = None, ) -> None: @@ -2462,21 +2442,16 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.flatten = flatten self.items = items self.type_ = type_ def __eq__(self, other: Any) -> bool: if isinstance(other, CWLArraySchema): - return bool( - self.flatten == other.flatten - and self.items == other.items - and self.type_ == other.type_ - ) + return bool(self.items == other.items and self.type_ == other.type_) return False def __hash__(self) -> int: - return hash((self.flatten, self.items, self.type_)) + return hash((self.items, self.type_)) @classmethod def fromDoc( @@ -2492,48 +2467,6 @@ def fromDoc( _doc.lc.data = doc.lc.data _doc.lc.filename = doc.lc.filename _errors__ = [] - if "flatten" in _doc: - try: - flatten = load_field( - _doc.get("flatten"), - uri_union_of_None_type_or_booltype_False_True_2_None, - baseuri, - loadingOptions, - lc=_doc.get("flatten") - ) - - except ValidationException as e: - error_message, to_print, verb_tensage = parse_errors(str(e)) - - if str(e) == "missing required field `flatten`": - _errors__.append( - ValidationException( - str(e), - None - ) - ) - else: - if error_message != str(e): - val_type = convert_typing(extract_type(type(_doc.get("flatten")))) - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [ValidationException(f"Value is a {val_type}, " - f"but valid {to_print} for this field " - f"{verb_tensage} {error_message}")], - ) - ) - else: - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [e], - ) - ) - else: - flatten = None try: if _doc.get("items") is None: raise ValidationException("missing required field `items`", None, []) @@ -2633,7 +2566,7 @@ def fromDoc( else: _errors__.append( ValidationException( - "invalid field `{}`, expected one of: `flatten`, `items`, `type`".format( + "invalid field `{}`, expected one of: `items`, `type`".format( k ), SourceLine(_doc, k, str), @@ -2643,7 +2576,6 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - flatten=flatten, items=items, type_=type_, extension_fields=extension_fields, @@ -2662,9 +2594,6 @@ def save( else: for ef in self.extension_fields: r[ef] = self.extension_fields[ef] - if self.flatten is not None: - u = save_relative_uri(self.flatten, base_url, False, 2, relative_uris) - r["flatten"] = u if self.items is not None: u = save_relative_uri(self.items, base_url, False, 2, relative_uris) r["items"] = u @@ -2681,7 +2610,7 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["flatten", "items", "type"]) + attrs = frozenset(["items", "type"]) class CWLRecordField(RecordField): @@ -5262,7 +5191,6 @@ def __init__( self, items: Any, type_: Any, - flatten: Optional[Any] = None, label: Optional[Any] = None, inputBinding: Optional[Any] = None, extension_fields: Optional[Dict[str, Any]] = None, @@ -5276,7 +5204,6 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.flatten = flatten self.items = items self.type_ = type_ self.label = label @@ -5285,8 +5212,7 @@ def __init__( def __eq__(self, other: Any) -> bool: if isinstance(other, InputArraySchema): return bool( - self.flatten == other.flatten - and self.items == other.items + self.items == other.items and self.type_ == other.type_ and self.label == other.label and self.inputBinding == other.inputBinding @@ -5294,9 +5220,7 @@ def __eq__(self, other: Any) -> bool: return False def __hash__(self) -> int: - return hash( - (self.flatten, self.items, self.type_, self.label, self.inputBinding) - ) + return hash((self.items, self.type_, self.label, self.inputBinding)) @classmethod def fromDoc( @@ -5312,48 +5236,6 @@ def fromDoc( _doc.lc.data = doc.lc.data _doc.lc.filename = doc.lc.filename _errors__ = [] - if "flatten" in _doc: - try: - flatten = load_field( - _doc.get("flatten"), - uri_union_of_None_type_or_booltype_False_True_2_None, - baseuri, - loadingOptions, - lc=_doc.get("flatten") - ) - - except ValidationException as e: - error_message, to_print, verb_tensage = parse_errors(str(e)) - - if str(e) == "missing required field `flatten`": - _errors__.append( - ValidationException( - str(e), - None - ) - ) - else: - if error_message != str(e): - val_type = convert_typing(extract_type(type(_doc.get("flatten")))) - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [ValidationException(f"Value is a {val_type}, " - f"but valid {to_print} for this field " - f"{verb_tensage} {error_message}")], - ) - ) - else: - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [e], - ) - ) - else: - flatten = None try: if _doc.get("items") is None: raise ValidationException("missing required field `items`", None, []) @@ -5537,7 +5419,7 @@ def fromDoc( else: _errors__.append( ValidationException( - "invalid field `{}`, expected one of: `flatten`, `items`, `type`, `label`, `inputBinding`".format( + "invalid field `{}`, expected one of: `items`, `type`, `label`, `inputBinding`".format( k ), SourceLine(_doc, k, str), @@ -5547,7 +5429,6 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - flatten=flatten, items=items, type_=type_, label=label, @@ -5568,9 +5449,6 @@ def save( else: for ef in self.extension_fields: r[ef] = self.extension_fields[ef] - if self.flatten is not None: - u = save_relative_uri(self.flatten, base_url, False, 2, relative_uris) - r["flatten"] = u if self.items is not None: u = save_relative_uri(self.items, base_url, False, 2, relative_uris) r["items"] = u @@ -5598,7 +5476,7 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["flatten", "items", "type", "label", "inputBinding"]) + attrs = frozenset(["items", "type", "label", "inputBinding"]) class OutputRecordField(CWLRecordField): @@ -6504,7 +6382,6 @@ def __init__( self, items: Any, type_: Any, - flatten: Optional[Any] = None, label: Optional[Any] = None, outputBinding: Optional[Any] = None, extension_fields: Optional[Dict[str, Any]] = None, @@ -6518,7 +6395,6 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.flatten = flatten self.items = items self.type_ = type_ self.label = label @@ -6527,8 +6403,7 @@ def __init__( def __eq__(self, other: Any) -> bool: if isinstance(other, OutputArraySchema): return bool( - self.flatten == other.flatten - and self.items == other.items + self.items == other.items and self.type_ == other.type_ and self.label == other.label and self.outputBinding == other.outputBinding @@ -6536,9 +6411,7 @@ def __eq__(self, other: Any) -> bool: return False def __hash__(self) -> int: - return hash( - (self.flatten, self.items, self.type_, self.label, self.outputBinding) - ) + return hash((self.items, self.type_, self.label, self.outputBinding)) @classmethod def fromDoc( @@ -6554,48 +6427,6 @@ def fromDoc( _doc.lc.data = doc.lc.data _doc.lc.filename = doc.lc.filename _errors__ = [] - if "flatten" in _doc: - try: - flatten = load_field( - _doc.get("flatten"), - uri_union_of_None_type_or_booltype_False_True_2_None, - baseuri, - loadingOptions, - lc=_doc.get("flatten") - ) - - except ValidationException as e: - error_message, to_print, verb_tensage = parse_errors(str(e)) - - if str(e) == "missing required field `flatten`": - _errors__.append( - ValidationException( - str(e), - None - ) - ) - else: - if error_message != str(e): - val_type = convert_typing(extract_type(type(_doc.get("flatten")))) - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [ValidationException(f"Value is a {val_type}, " - f"but valid {to_print} for this field " - f"{verb_tensage} {error_message}")], - ) - ) - else: - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [e], - ) - ) - else: - flatten = None try: if _doc.get("items") is None: raise ValidationException("missing required field `items`", None, []) @@ -6779,7 +6610,7 @@ def fromDoc( else: _errors__.append( ValidationException( - "invalid field `{}`, expected one of: `flatten`, `items`, `type`, `label`, `outputBinding`".format( + "invalid field `{}`, expected one of: `items`, `type`, `label`, `outputBinding`".format( k ), SourceLine(_doc, k, str), @@ -6789,7 +6620,6 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - flatten=flatten, items=items, type_=type_, label=label, @@ -6810,9 +6640,6 @@ def save( else: for ef in self.extension_fields: r[ef] = self.extension_fields[ef] - if self.flatten is not None: - u = save_relative_uri(self.flatten, base_url, False, 2, relative_uris) - r["flatten"] = u if self.items is not None: u = save_relative_uri(self.items, base_url, False, 2, relative_uris) r["items"] = u @@ -6840,7 +6667,7 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["flatten", "items", "type", "label", "outputBinding"]) + attrs = frozenset(["items", "type", "label", "outputBinding"]) class InputParameter(Parameter): @@ -10231,7 +10058,6 @@ def __init__( self, items: Any, type_: Any, - flatten: Optional[Any] = None, label: Optional[Any] = None, inputBinding: Optional[Any] = None, extension_fields: Optional[Dict[str, Any]] = None, @@ -10245,7 +10071,6 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.flatten = flatten self.items = items self.type_ = type_ self.label = label @@ -10254,8 +10079,7 @@ def __init__( def __eq__(self, other: Any) -> bool: if isinstance(other, CommandInputArraySchema): return bool( - self.flatten == other.flatten - and self.items == other.items + self.items == other.items and self.type_ == other.type_ and self.label == other.label and self.inputBinding == other.inputBinding @@ -10263,9 +10087,7 @@ def __eq__(self, other: Any) -> bool: return False def __hash__(self) -> int: - return hash( - (self.flatten, self.items, self.type_, self.label, self.inputBinding) - ) + return hash((self.items, self.type_, self.label, self.inputBinding)) @classmethod def fromDoc( @@ -10281,48 +10103,6 @@ def fromDoc( _doc.lc.data = doc.lc.data _doc.lc.filename = doc.lc.filename _errors__ = [] - if "flatten" in _doc: - try: - flatten = load_field( - _doc.get("flatten"), - uri_union_of_None_type_or_booltype_False_True_2_None, - baseuri, - loadingOptions, - lc=_doc.get("flatten") - ) - - except ValidationException as e: - error_message, to_print, verb_tensage = parse_errors(str(e)) - - if str(e) == "missing required field `flatten`": - _errors__.append( - ValidationException( - str(e), - None - ) - ) - else: - if error_message != str(e): - val_type = convert_typing(extract_type(type(_doc.get("flatten")))) - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [ValidationException(f"Value is a {val_type}, " - f"but valid {to_print} for this field " - f"{verb_tensage} {error_message}")], - ) - ) - else: - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [e], - ) - ) - else: - flatten = None try: if _doc.get("items") is None: raise ValidationException("missing required field `items`", None, []) @@ -10506,7 +10286,7 @@ def fromDoc( else: _errors__.append( ValidationException( - "invalid field `{}`, expected one of: `flatten`, `items`, `type`, `label`, `inputBinding`".format( + "invalid field `{}`, expected one of: `items`, `type`, `label`, `inputBinding`".format( k ), SourceLine(_doc, k, str), @@ -10516,7 +10296,6 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - flatten=flatten, items=items, type_=type_, label=label, @@ -10537,9 +10316,6 @@ def save( else: for ef in self.extension_fields: r[ef] = self.extension_fields[ef] - if self.flatten is not None: - u = save_relative_uri(self.flatten, base_url, False, 2, relative_uris) - r["flatten"] = u if self.items is not None: u = save_relative_uri(self.items, base_url, False, 2, relative_uris) r["items"] = u @@ -10567,7 +10343,7 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["flatten", "items", "type", "label", "inputBinding"]) + attrs = frozenset(["items", "type", "label", "inputBinding"]) class CommandOutputRecordField(OutputRecordField): @@ -11532,7 +11308,6 @@ def __init__( self, items: Any, type_: Any, - flatten: Optional[Any] = None, label: Optional[Any] = None, outputBinding: Optional[Any] = None, extension_fields: Optional[Dict[str, Any]] = None, @@ -11546,7 +11321,6 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.flatten = flatten self.items = items self.type_ = type_ self.label = label @@ -11555,8 +11329,7 @@ def __init__( def __eq__(self, other: Any) -> bool: if isinstance(other, CommandOutputArraySchema): return bool( - self.flatten == other.flatten - and self.items == other.items + self.items == other.items and self.type_ == other.type_ and self.label == other.label and self.outputBinding == other.outputBinding @@ -11564,9 +11337,7 @@ def __eq__(self, other: Any) -> bool: return False def __hash__(self) -> int: - return hash( - (self.flatten, self.items, self.type_, self.label, self.outputBinding) - ) + return hash((self.items, self.type_, self.label, self.outputBinding)) @classmethod def fromDoc( @@ -11582,48 +11353,6 @@ def fromDoc( _doc.lc.data = doc.lc.data _doc.lc.filename = doc.lc.filename _errors__ = [] - if "flatten" in _doc: - try: - flatten = load_field( - _doc.get("flatten"), - uri_union_of_None_type_or_booltype_False_True_2_None, - baseuri, - loadingOptions, - lc=_doc.get("flatten") - ) - - except ValidationException as e: - error_message, to_print, verb_tensage = parse_errors(str(e)) - - if str(e) == "missing required field `flatten`": - _errors__.append( - ValidationException( - str(e), - None - ) - ) - else: - if error_message != str(e): - val_type = convert_typing(extract_type(type(_doc.get("flatten")))) - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [ValidationException(f"Value is a {val_type}, " - f"but valid {to_print} for this field " - f"{verb_tensage} {error_message}")], - ) - ) - else: - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [e], - ) - ) - else: - flatten = None try: if _doc.get("items") is None: raise ValidationException("missing required field `items`", None, []) @@ -11807,7 +11536,7 @@ def fromDoc( else: _errors__.append( ValidationException( - "invalid field `{}`, expected one of: `flatten`, `items`, `type`, `label`, `outputBinding`".format( + "invalid field `{}`, expected one of: `items`, `type`, `label`, `outputBinding`".format( k ), SourceLine(_doc, k, str), @@ -11817,7 +11546,6 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - flatten=flatten, items=items, type_=type_, label=label, @@ -11838,9 +11566,6 @@ def save( else: for ef in self.extension_fields: r[ef] = self.extension_fields[ef] - if self.flatten is not None: - u = save_relative_uri(self.flatten, base_url, False, 2, relative_uris) - r["flatten"] = u if self.items is not None: u = save_relative_uri(self.items, base_url, False, 2, relative_uris) r["items"] = u @@ -11868,7 +11593,7 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["flatten", "items", "type", "label", "outputBinding"]) + attrs = frozenset(["items", "type", "label", "outputBinding"]) class CommandInputParameter(InputParameter): @@ -20365,12 +20090,12 @@ def save( """ The **Any** type validates for any non-null value. """ -RecordFieldLoader = _RecordLoader(RecordField) -RecordSchemaLoader = _RecordLoader(RecordSchema) -EnumSchemaLoader = _RecordLoader(EnumSchema) -ArraySchemaLoader = _RecordLoader(ArraySchema) -MapSchemaLoader = _RecordLoader(MapSchema) -UnionSchemaLoader = _RecordLoader(UnionSchema) +RecordFieldLoader = _RecordLoader(RecordField, None, None) +RecordSchemaLoader = _RecordLoader(RecordSchema, None, None) +EnumSchemaLoader = _RecordLoader(EnumSchema, None, None) +ArraySchemaLoader = _RecordLoader(ArraySchema, None, None) +MapSchemaLoader = _RecordLoader(MapSchema, None, None) +UnionSchemaLoader = _RecordLoader(UnionSchema, None, None) CWLTypeLoader = _EnumLoader( ( "null", @@ -20390,11 +20115,11 @@ def save( File: A File object Directory: A Directory object """ -CWLArraySchemaLoader = _RecordLoader(CWLArraySchema) -CWLRecordFieldLoader = _RecordLoader(CWLRecordField) -CWLRecordSchemaLoader = _RecordLoader(CWLRecordSchema) -FileLoader = _RecordLoader(File) -DirectoryLoader = _RecordLoader(Directory) +CWLArraySchemaLoader = _RecordLoader(CWLArraySchema, None, None) +CWLRecordFieldLoader = _RecordLoader(CWLRecordField, None, None) +CWLRecordSchemaLoader = _RecordLoader(CWLRecordSchema, None, None) +FileLoader = _RecordLoader(File, None, None) +DirectoryLoader = _RecordLoader(Directory, None, None) CWLObjectTypeLoader = _UnionLoader((), "CWLObjectTypeLoader") union_of_None_type_or_CWLObjectTypeLoader = _UnionLoader( ( @@ -20403,10 +20128,10 @@ def save( ) ) array_of_union_of_None_type_or_CWLObjectTypeLoader = _ArrayLoader( - union_of_None_type_or_CWLObjectTypeLoader, False + union_of_None_type_or_CWLObjectTypeLoader ) map_of_union_of_None_type_or_CWLObjectTypeLoader = _MapLoader( - union_of_None_type_or_CWLObjectTypeLoader + union_of_None_type_or_CWLObjectTypeLoader, "CWLInputFile", "@list", True ) CWLInputFileLoader = map_of_union_of_None_type_or_CWLObjectTypeLoader CWLVersionLoader = _EnumLoader( @@ -20430,31 +20155,33 @@ def save( Version symbols for published CWL document versions. """ ExpressionLoader = _ExpressionLoader(str) -InputRecordFieldLoader = _RecordLoader(InputRecordField) -InputRecordSchemaLoader = _RecordLoader(InputRecordSchema) -InputEnumSchemaLoader = _RecordLoader(InputEnumSchema) -InputArraySchemaLoader = _RecordLoader(InputArraySchema) -OutputRecordFieldLoader = _RecordLoader(OutputRecordField) -OutputRecordSchemaLoader = _RecordLoader(OutputRecordSchema) -OutputEnumSchemaLoader = _RecordLoader(OutputEnumSchema) -OutputArraySchemaLoader = _RecordLoader(OutputArraySchema) -InputParameterLoader = _RecordLoader(InputParameter) -OutputParameterLoader = _RecordLoader(OutputParameter) -InlineJavascriptRequirementLoader = _RecordLoader(InlineJavascriptRequirement) -SchemaDefRequirementLoader = _RecordLoader(SchemaDefRequirement) -EnvironmentDefLoader = _RecordLoader(EnvironmentDef) -CommandLineBindingLoader = _RecordLoader(CommandLineBinding) -CommandOutputBindingLoader = _RecordLoader(CommandOutputBinding) -CommandInputRecordFieldLoader = _RecordLoader(CommandInputRecordField) -CommandInputRecordSchemaLoader = _RecordLoader(CommandInputRecordSchema) -CommandInputEnumSchemaLoader = _RecordLoader(CommandInputEnumSchema) -CommandInputArraySchemaLoader = _RecordLoader(CommandInputArraySchema) -CommandOutputRecordFieldLoader = _RecordLoader(CommandOutputRecordField) -CommandOutputRecordSchemaLoader = _RecordLoader(CommandOutputRecordSchema) -CommandOutputEnumSchemaLoader = _RecordLoader(CommandOutputEnumSchema) -CommandOutputArraySchemaLoader = _RecordLoader(CommandOutputArraySchema) -CommandInputParameterLoader = _RecordLoader(CommandInputParameter) -CommandOutputParameterLoader = _RecordLoader(CommandOutputParameter) +InputRecordFieldLoader = _RecordLoader(InputRecordField, None, None) +InputRecordSchemaLoader = _RecordLoader(InputRecordSchema, None, None) +InputEnumSchemaLoader = _RecordLoader(InputEnumSchema, None, None) +InputArraySchemaLoader = _RecordLoader(InputArraySchema, None, None) +OutputRecordFieldLoader = _RecordLoader(OutputRecordField, None, None) +OutputRecordSchemaLoader = _RecordLoader(OutputRecordSchema, None, None) +OutputEnumSchemaLoader = _RecordLoader(OutputEnumSchema, None, None) +OutputArraySchemaLoader = _RecordLoader(OutputArraySchema, None, None) +InputParameterLoader = _RecordLoader(InputParameter, None, None) +OutputParameterLoader = _RecordLoader(OutputParameter, None, None) +InlineJavascriptRequirementLoader = _RecordLoader( + InlineJavascriptRequirement, None, None +) +SchemaDefRequirementLoader = _RecordLoader(SchemaDefRequirement, None, None) +EnvironmentDefLoader = _RecordLoader(EnvironmentDef, None, None) +CommandLineBindingLoader = _RecordLoader(CommandLineBinding, None, None) +CommandOutputBindingLoader = _RecordLoader(CommandOutputBinding, None, None) +CommandInputRecordFieldLoader = _RecordLoader(CommandInputRecordField, None, None) +CommandInputRecordSchemaLoader = _RecordLoader(CommandInputRecordSchema, None, None) +CommandInputEnumSchemaLoader = _RecordLoader(CommandInputEnumSchema, None, None) +CommandInputArraySchemaLoader = _RecordLoader(CommandInputArraySchema, None, None) +CommandOutputRecordFieldLoader = _RecordLoader(CommandOutputRecordField, None, None) +CommandOutputRecordSchemaLoader = _RecordLoader(CommandOutputRecordSchema, None, None) +CommandOutputEnumSchemaLoader = _RecordLoader(CommandOutputEnumSchema, None, None) +CommandOutputArraySchemaLoader = _RecordLoader(CommandOutputArraySchema, None, None) +CommandInputParameterLoader = _RecordLoader(CommandInputParameter, None, None) +CommandOutputParameterLoader = _RecordLoader(CommandOutputParameter, None, None) stdoutLoader = _EnumLoader(("stdout",), "stdout") """ Only valid as a `type` for a `CommandLineTool` output with no @@ -20543,17 +20270,19 @@ def save( stderr: random_stderr_filenameABCDEFG ``` """ -CommandLineToolLoader = _RecordLoader(CommandLineTool) -DockerRequirementLoader = _RecordLoader(DockerRequirement) -SoftwareRequirementLoader = _RecordLoader(SoftwareRequirement) -SoftwarePackageLoader = _RecordLoader(SoftwarePackage) -DirentLoader = _RecordLoader(Dirent) -InitialWorkDirRequirementLoader = _RecordLoader(InitialWorkDirRequirement) -EnvVarRequirementLoader = _RecordLoader(EnvVarRequirement) -ShellCommandRequirementLoader = _RecordLoader(ShellCommandRequirement) -ResourceRequirementLoader = _RecordLoader(ResourceRequirement) -ExpressionToolOutputParameterLoader = _RecordLoader(ExpressionToolOutputParameter) -ExpressionToolLoader = _RecordLoader(ExpressionTool) +CommandLineToolLoader = _RecordLoader(CommandLineTool, None, None) +DockerRequirementLoader = _RecordLoader(DockerRequirement, None, None) +SoftwareRequirementLoader = _RecordLoader(SoftwareRequirement, None, None) +SoftwarePackageLoader = _RecordLoader(SoftwarePackage, None, None) +DirentLoader = _RecordLoader(Dirent, None, None) +InitialWorkDirRequirementLoader = _RecordLoader(InitialWorkDirRequirement, None, None) +EnvVarRequirementLoader = _RecordLoader(EnvVarRequirement, None, None) +ShellCommandRequirementLoader = _RecordLoader(ShellCommandRequirement, None, None) +ResourceRequirementLoader = _RecordLoader(ResourceRequirement, None, None) +ExpressionToolOutputParameterLoader = _RecordLoader( + ExpressionToolOutputParameter, None, None +) +ExpressionToolLoader = _RecordLoader(ExpressionTool, None, None) LinkMergeMethodLoader = _EnumLoader( ( "merge_nested", @@ -20564,9 +20293,9 @@ def save( """ The input link merge method, described in [WorkflowStepInput](#WorkflowStepInput). """ -WorkflowOutputParameterLoader = _RecordLoader(WorkflowOutputParameter) -WorkflowStepInputLoader = _RecordLoader(WorkflowStepInput) -WorkflowStepOutputLoader = _RecordLoader(WorkflowStepOutput) +WorkflowOutputParameterLoader = _RecordLoader(WorkflowOutputParameter, None, None) +WorkflowStepInputLoader = _RecordLoader(WorkflowStepInput, None, None) +WorkflowStepOutputLoader = _RecordLoader(WorkflowStepOutput, None, None) ScatterMethodLoader = _EnumLoader( ( "dotproduct", @@ -20578,13 +20307,19 @@ def save( """ The scatter method, as described in [workflow step scatter](#WorkflowStep). """ -WorkflowStepLoader = _RecordLoader(WorkflowStep) -WorkflowLoader = _RecordLoader(Workflow) -SubworkflowFeatureRequirementLoader = _RecordLoader(SubworkflowFeatureRequirement) -ScatterFeatureRequirementLoader = _RecordLoader(ScatterFeatureRequirement) -MultipleInputFeatureRequirementLoader = _RecordLoader(MultipleInputFeatureRequirement) -StepInputExpressionRequirementLoader = _RecordLoader(StepInputExpressionRequirement) -array_of_strtype = _ArrayLoader(strtype, True) +WorkflowStepLoader = _RecordLoader(WorkflowStep, None, None) +WorkflowLoader = _RecordLoader(Workflow, None, None) +SubworkflowFeatureRequirementLoader = _RecordLoader( + SubworkflowFeatureRequirement, None, None +) +ScatterFeatureRequirementLoader = _RecordLoader(ScatterFeatureRequirement, None, None) +MultipleInputFeatureRequirementLoader = _RecordLoader( + MultipleInputFeatureRequirement, None, None +) +StepInputExpressionRequirementLoader = _RecordLoader( + StepInputExpressionRequirement, None, None +) +array_of_strtype = _ArrayLoader(strtype) union_of_None_type_or_strtype_or_array_of_strtype = _UnionLoader( ( None_type, @@ -20605,8 +20340,7 @@ def save( ) ) array_of_union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype = _ArrayLoader( - union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype, - True, + union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype ) union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype_or_array_of_union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype = _UnionLoader( ( @@ -20625,7 +20359,7 @@ def save( 2, "v1.1", ) -array_of_RecordFieldLoader = _ArrayLoader(RecordFieldLoader, True) +array_of_RecordFieldLoader = _ArrayLoader(RecordFieldLoader) union_of_None_type_or_array_of_RecordFieldLoader = _UnionLoader( ( None_type, @@ -20651,15 +20385,6 @@ def save( ) Enum_nameLoader = _EnumLoader(("enum",), "Enum_name") typedsl_Enum_nameLoader_2 = _TypeDSLLoader(Enum_nameLoader, 2, "v1.1") -union_of_None_type_or_booltype = _UnionLoader( - ( - None_type, - booltype, - ) -) -uri_union_of_None_type_or_booltype_False_True_2_None = _URILoader( - union_of_None_type_or_booltype, False, True, 2, None -) uri_union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype_or_array_of_union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype_False_True_2_None = _URILoader( union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype_or_array_of_union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype, False, @@ -20683,8 +20408,7 @@ def save( ) ) array_of_union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype = _ArrayLoader( - union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype, - True, + union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype ) union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype_or_array_of_union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype = _UnionLoader( ( @@ -20708,7 +20432,7 @@ def save( 2, "v1.1", ) -array_of_CWLRecordFieldLoader = _ArrayLoader(CWLRecordFieldLoader, True) +array_of_CWLRecordFieldLoader = _ArrayLoader(CWLRecordFieldLoader) union_of_None_type_or_array_of_CWLRecordFieldLoader = _UnionLoader( ( None_type, @@ -20738,7 +20462,7 @@ def save( ) ) array_of_union_of_FileLoader_or_DirectoryLoader = _ArrayLoader( - union_of_FileLoader_or_DirectoryLoader, True + union_of_FileLoader_or_DirectoryLoader ) union_of_None_type_or_array_of_union_of_FileLoader_or_DirectoryLoader = _UnionLoader( ( @@ -20760,7 +20484,7 @@ def save( ) ) array_of_union_of_strtype_or_ExpressionLoader = _ArrayLoader( - union_of_strtype_or_ExpressionLoader, True + union_of_strtype_or_ExpressionLoader ) union_of_None_type_or_strtype_or_ExpressionLoader_or_array_of_union_of_strtype_or_ExpressionLoader = _UnionLoader( ( @@ -20770,6 +20494,12 @@ def save( array_of_union_of_strtype_or_ExpressionLoader, ) ) +union_of_None_type_or_booltype = _UnionLoader( + ( + None_type, + booltype, + ) +) union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype = _UnionLoader( ( CWLTypeLoader, @@ -20780,8 +20510,7 @@ def save( ) ) array_of_union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype = _ArrayLoader( - union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype, - True, + union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype ) union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype = _UnionLoader( ( @@ -20804,7 +20533,7 @@ def save( CommandLineBindingLoader, ) ) -array_of_InputRecordFieldLoader = _ArrayLoader(InputRecordFieldLoader, True) +array_of_InputRecordFieldLoader = _ArrayLoader(InputRecordFieldLoader) union_of_None_type_or_array_of_InputRecordFieldLoader = _UnionLoader( ( None_type, @@ -20831,8 +20560,7 @@ def save( ) ) array_of_union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype = _ArrayLoader( - union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype, - True, + union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype ) union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype = _UnionLoader( ( @@ -20855,7 +20583,7 @@ def save( CommandOutputBindingLoader, ) ) -array_of_OutputRecordFieldLoader = _ArrayLoader(OutputRecordFieldLoader, True) +array_of_OutputRecordFieldLoader = _ArrayLoader(OutputRecordFieldLoader) union_of_None_type_or_array_of_OutputRecordFieldLoader = _UnionLoader( ( None_type, @@ -20913,11 +20641,11 @@ def save( uri_union_of_None_type_or_strtype_or_ExpressionLoader_True_False_None_True = _URILoader( union_of_None_type_or_strtype_or_ExpressionLoader, True, False, None, True ) -array_of_InputParameterLoader = _ArrayLoader(InputParameterLoader, True) +array_of_InputParameterLoader = _ArrayLoader(InputParameterLoader) idmap_inputs_array_of_InputParameterLoader = _IdMapLoader( array_of_InputParameterLoader, "id", "type" ) -array_of_OutputParameterLoader = _ArrayLoader(OutputParameterLoader, True) +array_of_OutputParameterLoader = _ArrayLoader(OutputParameterLoader) idmap_outputs_array_of_OutputParameterLoader = _IdMapLoader( array_of_OutputParameterLoader, "id", "type" ) @@ -20938,8 +20666,7 @@ def save( ) ) array_of_union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader = _ArrayLoader( - union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader, - True, + union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader ) union_of_None_type_or_array_of_union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader = _UnionLoader( ( @@ -20970,8 +20697,7 @@ def save( ) ) array_of_union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader_or_Any_type = _ArrayLoader( - union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader_or_Any_type, - True, + union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader_or_Any_type ) union_of_None_type_or_array_of_union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader_or_Any_type = _UnionLoader( ( @@ -21021,8 +20747,7 @@ def save( ) ) array_of_union_of_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader = _ArrayLoader( - union_of_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader, - True, + union_of_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader ) union_of_None_type_or_strtype_or_ExpressionLoader_or_array_of_strtype = _UnionLoader( ( @@ -21042,8 +20767,7 @@ def save( ) ) array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype = _ArrayLoader( - union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype, - True, + union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype ) union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype = _UnionLoader( ( @@ -21060,9 +20784,7 @@ def save( 2, "v1.1", ) -array_of_CommandInputRecordFieldLoader = _ArrayLoader( - CommandInputRecordFieldLoader, True -) +array_of_CommandInputRecordFieldLoader = _ArrayLoader(CommandInputRecordFieldLoader) union_of_None_type_or_array_of_CommandInputRecordFieldLoader = _UnionLoader( ( None_type, @@ -21091,8 +20813,7 @@ def save( ) ) array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype = _ArrayLoader( - union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype, - True, + union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype ) union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype = _UnionLoader( ( @@ -21109,9 +20830,7 @@ def save( 2, "v1.1", ) -array_of_CommandOutputRecordFieldLoader = _ArrayLoader( - CommandOutputRecordFieldLoader, True -) +array_of_CommandOutputRecordFieldLoader = _ArrayLoader(CommandOutputRecordFieldLoader) union_of_None_type_or_array_of_CommandOutputRecordFieldLoader = _UnionLoader( ( None_type, @@ -21168,11 +20887,11 @@ def save( uri_CommandLineTool_classLoader_False_True_None_None = _URILoader( CommandLineTool_classLoader, False, True, None, None ) -array_of_CommandInputParameterLoader = _ArrayLoader(CommandInputParameterLoader, True) +array_of_CommandInputParameterLoader = _ArrayLoader(CommandInputParameterLoader) idmap_inputs_array_of_CommandInputParameterLoader = _IdMapLoader( array_of_CommandInputParameterLoader, "id", "type" ) -array_of_CommandOutputParameterLoader = _ArrayLoader(CommandOutputParameterLoader, True) +array_of_CommandOutputParameterLoader = _ArrayLoader(CommandOutputParameterLoader) idmap_outputs_array_of_CommandOutputParameterLoader = _IdMapLoader( array_of_CommandOutputParameterLoader, "id", "type" ) @@ -21184,7 +20903,7 @@ def save( ) ) array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader = ( - _ArrayLoader(union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader, True) + _ArrayLoader(union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader) ) union_of_None_type_or_array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader = _UnionLoader( ( @@ -21192,7 +20911,7 @@ def save( array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader, ) ) -array_of_inttype = _ArrayLoader(inttype, True) +array_of_inttype = _ArrayLoader(inttype) union_of_None_type_or_array_of_inttype = _UnionLoader( ( None_type, @@ -21211,7 +20930,7 @@ def save( uri_SoftwareRequirement_classLoader_False_True_None_None = _URILoader( SoftwareRequirement_classLoader, False, True, None, None ) -array_of_SoftwarePackageLoader = _ArrayLoader(SoftwarePackageLoader, True) +array_of_SoftwarePackageLoader = _ArrayLoader(SoftwarePackageLoader) idmap_packages_array_of_SoftwarePackageLoader = _IdMapLoader( array_of_SoftwarePackageLoader, "package", "specs" ) @@ -21234,8 +20953,7 @@ def save( ) ) array_of_union_of_FileLoader_or_DirectoryLoader_or_DirentLoader_or_strtype_or_ExpressionLoader = _ArrayLoader( - union_of_FileLoader_or_DirectoryLoader_or_DirentLoader_or_strtype_or_ExpressionLoader, - True, + union_of_FileLoader_or_DirectoryLoader_or_DirentLoader_or_strtype_or_ExpressionLoader ) union_of_array_of_union_of_FileLoader_or_DirectoryLoader_or_DirentLoader_or_strtype_or_ExpressionLoader_or_strtype_or_ExpressionLoader = _UnionLoader( ( @@ -21250,7 +20968,7 @@ def save( uri_EnvVarRequirement_classLoader_False_True_None_None = _URILoader( EnvVarRequirement_classLoader, False, True, None, None ) -array_of_EnvironmentDefLoader = _ArrayLoader(EnvironmentDefLoader, True) +array_of_EnvironmentDefLoader = _ArrayLoader(EnvironmentDefLoader) idmap_envDef_array_of_EnvironmentDefLoader = _IdMapLoader( array_of_EnvironmentDefLoader, "envName", "envValue" ) @@ -21295,7 +21013,7 @@ def save( ExpressionTool_classLoader, False, True, None, None ) array_of_ExpressionToolOutputParameterLoader = _ArrayLoader( - ExpressionToolOutputParameterLoader, True + ExpressionToolOutputParameterLoader ) idmap_outputs_array_of_ExpressionToolOutputParameterLoader = _IdMapLoader( array_of_ExpressionToolOutputParameterLoader, "id", "type" @@ -21312,7 +21030,7 @@ def save( uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_2_None = _URILoader( union_of_None_type_or_strtype_or_array_of_strtype, False, False, 2, None ) -array_of_WorkflowStepInputLoader = _ArrayLoader(WorkflowStepInputLoader, True) +array_of_WorkflowStepInputLoader = _ArrayLoader(WorkflowStepInputLoader) idmap_in__array_of_WorkflowStepInputLoader = _IdMapLoader( array_of_WorkflowStepInputLoader, "id", "source" ) @@ -21323,7 +21041,7 @@ def save( ) ) array_of_union_of_strtype_or_WorkflowStepOutputLoader = _ArrayLoader( - union_of_strtype_or_WorkflowStepOutputLoader, True + union_of_strtype_or_WorkflowStepOutputLoader ) union_of_array_of_union_of_strtype_or_WorkflowStepOutputLoader = _UnionLoader( (array_of_union_of_strtype_or_WorkflowStepOutputLoader,) @@ -21335,7 +21053,7 @@ def save( None, None, ) -array_of_Any_type = _ArrayLoader(Any_type, True) +array_of_Any_type = _ArrayLoader(Any_type) union_of_None_type_or_array_of_Any_type = _UnionLoader( ( None_type, @@ -21378,13 +21096,11 @@ def save( uri_Workflow_classLoader_False_True_None_None = _URILoader( Workflow_classLoader, False, True, None, None ) -array_of_WorkflowOutputParameterLoader = _ArrayLoader( - WorkflowOutputParameterLoader, True -) +array_of_WorkflowOutputParameterLoader = _ArrayLoader(WorkflowOutputParameterLoader) idmap_outputs_array_of_WorkflowOutputParameterLoader = _IdMapLoader( array_of_WorkflowOutputParameterLoader, "id", "type" ) -array_of_WorkflowStepLoader = _ArrayLoader(WorkflowStepLoader, True) +array_of_WorkflowStepLoader = _ArrayLoader(WorkflowStepLoader) union_of_array_of_WorkflowStepLoader = _UnionLoader((array_of_WorkflowStepLoader,)) idmap_steps_union_of_array_of_WorkflowStepLoader = _IdMapLoader( union_of_array_of_WorkflowStepLoader, "id", "None" @@ -21422,7 +21138,7 @@ def save( ) array_of_union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader = ( _ArrayLoader( - union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader, True + union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader ) ) union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_array_of_union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader = _UnionLoader( diff --git a/cwl_utils/parser/cwl_v1_0_utils.py b/cwl_utils/parser/cwl_v1_0_utils.py index db9f898e..fb92ab59 100644 --- a/cwl_utils/parser/cwl_v1_0_utils.py +++ b/cwl_utils/parser/cwl_v1_0_utils.py @@ -44,9 +44,9 @@ def _compare_records( This handles normalizing record names, which will be relative to workflow step, so that they can be compared. """ - srcfields = {cwl.shortname(field.name): field.type for field in (src.fields or {})} + srcfields = {cwl.shortname(field.name): field.type_ for field in (src.fields or {})} sinkfields = { - cwl.shortname(field.name): field.type for field in (sink.fields or {}) + cwl.shortname(field.name): field.type_ for field in (sink.fields or {}) } for key in sinkfields.keys(): if ( @@ -77,10 +77,10 @@ def _compare_type(type1: Any, type2: Any) -> bool: return _compare_type(type1.items, type2.items) elif isinstance(type1, cwl.RecordSchema) and isinstance(type2, cwl.RecordSchema): fields1 = { - cwl.shortname(field.name): field.type for field in (type1.fields or {}) + cwl.shortname(field.name): field.type_ for field in (type1.fields or {}) } fields2 = { - cwl.shortname(field.name): field.type for field in (type2.fields or {}) + cwl.shortname(field.name): field.type_ for field in (type2.fields or {}) } if fields1.keys() != fields2.keys(): return False @@ -256,7 +256,7 @@ def check_types( return "exception" if linkMerge == "merge_nested": return check_types( - cwl.ArraySchema(items=srctype, type="array"), sinktype, None, None + cwl.ArraySchema(items=srctype, type_="array"), sinktype, None, None ) if linkMerge == "merge_flattened": return check_types(merge_flatten_type(srctype), sinktype, None, None) @@ -284,7 +284,7 @@ def content_limit_respected_read(f: IO[bytes]) -> str: def convert_stdstreams_to_files(clt: cwl.CommandLineTool) -> None: """Convert stdout and stderr type shortcuts to files.""" for out in clt.outputs: - if out.type == "stdout": + if out.type_ == "stdout": if out.outputBinding is not None: raise ValidationException( "Not allowed to specify outputBinding when using stdout shortcut." @@ -295,9 +295,9 @@ def convert_stdstreams_to_files(clt: cwl.CommandLineTool) -> None: json_dumps(clt.save(), sort_keys=True).encode("utf-8") ).hexdigest() ) - out.type = "File" + out.type_ = "File" out.outputBinding = cwl.CommandOutputBinding(glob=clt.stdout) - elif out.type == "stderr": + elif out.type_ == "stderr": if out.outputBinding is not None: raise ValidationException( "Not allowed to specify outputBinding when using stderr shortcut." @@ -308,7 +308,7 @@ def convert_stdstreams_to_files(clt: cwl.CommandLineTool) -> None: json_dumps(clt.save(), sort_keys=True).encode("utf-8") ).hexdigest() ) - out.type = "File" + out.type_ = "File" out.outputBinding = cwl.CommandOutputBinding(glob=clt.stderr) @@ -322,7 +322,6 @@ def load_inputfile( baseuri = cwl.file_uri(os.getcwd()) + "/" if loadingOptions is None: loadingOptions = cwl.LoadingOptions() - loadingOptions = cwl.LoadingOptions(copyfrom=loadingOptions, no_link_check=True) result, metadata = _inputfile_load( doc, baseuri, @@ -344,7 +343,6 @@ def load_inputfile_by_string( if loadingOptions is None: loadingOptions = cwl.LoadingOptions(fileuri=uri) - loadingOptions = cwl.LoadingOptions(copyfrom=loadingOptions, no_link_check=True) result, metadata = _inputfile_load( result, uri, @@ -364,7 +362,6 @@ def load_inputfile_by_yaml( if loadingOptions is None: loadingOptions = cwl.LoadingOptions(fileuri=uri) - loadingOptions = cwl.LoadingOptions(copyfrom=loadingOptions, no_link_check=True) result, metadata = _inputfile_load( yaml, uri, @@ -379,7 +376,7 @@ def merge_flatten_type(src: Any) -> Any: return [merge_flatten_type(t) for t in src] if isinstance(src, cwl.ArraySchema): return src - return cwl.ArraySchema(type="array", items=src) + return cwl.ArraySchema(type_="array", items=src) def type_for_step_input( @@ -397,9 +394,9 @@ def type_for_step_input( cast(str, step_input.id).split("#")[-1] == cast(str, in_.id).split("#")[-1] ): - input_type = step_input.type + input_type = step_input.type_ if step.scatter is not None and in_.id in aslist(step.scatter): - input_type = cwl.ArraySchema(items=input_type, type="array") + input_type = cwl.ArraySchema(items=input_type, type_="array") return input_type return "Any" @@ -417,15 +414,15 @@ def type_for_step_output( step_output.id.split("#")[-1].split("/")[-1] == sourcename.split("#")[-1].split("/")[-1] ): - output_type = step_output.type + output_type = step_output.type_ if step.scatter is not None: if step.scatterMethod == "nested_crossproduct": for _ in range(len(aslist(step.scatter))): output_type = cwl.ArraySchema( - items=output_type, type="array" + items=output_type, type_="array" ) else: - output_type = cwl.ArraySchema(items=output_type, type="array") + output_type = cwl.ArraySchema(items=output_type, type_="array") return output_type raise ValidationException( "param {} not found in {}.".format( @@ -445,15 +442,15 @@ def type_for_source( scatter_context: List[Optional[Tuple[int, str]]] = [] params = param_for_source_id(process, sourcenames, parent, scatter_context) if not isinstance(params, list): - new_type = params.type + new_type = params.type_ if scatter_context[0] is not None: if scatter_context[0][1] == "nested_crossproduct": for _ in range(scatter_context[0][0]): - new_type = cwl.ArraySchema(items=new_type, type="array") + new_type = cwl.ArraySchema(items=new_type, type_="array") else: - new_type = cwl.ArraySchema(items=new_type, type="array") + new_type = cwl.ArraySchema(items=new_type, type_="array") if linkMerge == "merge_nested": - new_type = cwl.ArraySchema(items=new_type, type="array") + new_type = cwl.ArraySchema(items=new_type, type_="array") elif linkMerge == "merge_flattened": new_type = merge_flatten_type(new_type) return new_type @@ -461,26 +458,28 @@ def type_for_source( for p, sc in zip(params, scatter_context): if isinstance(p, str) and not any(_compare_type(t, p) for t in new_type): cur_type = p - elif hasattr(p, "type") and not any(_compare_type(t, p.type) for t in new_type): - cur_type = p.type + elif hasattr(p, "type_") and not any( + _compare_type(t, p.type_) for t in new_type + ): + cur_type = p.type_ else: cur_type = None if cur_type is not None: if sc is not None: if sc[1] == "nested_crossproduct": for _ in range(sc[0]): - cur_type = cwl.ArraySchema(items=cur_type, type="array") + cur_type = cwl.ArraySchema(items=cur_type, type_="array") else: - cur_type = cwl.ArraySchema(items=cur_type, type="array") + cur_type = cwl.ArraySchema(items=cur_type, type_="array") new_type.append(cur_type) if len(new_type) == 1: new_type = new_type[0] if linkMerge == "merge_nested": - return cwl.ArraySchema(items=new_type, type="array") + return cwl.ArraySchema(items=new_type, type_="array") elif linkMerge == "merge_flattened": return merge_flatten_type(new_type) elif isinstance(sourcenames, List) and len(sourcenames) > 1: - return cwl.ArraySchema(items=new_type, type="array") + return cwl.ArraySchema(items=new_type, type_="array") else: return new_type diff --git a/cwl_utils/parser/cwl_v1_1.py b/cwl_utils/parser/cwl_v1_1.py index b8c05e65..62ccc222 100644 --- a/cwl_utils/parser/cwl_v1_1.py +++ b/cwl_utils/parser/cwl_v1_1.py @@ -61,6 +61,7 @@ class LoadingOptions: imports: List[str] includes: List[str] no_link_check: Optional[bool] + container: Optional[str] def __init__( self, @@ -75,7 +76,8 @@ def __init__( idx: Optional[IdxType] = None, imports: Optional[List[str]] = None, includes: Optional[List[str]] = None, - no_link_check: bool = False, + no_link_check: Optional[bool] = None, + container: Optional[str] = None, ) -> None: """Create a LoadingOptions object.""" self.original_doc = original_doc @@ -120,7 +122,15 @@ def __init__( else: self.includes = copyfrom.includes if copyfrom is not None else [] - self.no_link_check = no_link_check + if no_link_check is not None: + self.no_link_check = no_link_check + else: + self.no_link_check = copyfrom.no_link_check if copyfrom is not None else False + + if container is not None: + self.container = container + else: + self.container = copyfrom.container if copyfrom is not None else None if fetcher is not None: self.fetcher = fetcher @@ -462,9 +472,8 @@ def __repr__(self) -> str: class _ArrayLoader(_Loader): - def __init__(self, items: _Loader, flatten: bool = True) -> None: + def __init__(self, items: _Loader) -> None: self.items = items - self.flatten = flatten def load( self, @@ -487,7 +496,8 @@ def load( lf = load_field( doc[i], _UnionLoader(([self, self.items])), baseuri, loadingOptions, lc=lc ) - if self.flatten and isinstance(lf, MutableSequence): + flatten = loadingOptions.container != "@list" + if flatten and isinstance(lf, MutableSequence): r.extend(lf) else: r.append(lf) @@ -519,9 +529,17 @@ def __repr__(self) -> str: class _MapLoader(_Loader): - def __init__(self, values: _Loader, name: Optional[str] = None) -> None: + def __init__( + self, + values: _Loader, + name: Optional[str] = None, + container: Optional[str] = None, + no_link_check: Optional[bool] = None, + ) -> None: self.values = values self.name = name + self.container = container + self.no_link_check = no_link_check def load( self, @@ -533,6 +551,10 @@ def load( ) -> Any: if not isinstance(doc, MutableMapping): raise ValidationException(f"Expected a map, was {type(doc)}") + if self.container is not None or self.no_link_check is not None: + loadingOptions = LoadingOptions( + copyfrom=loadingOptions, container=self.container, no_link_check=self.no_link_check + ) r: Dict[str, Any] = {} errors: List[SchemaSaladException] = [] for k, v in doc.items(): @@ -643,8 +665,15 @@ def load( class _RecordLoader(_Loader): - def __init__(self, classtype: Type[Saveable]) -> None: + def __init__( + self, + classtype: Type[Saveable], + container: Optional[str] = None, + no_link_check: Optional[bool] = None, + ) -> None: self.classtype = classtype + self.container = container + self.no_link_check = no_link_check def load( self, @@ -659,6 +688,10 @@ def load( f"Value is a {convert_typing(extract_type(type(doc)))}, " f"but valid type for this field is an object." ) + if self.container is not None or self.no_link_check is not None: + loadingOptions = LoadingOptions( + copyfrom=loadingOptions, container=self.container, no_link_check=self.no_link_check + ) return self.classtype.fromDoc(doc, baseuri, loadingOptions, docRoot=docRoot) def __repr__(self) -> str: @@ -1837,7 +1870,6 @@ def __init__( self, items: Any, type_: Any, - flatten: Optional[Any] = None, extension_fields: Optional[Dict[str, Any]] = None, loadingOptions: Optional[LoadingOptions] = None, ) -> None: @@ -1849,21 +1881,16 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.flatten = flatten self.items = items self.type_ = type_ def __eq__(self, other: Any) -> bool: if isinstance(other, ArraySchema): - return bool( - self.flatten == other.flatten - and self.items == other.items - and self.type_ == other.type_ - ) + return bool(self.items == other.items and self.type_ == other.type_) return False def __hash__(self) -> int: - return hash((self.flatten, self.items, self.type_)) + return hash((self.items, self.type_)) @classmethod def fromDoc( @@ -1879,48 +1906,6 @@ def fromDoc( _doc.lc.data = doc.lc.data _doc.lc.filename = doc.lc.filename _errors__ = [] - if "flatten" in _doc: - try: - flatten = load_field( - _doc.get("flatten"), - uri_union_of_None_type_or_booltype_False_True_2_None, - baseuri, - loadingOptions, - lc=_doc.get("flatten") - ) - - except ValidationException as e: - error_message, to_print, verb_tensage = parse_errors(str(e)) - - if str(e) == "missing required field `flatten`": - _errors__.append( - ValidationException( - str(e), - None - ) - ) - else: - if error_message != str(e): - val_type = convert_typing(extract_type(type(_doc.get("flatten")))) - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [ValidationException(f"Value is a {val_type}, " - f"but valid {to_print} for this field " - f"{verb_tensage} {error_message}")], - ) - ) - else: - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [e], - ) - ) - else: - flatten = None try: if _doc.get("items") is None: raise ValidationException("missing required field `items`", None, []) @@ -2020,7 +2005,7 @@ def fromDoc( else: _errors__.append( ValidationException( - "invalid field `{}`, expected one of: `flatten`, `items`, `type`".format( + "invalid field `{}`, expected one of: `items`, `type`".format( k ), SourceLine(_doc, k, str), @@ -2030,7 +2015,6 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - flatten=flatten, items=items, type_=type_, extension_fields=extension_fields, @@ -2049,9 +2033,6 @@ def save( else: for ef in self.extension_fields: r[ef] = self.extension_fields[ef] - if self.flatten is not None: - u = save_relative_uri(self.flatten, base_url, False, 2, relative_uris) - r["flatten"] = u if self.items is not None: u = save_relative_uri(self.items, base_url, False, 2, relative_uris) r["items"] = u @@ -2068,7 +2049,7 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["flatten", "items", "type"]) + attrs = frozenset(["items", "type"]) class MapSchema(Saveable): @@ -2450,7 +2431,6 @@ def __init__( self, items: Any, type_: Any, - flatten: Optional[Any] = None, extension_fields: Optional[Dict[str, Any]] = None, loadingOptions: Optional[LoadingOptions] = None, ) -> None: @@ -2462,21 +2442,16 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.flatten = flatten self.items = items self.type_ = type_ def __eq__(self, other: Any) -> bool: if isinstance(other, CWLArraySchema): - return bool( - self.flatten == other.flatten - and self.items == other.items - and self.type_ == other.type_ - ) + return bool(self.items == other.items and self.type_ == other.type_) return False def __hash__(self) -> int: - return hash((self.flatten, self.items, self.type_)) + return hash((self.items, self.type_)) @classmethod def fromDoc( @@ -2492,48 +2467,6 @@ def fromDoc( _doc.lc.data = doc.lc.data _doc.lc.filename = doc.lc.filename _errors__ = [] - if "flatten" in _doc: - try: - flatten = load_field( - _doc.get("flatten"), - uri_union_of_None_type_or_booltype_False_True_2_None, - baseuri, - loadingOptions, - lc=_doc.get("flatten") - ) - - except ValidationException as e: - error_message, to_print, verb_tensage = parse_errors(str(e)) - - if str(e) == "missing required field `flatten`": - _errors__.append( - ValidationException( - str(e), - None - ) - ) - else: - if error_message != str(e): - val_type = convert_typing(extract_type(type(_doc.get("flatten")))) - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [ValidationException(f"Value is a {val_type}, " - f"but valid {to_print} for this field " - f"{verb_tensage} {error_message}")], - ) - ) - else: - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [e], - ) - ) - else: - flatten = None try: if _doc.get("items") is None: raise ValidationException("missing required field `items`", None, []) @@ -2633,7 +2566,7 @@ def fromDoc( else: _errors__.append( ValidationException( - "invalid field `{}`, expected one of: `flatten`, `items`, `type`".format( + "invalid field `{}`, expected one of: `items`, `type`".format( k ), SourceLine(_doc, k, str), @@ -2643,7 +2576,6 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - flatten=flatten, items=items, type_=type_, extension_fields=extension_fields, @@ -2662,9 +2594,6 @@ def save( else: for ef in self.extension_fields: r[ef] = self.extension_fields[ef] - if self.flatten is not None: - u = save_relative_uri(self.flatten, base_url, False, 2, relative_uris) - r["flatten"] = u if self.items is not None: u = save_relative_uri(self.items, base_url, False, 2, relative_uris) r["items"] = u @@ -2681,7 +2610,7 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["flatten", "items", "type"]) + attrs = frozenset(["items", "type"]) class CWLRecordField(RecordField): @@ -5697,7 +5626,6 @@ def __init__( self, items: Any, type_: Any, - flatten: Optional[Any] = None, label: Optional[Any] = None, doc: Optional[Any] = None, name: Optional[Any] = None, @@ -5712,7 +5640,6 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.flatten = flatten self.items = items self.type_ = type_ self.label = label @@ -5722,8 +5649,7 @@ def __init__( def __eq__(self, other: Any) -> bool: if isinstance(other, InputArraySchema): return bool( - self.flatten == other.flatten - and self.items == other.items + self.items == other.items and self.type_ == other.type_ and self.label == other.label and self.doc == other.doc @@ -5732,9 +5658,7 @@ def __eq__(self, other: Any) -> bool: return False def __hash__(self) -> int: - return hash( - (self.flatten, self.items, self.type_, self.label, self.doc, self.name) - ) + return hash((self.items, self.type_, self.label, self.doc, self.name)) @classmethod def fromDoc( @@ -5801,48 +5725,6 @@ def fromDoc( name = "_:" + str(_uuid__.uuid4()) if not __original_name_is_none: baseuri = name - if "flatten" in _doc: - try: - flatten = load_field( - _doc.get("flatten"), - uri_union_of_None_type_or_booltype_False_True_2_None, - baseuri, - loadingOptions, - lc=_doc.get("flatten") - ) - - except ValidationException as e: - error_message, to_print, verb_tensage = parse_errors(str(e)) - - if str(e) == "missing required field `flatten`": - _errors__.append( - ValidationException( - str(e), - None - ) - ) - else: - if error_message != str(e): - val_type = convert_typing(extract_type(type(_doc.get("flatten")))) - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [ValidationException(f"Value is a {val_type}, " - f"but valid {to_print} for this field " - f"{verb_tensage} {error_message}")], - ) - ) - else: - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [e], - ) - ) - else: - flatten = None try: if _doc.get("items") is None: raise ValidationException("missing required field `items`", None, []) @@ -6026,7 +5908,7 @@ def fromDoc( else: _errors__.append( ValidationException( - "invalid field `{}`, expected one of: `flatten`, `items`, `type`, `label`, `doc`, `name`".format( + "invalid field `{}`, expected one of: `items`, `type`, `label`, `doc`, `name`".format( k ), SourceLine(_doc, k, str), @@ -6036,7 +5918,6 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - flatten=flatten, items=items, type_=type_, label=label, @@ -6062,9 +5943,6 @@ def save( if self.name is not None: u = save_relative_uri(self.name, base_url, True, None, relative_uris) r["name"] = u - if self.flatten is not None: - u = save_relative_uri(self.flatten, self.name, False, 2, relative_uris) - r["flatten"] = u if self.items is not None: u = save_relative_uri(self.items, self.name, False, 2, relative_uris) r["items"] = u @@ -6089,7 +5967,7 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["flatten", "items", "type", "label", "doc", "name"]) + attrs = frozenset(["items", "type", "label", "doc", "name"]) class OutputRecordField(CWLRecordField, FieldBase, OutputFormat): @@ -7263,7 +7141,6 @@ def __init__( self, items: Any, type_: Any, - flatten: Optional[Any] = None, label: Optional[Any] = None, doc: Optional[Any] = None, name: Optional[Any] = None, @@ -7278,7 +7155,6 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.flatten = flatten self.items = items self.type_ = type_ self.label = label @@ -7288,8 +7164,7 @@ def __init__( def __eq__(self, other: Any) -> bool: if isinstance(other, OutputArraySchema): return bool( - self.flatten == other.flatten - and self.items == other.items + self.items == other.items and self.type_ == other.type_ and self.label == other.label and self.doc == other.doc @@ -7298,9 +7173,7 @@ def __eq__(self, other: Any) -> bool: return False def __hash__(self) -> int: - return hash( - (self.flatten, self.items, self.type_, self.label, self.doc, self.name) - ) + return hash((self.items, self.type_, self.label, self.doc, self.name)) @classmethod def fromDoc( @@ -7367,48 +7240,6 @@ def fromDoc( name = "_:" + str(_uuid__.uuid4()) if not __original_name_is_none: baseuri = name - if "flatten" in _doc: - try: - flatten = load_field( - _doc.get("flatten"), - uri_union_of_None_type_or_booltype_False_True_2_None, - baseuri, - loadingOptions, - lc=_doc.get("flatten") - ) - - except ValidationException as e: - error_message, to_print, verb_tensage = parse_errors(str(e)) - - if str(e) == "missing required field `flatten`": - _errors__.append( - ValidationException( - str(e), - None - ) - ) - else: - if error_message != str(e): - val_type = convert_typing(extract_type(type(_doc.get("flatten")))) - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [ValidationException(f"Value is a {val_type}, " - f"but valid {to_print} for this field " - f"{verb_tensage} {error_message}")], - ) - ) - else: - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [e], - ) - ) - else: - flatten = None try: if _doc.get("items") is None: raise ValidationException("missing required field `items`", None, []) @@ -7592,7 +7423,7 @@ def fromDoc( else: _errors__.append( ValidationException( - "invalid field `{}`, expected one of: `flatten`, `items`, `type`, `label`, `doc`, `name`".format( + "invalid field `{}`, expected one of: `items`, `type`, `label`, `doc`, `name`".format( k ), SourceLine(_doc, k, str), @@ -7602,7 +7433,6 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - flatten=flatten, items=items, type_=type_, label=label, @@ -7628,9 +7458,6 @@ def save( if self.name is not None: u = save_relative_uri(self.name, base_url, True, None, relative_uris) r["name"] = u - if self.flatten is not None: - u = save_relative_uri(self.flatten, self.name, False, 2, relative_uris) - r["flatten"] = u if self.items is not None: u = save_relative_uri(self.items, self.name, False, 2, relative_uris) r["items"] = u @@ -7655,7 +7482,7 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["flatten", "items", "type", "label", "doc", "name"]) + attrs = frozenset(["items", "type", "label", "doc", "name"]) class InputParameter(Parameter, InputFormat, LoadContents): @@ -11002,7 +10829,6 @@ def __init__( self, items: Any, type_: Any, - flatten: Optional[Any] = None, label: Optional[Any] = None, doc: Optional[Any] = None, name: Optional[Any] = None, @@ -11018,7 +10844,6 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.flatten = flatten self.items = items self.type_ = type_ self.label = label @@ -11029,8 +10854,7 @@ def __init__( def __eq__(self, other: Any) -> bool: if isinstance(other, CommandInputArraySchema): return bool( - self.flatten == other.flatten - and self.items == other.items + self.items == other.items and self.type_ == other.type_ and self.label == other.label and self.doc == other.doc @@ -11041,15 +10865,7 @@ def __eq__(self, other: Any) -> bool: def __hash__(self) -> int: return hash( - ( - self.flatten, - self.items, - self.type_, - self.label, - self.doc, - self.name, - self.inputBinding, - ) + (self.items, self.type_, self.label, self.doc, self.name, self.inputBinding) ) @classmethod @@ -11117,48 +10933,6 @@ def fromDoc( name = "_:" + str(_uuid__.uuid4()) if not __original_name_is_none: baseuri = name - if "flatten" in _doc: - try: - flatten = load_field( - _doc.get("flatten"), - uri_union_of_None_type_or_booltype_False_True_2_None, - baseuri, - loadingOptions, - lc=_doc.get("flatten") - ) - - except ValidationException as e: - error_message, to_print, verb_tensage = parse_errors(str(e)) - - if str(e) == "missing required field `flatten`": - _errors__.append( - ValidationException( - str(e), - None - ) - ) - else: - if error_message != str(e): - val_type = convert_typing(extract_type(type(_doc.get("flatten")))) - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [ValidationException(f"Value is a {val_type}, " - f"but valid {to_print} for this field " - f"{verb_tensage} {error_message}")], - ) - ) - else: - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [e], - ) - ) - else: - flatten = None try: if _doc.get("items") is None: raise ValidationException("missing required field `items`", None, []) @@ -11384,7 +11158,7 @@ def fromDoc( else: _errors__.append( ValidationException( - "invalid field `{}`, expected one of: `flatten`, `items`, `type`, `label`, `doc`, `name`, `inputBinding`".format( + "invalid field `{}`, expected one of: `items`, `type`, `label`, `doc`, `name`, `inputBinding`".format( k ), SourceLine(_doc, k, str), @@ -11394,7 +11168,6 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - flatten=flatten, items=items, type_=type_, label=label, @@ -11421,9 +11194,6 @@ def save( if self.name is not None: u = save_relative_uri(self.name, base_url, True, None, relative_uris) r["name"] = u - if self.flatten is not None: - u = save_relative_uri(self.flatten, self.name, False, 2, relative_uris) - r["flatten"] = u if self.items is not None: u = save_relative_uri(self.items, self.name, False, 2, relative_uris) r["items"] = u @@ -11455,9 +11225,7 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( - ["flatten", "items", "type", "label", "doc", "name", "inputBinding"] - ) + attrs = frozenset(["items", "type", "label", "doc", "name", "inputBinding"]) class CommandOutputRecordField(OutputRecordField): @@ -12694,7 +12462,6 @@ def __init__( self, items: Any, type_: Any, - flatten: Optional[Any] = None, label: Optional[Any] = None, doc: Optional[Any] = None, name: Optional[Any] = None, @@ -12709,7 +12476,6 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.flatten = flatten self.items = items self.type_ = type_ self.label = label @@ -12719,8 +12485,7 @@ def __init__( def __eq__(self, other: Any) -> bool: if isinstance(other, CommandOutputArraySchema): return bool( - self.flatten == other.flatten - and self.items == other.items + self.items == other.items and self.type_ == other.type_ and self.label == other.label and self.doc == other.doc @@ -12729,9 +12494,7 @@ def __eq__(self, other: Any) -> bool: return False def __hash__(self) -> int: - return hash( - (self.flatten, self.items, self.type_, self.label, self.doc, self.name) - ) + return hash((self.items, self.type_, self.label, self.doc, self.name)) @classmethod def fromDoc( @@ -12798,48 +12561,6 @@ def fromDoc( name = "_:" + str(_uuid__.uuid4()) if not __original_name_is_none: baseuri = name - if "flatten" in _doc: - try: - flatten = load_field( - _doc.get("flatten"), - uri_union_of_None_type_or_booltype_False_True_2_None, - baseuri, - loadingOptions, - lc=_doc.get("flatten") - ) - - except ValidationException as e: - error_message, to_print, verb_tensage = parse_errors(str(e)) - - if str(e) == "missing required field `flatten`": - _errors__.append( - ValidationException( - str(e), - None - ) - ) - else: - if error_message != str(e): - val_type = convert_typing(extract_type(type(_doc.get("flatten")))) - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [ValidationException(f"Value is a {val_type}, " - f"but valid {to_print} for this field " - f"{verb_tensage} {error_message}")], - ) - ) - else: - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [e], - ) - ) - else: - flatten = None try: if _doc.get("items") is None: raise ValidationException("missing required field `items`", None, []) @@ -13023,7 +12744,7 @@ def fromDoc( else: _errors__.append( ValidationException( - "invalid field `{}`, expected one of: `flatten`, `items`, `type`, `label`, `doc`, `name`".format( + "invalid field `{}`, expected one of: `items`, `type`, `label`, `doc`, `name`".format( k ), SourceLine(_doc, k, str), @@ -13033,7 +12754,6 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - flatten=flatten, items=items, type_=type_, label=label, @@ -13059,9 +12779,6 @@ def save( if self.name is not None: u = save_relative_uri(self.name, base_url, True, None, relative_uris) r["name"] = u - if self.flatten is not None: - u = save_relative_uri(self.flatten, self.name, False, 2, relative_uris) - r["flatten"] = u if self.items is not None: u = save_relative_uri(self.items, self.name, False, 2, relative_uris) r["items"] = u @@ -13086,7 +12803,7 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["flatten", "items", "type", "label", "doc", "name"]) + attrs = frozenset(["items", "type", "label", "doc", "name"]) class CommandInputParameter(InputParameter): @@ -23211,12 +22928,12 @@ def save( """ The **Any** type validates for any non-null value. """ -RecordFieldLoader = _RecordLoader(RecordField) -RecordSchemaLoader = _RecordLoader(RecordSchema) -EnumSchemaLoader = _RecordLoader(EnumSchema) -ArraySchemaLoader = _RecordLoader(ArraySchema) -MapSchemaLoader = _RecordLoader(MapSchema) -UnionSchemaLoader = _RecordLoader(UnionSchema) +RecordFieldLoader = _RecordLoader(RecordField, None, None) +RecordSchemaLoader = _RecordLoader(RecordSchema, None, None) +EnumSchemaLoader = _RecordLoader(EnumSchema, None, None) +ArraySchemaLoader = _RecordLoader(ArraySchema, None, None) +MapSchemaLoader = _RecordLoader(MapSchema, None, None) +UnionSchemaLoader = _RecordLoader(UnionSchema, None, None) CWLTypeLoader = _EnumLoader( ( "null", @@ -23236,11 +22953,11 @@ def save( File: A File object Directory: A Directory object """ -CWLArraySchemaLoader = _RecordLoader(CWLArraySchema) -CWLRecordFieldLoader = _RecordLoader(CWLRecordField) -CWLRecordSchemaLoader = _RecordLoader(CWLRecordSchema) -FileLoader = _RecordLoader(File) -DirectoryLoader = _RecordLoader(Directory) +CWLArraySchemaLoader = _RecordLoader(CWLArraySchema, None, None) +CWLRecordFieldLoader = _RecordLoader(CWLRecordField, None, None) +CWLRecordSchemaLoader = _RecordLoader(CWLRecordSchema, None, None) +FileLoader = _RecordLoader(File, None, None) +DirectoryLoader = _RecordLoader(Directory, None, None) CWLObjectTypeLoader = _UnionLoader((), "CWLObjectTypeLoader") union_of_None_type_or_CWLObjectTypeLoader = _UnionLoader( ( @@ -23249,28 +22966,36 @@ def save( ) ) array_of_union_of_None_type_or_CWLObjectTypeLoader = _ArrayLoader( - union_of_None_type_or_CWLObjectTypeLoader, False + union_of_None_type_or_CWLObjectTypeLoader ) map_of_union_of_None_type_or_CWLObjectTypeLoader = _MapLoader( - union_of_None_type_or_CWLObjectTypeLoader + union_of_None_type_or_CWLObjectTypeLoader, "None", None, None +) +InlineJavascriptRequirementLoader = _RecordLoader( + InlineJavascriptRequirement, None, None +) +SchemaDefRequirementLoader = _RecordLoader(SchemaDefRequirement, None, None) +LoadListingRequirementLoader = _RecordLoader(LoadListingRequirement, None, None) +DockerRequirementLoader = _RecordLoader(DockerRequirement, None, None) +SoftwareRequirementLoader = _RecordLoader(SoftwareRequirement, None, None) +InitialWorkDirRequirementLoader = _RecordLoader(InitialWorkDirRequirement, None, None) +EnvVarRequirementLoader = _RecordLoader(EnvVarRequirement, None, None) +ShellCommandRequirementLoader = _RecordLoader(ShellCommandRequirement, None, None) +ResourceRequirementLoader = _RecordLoader(ResourceRequirement, None, None) +WorkReuseLoader = _RecordLoader(WorkReuse, None, None) +NetworkAccessLoader = _RecordLoader(NetworkAccess, None, None) +InplaceUpdateRequirementLoader = _RecordLoader(InplaceUpdateRequirement, None, None) +ToolTimeLimitLoader = _RecordLoader(ToolTimeLimit, None, None) +SubworkflowFeatureRequirementLoader = _RecordLoader( + SubworkflowFeatureRequirement, None, None +) +ScatterFeatureRequirementLoader = _RecordLoader(ScatterFeatureRequirement, None, None) +MultipleInputFeatureRequirementLoader = _RecordLoader( + MultipleInputFeatureRequirement, None, None +) +StepInputExpressionRequirementLoader = _RecordLoader( + StepInputExpressionRequirement, None, None ) -InlineJavascriptRequirementLoader = _RecordLoader(InlineJavascriptRequirement) -SchemaDefRequirementLoader = _RecordLoader(SchemaDefRequirement) -LoadListingRequirementLoader = _RecordLoader(LoadListingRequirement) -DockerRequirementLoader = _RecordLoader(DockerRequirement) -SoftwareRequirementLoader = _RecordLoader(SoftwareRequirement) -InitialWorkDirRequirementLoader = _RecordLoader(InitialWorkDirRequirement) -EnvVarRequirementLoader = _RecordLoader(EnvVarRequirement) -ShellCommandRequirementLoader = _RecordLoader(ShellCommandRequirement) -ResourceRequirementLoader = _RecordLoader(ResourceRequirement) -WorkReuseLoader = _RecordLoader(WorkReuse) -NetworkAccessLoader = _RecordLoader(NetworkAccess) -InplaceUpdateRequirementLoader = _RecordLoader(InplaceUpdateRequirement) -ToolTimeLimitLoader = _RecordLoader(ToolTimeLimit) -SubworkflowFeatureRequirementLoader = _RecordLoader(SubworkflowFeatureRequirement) -ScatterFeatureRequirementLoader = _RecordLoader(ScatterFeatureRequirement) -MultipleInputFeatureRequirementLoader = _RecordLoader(MultipleInputFeatureRequirement) -StepInputExpressionRequirementLoader = _RecordLoader(StepInputExpressionRequirement) union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_LoadListingRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_InplaceUpdateRequirementLoader_or_ToolTimeLimitLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader = _UnionLoader( ( InlineJavascriptRequirementLoader, @@ -23293,8 +23018,7 @@ def save( ) ) array_of_union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_LoadListingRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_InplaceUpdateRequirementLoader_or_ToolTimeLimitLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader = _ArrayLoader( - union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_LoadListingRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_InplaceUpdateRequirementLoader_or_ToolTimeLimitLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader, - True, + union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_LoadListingRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_InplaceUpdateRequirementLoader_or_ToolTimeLimitLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader ) union_of_None_type_or_array_of_union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_LoadListingRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_InplaceUpdateRequirementLoader_or_ToolTimeLimitLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader_or_CWLObjectTypeLoader = _UnionLoader( ( @@ -23304,7 +23028,10 @@ def save( ) ) map_of_union_of_None_type_or_array_of_union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_LoadListingRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_InplaceUpdateRequirementLoader_or_ToolTimeLimitLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader_or_CWLObjectTypeLoader = _MapLoader( - union_of_None_type_or_array_of_union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_LoadListingRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_InplaceUpdateRequirementLoader_or_ToolTimeLimitLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader_or_CWLObjectTypeLoader + union_of_None_type_or_array_of_union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_LoadListingRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_InplaceUpdateRequirementLoader_or_ToolTimeLimitLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader_or_CWLObjectTypeLoader, + "CWLInputFile", + "@list", + True, ) CWLInputFileLoader = map_of_union_of_None_type_or_array_of_union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_LoadListingRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_InplaceUpdateRequirementLoader_or_ToolTimeLimitLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader_or_CWLObjectTypeLoader CWLVersionLoader = _EnumLoader( @@ -23346,30 +23073,30 @@ def save( deep_listing: Load the directory listing and recursively load all subdirectories as well. """ ExpressionLoader = _ExpressionLoader(str) -InputBindingLoader = _RecordLoader(InputBinding) -InputRecordFieldLoader = _RecordLoader(InputRecordField) -InputRecordSchemaLoader = _RecordLoader(InputRecordSchema) -InputEnumSchemaLoader = _RecordLoader(InputEnumSchema) -InputArraySchemaLoader = _RecordLoader(InputArraySchema) -OutputRecordFieldLoader = _RecordLoader(OutputRecordField) -OutputRecordSchemaLoader = _RecordLoader(OutputRecordSchema) -OutputEnumSchemaLoader = _RecordLoader(OutputEnumSchema) -OutputArraySchemaLoader = _RecordLoader(OutputArraySchema) -SecondaryFileSchemaLoader = _RecordLoader(SecondaryFileSchema) -EnvironmentDefLoader = _RecordLoader(EnvironmentDef) -CommandLineBindingLoader = _RecordLoader(CommandLineBinding) -CommandOutputBindingLoader = _RecordLoader(CommandOutputBinding) -CommandLineBindableLoader = _RecordLoader(CommandLineBindable) -CommandInputRecordFieldLoader = _RecordLoader(CommandInputRecordField) -CommandInputRecordSchemaLoader = _RecordLoader(CommandInputRecordSchema) -CommandInputEnumSchemaLoader = _RecordLoader(CommandInputEnumSchema) -CommandInputArraySchemaLoader = _RecordLoader(CommandInputArraySchema) -CommandOutputRecordFieldLoader = _RecordLoader(CommandOutputRecordField) -CommandOutputRecordSchemaLoader = _RecordLoader(CommandOutputRecordSchema) -CommandOutputEnumSchemaLoader = _RecordLoader(CommandOutputEnumSchema) -CommandOutputArraySchemaLoader = _RecordLoader(CommandOutputArraySchema) -CommandInputParameterLoader = _RecordLoader(CommandInputParameter) -CommandOutputParameterLoader = _RecordLoader(CommandOutputParameter) +InputBindingLoader = _RecordLoader(InputBinding, None, None) +InputRecordFieldLoader = _RecordLoader(InputRecordField, None, None) +InputRecordSchemaLoader = _RecordLoader(InputRecordSchema, None, None) +InputEnumSchemaLoader = _RecordLoader(InputEnumSchema, None, None) +InputArraySchemaLoader = _RecordLoader(InputArraySchema, None, None) +OutputRecordFieldLoader = _RecordLoader(OutputRecordField, None, None) +OutputRecordSchemaLoader = _RecordLoader(OutputRecordSchema, None, None) +OutputEnumSchemaLoader = _RecordLoader(OutputEnumSchema, None, None) +OutputArraySchemaLoader = _RecordLoader(OutputArraySchema, None, None) +SecondaryFileSchemaLoader = _RecordLoader(SecondaryFileSchema, None, None) +EnvironmentDefLoader = _RecordLoader(EnvironmentDef, None, None) +CommandLineBindingLoader = _RecordLoader(CommandLineBinding, None, None) +CommandOutputBindingLoader = _RecordLoader(CommandOutputBinding, None, None) +CommandLineBindableLoader = _RecordLoader(CommandLineBindable, None, None) +CommandInputRecordFieldLoader = _RecordLoader(CommandInputRecordField, None, None) +CommandInputRecordSchemaLoader = _RecordLoader(CommandInputRecordSchema, None, None) +CommandInputEnumSchemaLoader = _RecordLoader(CommandInputEnumSchema, None, None) +CommandInputArraySchemaLoader = _RecordLoader(CommandInputArraySchema, None, None) +CommandOutputRecordFieldLoader = _RecordLoader(CommandOutputRecordField, None, None) +CommandOutputRecordSchemaLoader = _RecordLoader(CommandOutputRecordSchema, None, None) +CommandOutputEnumSchemaLoader = _RecordLoader(CommandOutputEnumSchema, None, None) +CommandOutputArraySchemaLoader = _RecordLoader(CommandOutputArraySchema, None, None) +CommandInputParameterLoader = _RecordLoader(CommandInputParameter, None, None) +CommandOutputParameterLoader = _RecordLoader(CommandOutputParameter, None, None) stdinLoader = _EnumLoader(("stdin",), "stdin") """ Only valid as a `type` for a `CommandLineTool` input with no @@ -23480,12 +23207,14 @@ def save( stderr: random_stderr_filenameABCDEFG ``` """ -CommandLineToolLoader = _RecordLoader(CommandLineTool) -SoftwarePackageLoader = _RecordLoader(SoftwarePackage) -DirentLoader = _RecordLoader(Dirent) -ExpressionToolOutputParameterLoader = _RecordLoader(ExpressionToolOutputParameter) -WorkflowInputParameterLoader = _RecordLoader(WorkflowInputParameter) -ExpressionToolLoader = _RecordLoader(ExpressionTool) +CommandLineToolLoader = _RecordLoader(CommandLineTool, None, None) +SoftwarePackageLoader = _RecordLoader(SoftwarePackage, None, None) +DirentLoader = _RecordLoader(Dirent, None, None) +ExpressionToolOutputParameterLoader = _RecordLoader( + ExpressionToolOutputParameter, None, None +) +WorkflowInputParameterLoader = _RecordLoader(WorkflowInputParameter, None, None) +ExpressionToolLoader = _RecordLoader(ExpressionTool, None, None) LinkMergeMethodLoader = _EnumLoader( ( "merge_nested", @@ -23496,9 +23225,9 @@ def save( """ The input link merge method, described in [WorkflowStepInput](#WorkflowStepInput). """ -WorkflowOutputParameterLoader = _RecordLoader(WorkflowOutputParameter) -WorkflowStepInputLoader = _RecordLoader(WorkflowStepInput) -WorkflowStepOutputLoader = _RecordLoader(WorkflowStepOutput) +WorkflowOutputParameterLoader = _RecordLoader(WorkflowOutputParameter, None, None) +WorkflowStepInputLoader = _RecordLoader(WorkflowStepInput, None, None) +WorkflowStepOutputLoader = _RecordLoader(WorkflowStepOutput, None, None) ScatterMethodLoader = _EnumLoader( ( "dotproduct", @@ -23510,9 +23239,9 @@ def save( """ The scatter method, as described in [workflow step scatter](#WorkflowStep). """ -WorkflowStepLoader = _RecordLoader(WorkflowStep) -WorkflowLoader = _RecordLoader(Workflow) -array_of_strtype = _ArrayLoader(strtype, True) +WorkflowStepLoader = _RecordLoader(WorkflowStep, None, None) +WorkflowLoader = _RecordLoader(Workflow, None, None) +array_of_strtype = _ArrayLoader(strtype) union_of_None_type_or_strtype_or_array_of_strtype = _UnionLoader( ( None_type, @@ -23533,8 +23262,7 @@ def save( ) ) array_of_union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype = _ArrayLoader( - union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype, - True, + union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype ) union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype_or_array_of_union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype = _UnionLoader( ( @@ -23553,7 +23281,7 @@ def save( 2, "v1.1", ) -array_of_RecordFieldLoader = _ArrayLoader(RecordFieldLoader, True) +array_of_RecordFieldLoader = _ArrayLoader(RecordFieldLoader) union_of_None_type_or_array_of_RecordFieldLoader = _UnionLoader( ( None_type, @@ -23579,15 +23307,6 @@ def save( ) Enum_nameLoader = _EnumLoader(("enum",), "Enum_name") typedsl_Enum_nameLoader_2 = _TypeDSLLoader(Enum_nameLoader, 2, "v1.1") -union_of_None_type_or_booltype = _UnionLoader( - ( - None_type, - booltype, - ) -) -uri_union_of_None_type_or_booltype_False_True_2_None = _URILoader( - union_of_None_type_or_booltype, False, True, 2, None -) uri_union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype_or_array_of_union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype_False_True_2_None = _URILoader( union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype_or_array_of_union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype, False, @@ -23611,8 +23330,7 @@ def save( ) ) array_of_union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype = _ArrayLoader( - union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype, - True, + union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype ) union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype_or_array_of_union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype = _UnionLoader( ( @@ -23636,7 +23354,7 @@ def save( 2, "v1.1", ) -array_of_CWLRecordFieldLoader = _ArrayLoader(CWLRecordFieldLoader, True) +array_of_CWLRecordFieldLoader = _ArrayLoader(CWLRecordFieldLoader) union_of_None_type_or_array_of_CWLRecordFieldLoader = _UnionLoader( ( None_type, @@ -23666,7 +23384,7 @@ def save( ) ) array_of_union_of_FileLoader_or_DirectoryLoader = _ArrayLoader( - union_of_FileLoader_or_DirectoryLoader, True + union_of_FileLoader_or_DirectoryLoader ) union_of_None_type_or_array_of_union_of_FileLoader_or_DirectoryLoader = _UnionLoader( ( @@ -23689,13 +23407,19 @@ def save( uri_Directory_classLoader_False_True_None_None = _URILoader( Directory_classLoader, False, True, None, None ) +union_of_None_type_or_booltype = _UnionLoader( + ( + None_type, + booltype, + ) +) union_of_None_type_or_LoadListingEnumLoader = _UnionLoader( ( None_type, LoadListingEnumLoader, ) ) -array_of_SecondaryFileSchemaLoader = _ArrayLoader(SecondaryFileSchemaLoader, True) +array_of_SecondaryFileSchemaLoader = _ArrayLoader(SecondaryFileSchemaLoader) union_of_None_type_or_SecondaryFileSchemaLoader_or_array_of_SecondaryFileSchemaLoader = _UnionLoader( ( None_type, @@ -23746,8 +23470,7 @@ def save( ) ) array_of_union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype = _ArrayLoader( - union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype, - True, + union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype ) union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype = _UnionLoader( ( @@ -23764,7 +23487,7 @@ def save( 2, "v1.1", ) -array_of_InputRecordFieldLoader = _ArrayLoader(InputRecordFieldLoader, True) +array_of_InputRecordFieldLoader = _ArrayLoader(InputRecordFieldLoader) union_of_None_type_or_array_of_InputRecordFieldLoader = _UnionLoader( ( None_type, @@ -23791,8 +23514,7 @@ def save( ) ) array_of_union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype = _ArrayLoader( - union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype, - True, + union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype ) union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype = _UnionLoader( ( @@ -23809,7 +23531,7 @@ def save( 2, "v1.1", ) -array_of_OutputRecordFieldLoader = _ArrayLoader(OutputRecordFieldLoader, True) +array_of_OutputRecordFieldLoader = _ArrayLoader(OutputRecordFieldLoader) union_of_None_type_or_array_of_OutputRecordFieldLoader = _UnionLoader( ( None_type, @@ -23833,9 +23555,7 @@ def save( ) ) array_of_union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader = ( - _ArrayLoader( - union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader, True - ) + _ArrayLoader(union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader) ) idmap_inputs_array_of_union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader = _IdMapLoader( array_of_union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader, @@ -23850,8 +23570,7 @@ def save( ) ) array_of_union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader = _ArrayLoader( - union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader, - True, + union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader ) idmap_outputs_array_of_union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader = _IdMapLoader( array_of_union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader, @@ -23892,8 +23611,7 @@ def save( ) ) array_of_union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_LoadListingRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_InplaceUpdateRequirementLoader_or_ToolTimeLimitLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader_or_Any_type = _ArrayLoader( - union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_LoadListingRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_InplaceUpdateRequirementLoader_or_ToolTimeLimitLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader_or_Any_type, - True, + union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_LoadListingRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_InplaceUpdateRequirementLoader_or_ToolTimeLimitLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader_or_Any_type ) union_of_None_type_or_array_of_union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_LoadListingRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_InplaceUpdateRequirementLoader_or_ToolTimeLimitLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader_or_Any_type = _UnionLoader( ( @@ -23941,8 +23659,7 @@ def save( ) ) array_of_union_of_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader = _ArrayLoader( - union_of_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader, - True, + union_of_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader ) union_of_strtype_or_ExpressionLoader = _UnionLoader( ( @@ -24000,8 +23717,7 @@ def save( ) ) array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype = _ArrayLoader( - union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype, - True, + union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype ) union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype = _UnionLoader( ( @@ -24018,9 +23734,7 @@ def save( 2, "v1.1", ) -array_of_CommandInputRecordFieldLoader = _ArrayLoader( - CommandInputRecordFieldLoader, True -) +array_of_CommandInputRecordFieldLoader = _ArrayLoader(CommandInputRecordFieldLoader) union_of_None_type_or_array_of_CommandInputRecordFieldLoader = _UnionLoader( ( None_type, @@ -24049,8 +23763,7 @@ def save( ) ) array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype = _ArrayLoader( - union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype, - True, + union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype ) union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype = _UnionLoader( ( @@ -24073,9 +23786,7 @@ def save( CommandOutputBindingLoader, ) ) -array_of_CommandOutputRecordFieldLoader = _ArrayLoader( - CommandOutputRecordFieldLoader, True -) +array_of_CommandOutputRecordFieldLoader = _ArrayLoader(CommandOutputRecordFieldLoader) union_of_None_type_or_array_of_CommandOutputRecordFieldLoader = _UnionLoader( ( None_type, @@ -24131,11 +23842,11 @@ def save( uri_CommandLineTool_classLoader_False_True_None_None = _URILoader( CommandLineTool_classLoader, False, True, None, None ) -array_of_CommandInputParameterLoader = _ArrayLoader(CommandInputParameterLoader, True) +array_of_CommandInputParameterLoader = _ArrayLoader(CommandInputParameterLoader) idmap_inputs_array_of_CommandInputParameterLoader = _IdMapLoader( array_of_CommandInputParameterLoader, "id", "type" ) -array_of_CommandOutputParameterLoader = _ArrayLoader(CommandOutputParameterLoader, True) +array_of_CommandOutputParameterLoader = _ArrayLoader(CommandOutputParameterLoader) idmap_outputs_array_of_CommandOutputParameterLoader = _IdMapLoader( array_of_CommandOutputParameterLoader, "id", "type" ) @@ -24147,7 +23858,7 @@ def save( ) ) array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader = ( - _ArrayLoader(union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader, True) + _ArrayLoader(union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader) ) union_of_None_type_or_array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader = _UnionLoader( ( @@ -24155,7 +23866,7 @@ def save( array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader, ) ) -array_of_inttype = _ArrayLoader(inttype, True) +array_of_inttype = _ArrayLoader(inttype) union_of_None_type_or_array_of_inttype = _UnionLoader( ( None_type, @@ -24174,7 +23885,7 @@ def save( uri_SoftwareRequirement_classLoader_False_True_None_None = _URILoader( SoftwareRequirement_classLoader, False, True, None, None ) -array_of_SoftwarePackageLoader = _ArrayLoader(SoftwarePackageLoader, True) +array_of_SoftwarePackageLoader = _ArrayLoader(SoftwarePackageLoader) idmap_packages_array_of_SoftwarePackageLoader = _IdMapLoader( array_of_SoftwarePackageLoader, "package", "specs" ) @@ -24198,8 +23909,7 @@ def save( ) ) array_of_union_of_None_type_or_FileLoader_or_array_of_union_of_FileLoader_or_DirectoryLoader_or_DirectoryLoader_or_DirentLoader_or_ExpressionLoader = _ArrayLoader( - union_of_None_type_or_FileLoader_or_array_of_union_of_FileLoader_or_DirectoryLoader_or_DirectoryLoader_or_DirentLoader_or_ExpressionLoader, - True, + union_of_None_type_or_FileLoader_or_array_of_union_of_FileLoader_or_DirectoryLoader_or_DirectoryLoader_or_DirentLoader_or_ExpressionLoader ) union_of_array_of_union_of_None_type_or_FileLoader_or_array_of_union_of_FileLoader_or_DirectoryLoader_or_DirectoryLoader_or_DirentLoader_or_ExpressionLoader_or_ExpressionLoader = _UnionLoader( ( @@ -24213,7 +23923,7 @@ def save( uri_EnvVarRequirement_classLoader_False_True_None_None = _URILoader( EnvVarRequirement_classLoader, False, True, None, None ) -array_of_EnvironmentDefLoader = _ArrayLoader(EnvironmentDefLoader, True) +array_of_EnvironmentDefLoader = _ArrayLoader(EnvironmentDefLoader) idmap_envDef_array_of_EnvironmentDefLoader = _IdMapLoader( array_of_EnvironmentDefLoader, "envName", "envValue" ) @@ -24269,12 +23979,12 @@ def save( uri_ExpressionTool_classLoader_False_True_None_None = _URILoader( ExpressionTool_classLoader, False, True, None, None ) -array_of_WorkflowInputParameterLoader = _ArrayLoader(WorkflowInputParameterLoader, True) +array_of_WorkflowInputParameterLoader = _ArrayLoader(WorkflowInputParameterLoader) idmap_inputs_array_of_WorkflowInputParameterLoader = _IdMapLoader( array_of_WorkflowInputParameterLoader, "id", "type" ) array_of_ExpressionToolOutputParameterLoader = _ArrayLoader( - ExpressionToolOutputParameterLoader, True + ExpressionToolOutputParameterLoader ) idmap_outputs_array_of_ExpressionToolOutputParameterLoader = _IdMapLoader( array_of_ExpressionToolOutputParameterLoader, "id", "type" @@ -24291,7 +24001,7 @@ def save( uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_2_None = _URILoader( union_of_None_type_or_strtype_or_array_of_strtype, False, False, 2, None ) -array_of_WorkflowStepInputLoader = _ArrayLoader(WorkflowStepInputLoader, True) +array_of_WorkflowStepInputLoader = _ArrayLoader(WorkflowStepInputLoader) idmap_in__array_of_WorkflowStepInputLoader = _IdMapLoader( array_of_WorkflowStepInputLoader, "id", "source" ) @@ -24302,7 +24012,7 @@ def save( ) ) array_of_union_of_strtype_or_WorkflowStepOutputLoader = _ArrayLoader( - union_of_strtype_or_WorkflowStepOutputLoader, True + union_of_strtype_or_WorkflowStepOutputLoader ) union_of_array_of_union_of_strtype_or_WorkflowStepOutputLoader = _UnionLoader( (array_of_union_of_strtype_or_WorkflowStepOutputLoader,) @@ -24314,7 +24024,7 @@ def save( None, None, ) -array_of_Any_type = _ArrayLoader(Any_type, True) +array_of_Any_type = _ArrayLoader(Any_type) union_of_None_type_or_array_of_Any_type = _UnionLoader( ( None_type, @@ -24357,13 +24067,11 @@ def save( uri_Workflow_classLoader_False_True_None_None = _URILoader( Workflow_classLoader, False, True, None, None ) -array_of_WorkflowOutputParameterLoader = _ArrayLoader( - WorkflowOutputParameterLoader, True -) +array_of_WorkflowOutputParameterLoader = _ArrayLoader(WorkflowOutputParameterLoader) idmap_outputs_array_of_WorkflowOutputParameterLoader = _IdMapLoader( array_of_WorkflowOutputParameterLoader, "id", "type" ) -array_of_WorkflowStepLoader = _ArrayLoader(WorkflowStepLoader, True) +array_of_WorkflowStepLoader = _ArrayLoader(WorkflowStepLoader) union_of_array_of_WorkflowStepLoader = _UnionLoader((array_of_WorkflowStepLoader,)) idmap_steps_union_of_array_of_WorkflowStepLoader = _IdMapLoader( union_of_array_of_WorkflowStepLoader, "id", "None" @@ -24401,7 +24109,7 @@ def save( ) array_of_union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader = ( _ArrayLoader( - union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader, True + union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader ) ) union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_array_of_union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader = _UnionLoader( diff --git a/cwl_utils/parser/cwl_v1_1_utils.py b/cwl_utils/parser/cwl_v1_1_utils.py index 466e4f77..f942708c 100644 --- a/cwl_utils/parser/cwl_v1_1_utils.py +++ b/cwl_utils/parser/cwl_v1_1_utils.py @@ -44,9 +44,9 @@ def _compare_records( This handles normalizing record names, which will be relative to workflow step, so that they can be compared. """ - srcfields = {cwl.shortname(field.name): field.type for field in (src.fields or {})} + srcfields = {cwl.shortname(field.name): field.type_ for field in (src.fields or {})} sinkfields = { - cwl.shortname(field.name): field.type for field in (sink.fields or {}) + cwl.shortname(field.name): field.type_ for field in (sink.fields or {}) } for key in sinkfields.keys(): if ( @@ -77,10 +77,10 @@ def _compare_type(type1: Any, type2: Any) -> bool: return _compare_type(type1.items, type2.items) elif isinstance(type1, cwl.RecordSchema) and isinstance(type2, cwl.RecordSchema): fields1 = { - cwl.shortname(field.name): field.type for field in (type1.fields or {}) + cwl.shortname(field.name): field.type_ for field in (type1.fields or {}) } fields2 = { - cwl.shortname(field.name): field.type for field in (type2.fields or {}) + cwl.shortname(field.name): field.type_ for field in (type2.fields or {}) } if fields1.keys() != fields2.keys(): return False @@ -256,7 +256,7 @@ def check_types( return "exception" if linkMerge == "merge_nested": return check_types( - cwl.ArraySchema(items=srctype, type="array"), sinktype, None, None + cwl.ArraySchema(items=srctype, type_="array"), sinktype, None, None ) if linkMerge == "merge_flattened": return check_types(merge_flatten_type(srctype), sinktype, None, None) @@ -284,7 +284,7 @@ def content_limit_respected_read(f: IO[bytes]) -> str: def convert_stdstreams_to_files(clt: cwl.CommandLineTool) -> None: """Convert stdin, stdout and stderr type shortcuts to files.""" for out in clt.outputs: - if out.type == "stdout": + if out.type_ == "stdout": if out.outputBinding is not None: raise ValidationException( "Not allowed to specify outputBinding when using stdout shortcut." @@ -295,9 +295,9 @@ def convert_stdstreams_to_files(clt: cwl.CommandLineTool) -> None: json_dumps(clt.save(), sort_keys=True).encode("utf-8") ).hexdigest() ) - out.type = "File" + out.type_ = "File" out.outputBinding = cwl.CommandOutputBinding(glob=clt.stdout) - elif out.type == "stderr": + elif out.type_ == "stderr": if out.outputBinding is not None: raise ValidationException( "Not allowed to specify outputBinding when using stderr shortcut." @@ -308,10 +308,10 @@ def convert_stdstreams_to_files(clt: cwl.CommandLineTool) -> None: json_dumps(clt.save(), sort_keys=True).encode("utf-8") ).hexdigest() ) - out.type = "File" + out.type_ = "File" out.outputBinding = cwl.CommandOutputBinding(glob=clt.stderr) for inp in clt.inputs: - if inp.type == "stdin": + if inp.type_ == "stdin": if inp.inputBinding is not None: raise ValidationException( "Not allowed to specify unputBinding when using stdin shortcut." @@ -325,7 +325,7 @@ def convert_stdstreams_to_files(clt: cwl.CommandLineTool) -> None: "$(inputs.%s.path)" % cast(str, inp.id).rpartition("#")[2].split("/")[-1] ) - inp.type = "File" + inp.type_ = "File" def load_inputfile( @@ -339,7 +339,6 @@ def load_inputfile( if loadingOptions is None: loadingOptions = cwl.LoadingOptions() - loadingOptions = cwl.LoadingOptions(copyfrom=loadingOptions, no_link_check=True) result, metadata = _inputfile_load( doc, baseuri, @@ -361,7 +360,6 @@ def load_inputfile_by_string( if loadingOptions is None: loadingOptions = cwl.LoadingOptions(fileuri=uri) - loadingOptions = cwl.LoadingOptions(copyfrom=loadingOptions, no_link_check=True) result, metadata = _inputfile_load( result, uri, @@ -381,7 +379,6 @@ def load_inputfile_by_yaml( if loadingOptions is None: loadingOptions = cwl.LoadingOptions(fileuri=uri) - loadingOptions = cwl.LoadingOptions(copyfrom=loadingOptions, no_link_check=True) result, metadata = _inputfile_load( yaml, uri, @@ -396,7 +393,7 @@ def merge_flatten_type(src: Any) -> Any: return [merge_flatten_type(t) for t in src] if isinstance(src, cwl.ArraySchema): return src - return cwl.ArraySchema(type="array", items=src) + return cwl.ArraySchema(type_="array", items=src) def type_for_step_input( @@ -414,9 +411,9 @@ def type_for_step_input( cast(str, step_input.id).split("#")[-1] == cast(str, in_.id).split("#")[-1] ): - input_type = step_input.type + input_type = step_input.type_ if step.scatter is not None and in_.id in aslist(step.scatter): - input_type = cwl.ArraySchema(items=input_type, type="array") + input_type = cwl.ArraySchema(items=input_type, type_="array") return input_type return "Any" @@ -434,15 +431,15 @@ def type_for_step_output( output.id.split("#")[-1].split("/")[-1] == sourcename.split("#")[-1].split("/")[-1] ): - output_type = output.type + output_type = output.type_ if step.scatter is not None: if step.scatterMethod == "nested_crossproduct": for _ in range(len(aslist(step.scatter))): output_type = cwl.ArraySchema( - items=output_type, type="array" + items=output_type, type_="array" ) else: - output_type = cwl.ArraySchema(items=output_type, type="array") + output_type = cwl.ArraySchema(items=output_type, type_="array") return output_type raise ValidationException( "param {} not found in {}.".format( @@ -462,15 +459,15 @@ def type_for_source( scatter_context: List[Optional[Tuple[int, str]]] = [] params = param_for_source_id(process, sourcenames, parent, scatter_context) if not isinstance(params, list): - new_type = params.type + new_type = params.type_ if scatter_context[0] is not None: if scatter_context[0][1] == "nested_crossproduct": for _ in range(scatter_context[0][0]): - new_type = cwl.ArraySchema(items=new_type, type="array") + new_type = cwl.ArraySchema(items=new_type, type_="array") else: - new_type = cwl.ArraySchema(items=new_type, type="array") + new_type = cwl.ArraySchema(items=new_type, type_="array") if linkMerge == "merge_nested": - new_type = cwl.ArraySchema(items=new_type, type="array") + new_type = cwl.ArraySchema(items=new_type, type_="array") elif linkMerge == "merge_flattened": new_type = merge_flatten_type(new_type) return new_type @@ -478,26 +475,28 @@ def type_for_source( for p, sc in zip(params, scatter_context): if isinstance(p, str) and not any(_compare_type(t, p) for t in new_type): cur_type = p - elif hasattr(p, "type") and not any(_compare_type(t, p.type) for t in new_type): - cur_type = p.type + elif hasattr(p, "type_") and not any( + _compare_type(t, p.type_) for t in new_type + ): + cur_type = p.type_ else: cur_type = None if cur_type is not None: if sc is not None: if sc[1] == "nested_crossproduct": for _ in range(sc[0]): - cur_type = cwl.ArraySchema(items=cur_type, type="array") + cur_type = cwl.ArraySchema(items=cur_type, type_="array") else: - cur_type = cwl.ArraySchema(items=cur_type, type="array") + cur_type = cwl.ArraySchema(items=cur_type, type_="array") new_type.append(cur_type) if len(new_type) == 1: new_type = new_type[0] if linkMerge == "merge_nested": - return cwl.ArraySchema(items=new_type, type="array") + return cwl.ArraySchema(items=new_type, type_="array") elif linkMerge == "merge_flattened": return merge_flatten_type(new_type) elif isinstance(sourcenames, List) and len(sourcenames) > 1: - return cwl.ArraySchema(items=new_type, type="array") + return cwl.ArraySchema(items=new_type, type_="array") else: return new_type diff --git a/cwl_utils/parser/cwl_v1_2.py b/cwl_utils/parser/cwl_v1_2.py index 8df9394a..fea42807 100644 --- a/cwl_utils/parser/cwl_v1_2.py +++ b/cwl_utils/parser/cwl_v1_2.py @@ -61,6 +61,7 @@ class LoadingOptions: imports: List[str] includes: List[str] no_link_check: Optional[bool] + container: Optional[str] def __init__( self, @@ -75,7 +76,8 @@ def __init__( idx: Optional[IdxType] = None, imports: Optional[List[str]] = None, includes: Optional[List[str]] = None, - no_link_check: bool = False, + no_link_check: Optional[bool] = None, + container: Optional[str] = None, ) -> None: """Create a LoadingOptions object.""" self.original_doc = original_doc @@ -120,7 +122,15 @@ def __init__( else: self.includes = copyfrom.includes if copyfrom is not None else [] - self.no_link_check = no_link_check + if no_link_check is not None: + self.no_link_check = no_link_check + else: + self.no_link_check = copyfrom.no_link_check if copyfrom is not None else False + + if container is not None: + self.container = container + else: + self.container = copyfrom.container if copyfrom is not None else None if fetcher is not None: self.fetcher = fetcher @@ -462,9 +472,8 @@ def __repr__(self) -> str: class _ArrayLoader(_Loader): - def __init__(self, items: _Loader, flatten: bool = True) -> None: + def __init__(self, items: _Loader) -> None: self.items = items - self.flatten = flatten def load( self, @@ -487,7 +496,8 @@ def load( lf = load_field( doc[i], _UnionLoader(([self, self.items])), baseuri, loadingOptions, lc=lc ) - if self.flatten and isinstance(lf, MutableSequence): + flatten = loadingOptions.container != "@list" + if flatten and isinstance(lf, MutableSequence): r.extend(lf) else: r.append(lf) @@ -519,9 +529,17 @@ def __repr__(self) -> str: class _MapLoader(_Loader): - def __init__(self, values: _Loader, name: Optional[str] = None) -> None: + def __init__( + self, + values: _Loader, + name: Optional[str] = None, + container: Optional[str] = None, + no_link_check: Optional[bool] = None, + ) -> None: self.values = values self.name = name + self.container = container + self.no_link_check = no_link_check def load( self, @@ -533,6 +551,10 @@ def load( ) -> Any: if not isinstance(doc, MutableMapping): raise ValidationException(f"Expected a map, was {type(doc)}") + if self.container is not None or self.no_link_check is not None: + loadingOptions = LoadingOptions( + copyfrom=loadingOptions, container=self.container, no_link_check=self.no_link_check + ) r: Dict[str, Any] = {} errors: List[SchemaSaladException] = [] for k, v in doc.items(): @@ -643,8 +665,15 @@ def load( class _RecordLoader(_Loader): - def __init__(self, classtype: Type[Saveable]) -> None: + def __init__( + self, + classtype: Type[Saveable], + container: Optional[str] = None, + no_link_check: Optional[bool] = None, + ) -> None: self.classtype = classtype + self.container = container + self.no_link_check = no_link_check def load( self, @@ -659,6 +688,10 @@ def load( f"Value is a {convert_typing(extract_type(type(doc)))}, " f"but valid type for this field is an object." ) + if self.container is not None or self.no_link_check is not None: + loadingOptions = LoadingOptions( + copyfrom=loadingOptions, container=self.container, no_link_check=self.no_link_check + ) return self.classtype.fromDoc(doc, baseuri, loadingOptions, docRoot=docRoot) def __repr__(self) -> str: @@ -1837,7 +1870,6 @@ def __init__( self, items: Any, type_: Any, - flatten: Optional[Any] = None, extension_fields: Optional[Dict[str, Any]] = None, loadingOptions: Optional[LoadingOptions] = None, ) -> None: @@ -1849,21 +1881,16 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.flatten = flatten self.items = items self.type_ = type_ def __eq__(self, other: Any) -> bool: if isinstance(other, ArraySchema): - return bool( - self.flatten == other.flatten - and self.items == other.items - and self.type_ == other.type_ - ) + return bool(self.items == other.items and self.type_ == other.type_) return False def __hash__(self) -> int: - return hash((self.flatten, self.items, self.type_)) + return hash((self.items, self.type_)) @classmethod def fromDoc( @@ -1879,48 +1906,6 @@ def fromDoc( _doc.lc.data = doc.lc.data _doc.lc.filename = doc.lc.filename _errors__ = [] - if "flatten" in _doc: - try: - flatten = load_field( - _doc.get("flatten"), - uri_union_of_None_type_or_booltype_False_True_2_None, - baseuri, - loadingOptions, - lc=_doc.get("flatten") - ) - - except ValidationException as e: - error_message, to_print, verb_tensage = parse_errors(str(e)) - - if str(e) == "missing required field `flatten`": - _errors__.append( - ValidationException( - str(e), - None - ) - ) - else: - if error_message != str(e): - val_type = convert_typing(extract_type(type(_doc.get("flatten")))) - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [ValidationException(f"Value is a {val_type}, " - f"but valid {to_print} for this field " - f"{verb_tensage} {error_message}")], - ) - ) - else: - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [e], - ) - ) - else: - flatten = None try: if _doc.get("items") is None: raise ValidationException("missing required field `items`", None, []) @@ -2020,7 +2005,7 @@ def fromDoc( else: _errors__.append( ValidationException( - "invalid field `{}`, expected one of: `flatten`, `items`, `type`".format( + "invalid field `{}`, expected one of: `items`, `type`".format( k ), SourceLine(_doc, k, str), @@ -2030,7 +2015,6 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - flatten=flatten, items=items, type_=type_, extension_fields=extension_fields, @@ -2049,9 +2033,6 @@ def save( else: for ef in self.extension_fields: r[ef] = self.extension_fields[ef] - if self.flatten is not None: - u = save_relative_uri(self.flatten, base_url, False, 2, relative_uris) - r["flatten"] = u if self.items is not None: u = save_relative_uri(self.items, base_url, False, 2, relative_uris) r["items"] = u @@ -2068,7 +2049,7 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["flatten", "items", "type"]) + attrs = frozenset(["items", "type"]) class MapSchema(Saveable): @@ -2450,7 +2431,6 @@ def __init__( self, items: Any, type_: Any, - flatten: Optional[Any] = None, extension_fields: Optional[Dict[str, Any]] = None, loadingOptions: Optional[LoadingOptions] = None, ) -> None: @@ -2462,21 +2442,16 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.flatten = flatten self.items = items self.type_ = type_ def __eq__(self, other: Any) -> bool: if isinstance(other, CWLArraySchema): - return bool( - self.flatten == other.flatten - and self.items == other.items - and self.type_ == other.type_ - ) + return bool(self.items == other.items and self.type_ == other.type_) return False def __hash__(self) -> int: - return hash((self.flatten, self.items, self.type_)) + return hash((self.items, self.type_)) @classmethod def fromDoc( @@ -2492,48 +2467,6 @@ def fromDoc( _doc.lc.data = doc.lc.data _doc.lc.filename = doc.lc.filename _errors__ = [] - if "flatten" in _doc: - try: - flatten = load_field( - _doc.get("flatten"), - uri_union_of_None_type_or_booltype_False_True_2_None, - baseuri, - loadingOptions, - lc=_doc.get("flatten") - ) - - except ValidationException as e: - error_message, to_print, verb_tensage = parse_errors(str(e)) - - if str(e) == "missing required field `flatten`": - _errors__.append( - ValidationException( - str(e), - None - ) - ) - else: - if error_message != str(e): - val_type = convert_typing(extract_type(type(_doc.get("flatten")))) - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [ValidationException(f"Value is a {val_type}, " - f"but valid {to_print} for this field " - f"{verb_tensage} {error_message}")], - ) - ) - else: - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [e], - ) - ) - else: - flatten = None try: if _doc.get("items") is None: raise ValidationException("missing required field `items`", None, []) @@ -2633,7 +2566,7 @@ def fromDoc( else: _errors__.append( ValidationException( - "invalid field `{}`, expected one of: `flatten`, `items`, `type`".format( + "invalid field `{}`, expected one of: `items`, `type`".format( k ), SourceLine(_doc, k, str), @@ -2643,7 +2576,6 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - flatten=flatten, items=items, type_=type_, extension_fields=extension_fields, @@ -2662,9 +2594,6 @@ def save( else: for ef in self.extension_fields: r[ef] = self.extension_fields[ef] - if self.flatten is not None: - u = save_relative_uri(self.flatten, base_url, False, 2, relative_uris) - r["flatten"] = u if self.items is not None: u = save_relative_uri(self.items, base_url, False, 2, relative_uris) r["items"] = u @@ -2681,7 +2610,7 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["flatten", "items", "type"]) + attrs = frozenset(["items", "type"]) class CWLRecordField(RecordField): @@ -5697,7 +5626,6 @@ def __init__( self, items: Any, type_: Any, - flatten: Optional[Any] = None, label: Optional[Any] = None, doc: Optional[Any] = None, name: Optional[Any] = None, @@ -5712,7 +5640,6 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.flatten = flatten self.items = items self.type_ = type_ self.label = label @@ -5722,8 +5649,7 @@ def __init__( def __eq__(self, other: Any) -> bool: if isinstance(other, InputArraySchema): return bool( - self.flatten == other.flatten - and self.items == other.items + self.items == other.items and self.type_ == other.type_ and self.label == other.label and self.doc == other.doc @@ -5732,9 +5658,7 @@ def __eq__(self, other: Any) -> bool: return False def __hash__(self) -> int: - return hash( - (self.flatten, self.items, self.type_, self.label, self.doc, self.name) - ) + return hash((self.items, self.type_, self.label, self.doc, self.name)) @classmethod def fromDoc( @@ -5801,48 +5725,6 @@ def fromDoc( name = "_:" + str(_uuid__.uuid4()) if not __original_name_is_none: baseuri = name - if "flatten" in _doc: - try: - flatten = load_field( - _doc.get("flatten"), - uri_union_of_None_type_or_booltype_False_True_2_None, - baseuri, - loadingOptions, - lc=_doc.get("flatten") - ) - - except ValidationException as e: - error_message, to_print, verb_tensage = parse_errors(str(e)) - - if str(e) == "missing required field `flatten`": - _errors__.append( - ValidationException( - str(e), - None - ) - ) - else: - if error_message != str(e): - val_type = convert_typing(extract_type(type(_doc.get("flatten")))) - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [ValidationException(f"Value is a {val_type}, " - f"but valid {to_print} for this field " - f"{verb_tensage} {error_message}")], - ) - ) - else: - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [e], - ) - ) - else: - flatten = None try: if _doc.get("items") is None: raise ValidationException("missing required field `items`", None, []) @@ -6026,7 +5908,7 @@ def fromDoc( else: _errors__.append( ValidationException( - "invalid field `{}`, expected one of: `flatten`, `items`, `type`, `label`, `doc`, `name`".format( + "invalid field `{}`, expected one of: `items`, `type`, `label`, `doc`, `name`".format( k ), SourceLine(_doc, k, str), @@ -6036,7 +5918,6 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - flatten=flatten, items=items, type_=type_, label=label, @@ -6062,9 +5943,6 @@ def save( if self.name is not None: u = save_relative_uri(self.name, base_url, True, None, relative_uris) r["name"] = u - if self.flatten is not None: - u = save_relative_uri(self.flatten, self.name, False, 2, relative_uris) - r["flatten"] = u if self.items is not None: u = save_relative_uri(self.items, self.name, False, 2, relative_uris) r["items"] = u @@ -6089,7 +5967,7 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["flatten", "items", "type", "label", "doc", "name"]) + attrs = frozenset(["items", "type", "label", "doc", "name"]) class OutputRecordField(CWLRecordField, FieldBase, OutputFormat): @@ -7263,7 +7141,6 @@ def __init__( self, items: Any, type_: Any, - flatten: Optional[Any] = None, label: Optional[Any] = None, doc: Optional[Any] = None, name: Optional[Any] = None, @@ -7278,7 +7155,6 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.flatten = flatten self.items = items self.type_ = type_ self.label = label @@ -7288,8 +7164,7 @@ def __init__( def __eq__(self, other: Any) -> bool: if isinstance(other, OutputArraySchema): return bool( - self.flatten == other.flatten - and self.items == other.items + self.items == other.items and self.type_ == other.type_ and self.label == other.label and self.doc == other.doc @@ -7298,9 +7173,7 @@ def __eq__(self, other: Any) -> bool: return False def __hash__(self) -> int: - return hash( - (self.flatten, self.items, self.type_, self.label, self.doc, self.name) - ) + return hash((self.items, self.type_, self.label, self.doc, self.name)) @classmethod def fromDoc( @@ -7367,48 +7240,6 @@ def fromDoc( name = "_:" + str(_uuid__.uuid4()) if not __original_name_is_none: baseuri = name - if "flatten" in _doc: - try: - flatten = load_field( - _doc.get("flatten"), - uri_union_of_None_type_or_booltype_False_True_2_None, - baseuri, - loadingOptions, - lc=_doc.get("flatten") - ) - - except ValidationException as e: - error_message, to_print, verb_tensage = parse_errors(str(e)) - - if str(e) == "missing required field `flatten`": - _errors__.append( - ValidationException( - str(e), - None - ) - ) - else: - if error_message != str(e): - val_type = convert_typing(extract_type(type(_doc.get("flatten")))) - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [ValidationException(f"Value is a {val_type}, " - f"but valid {to_print} for this field " - f"{verb_tensage} {error_message}")], - ) - ) - else: - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [e], - ) - ) - else: - flatten = None try: if _doc.get("items") is None: raise ValidationException("missing required field `items`", None, []) @@ -7592,7 +7423,7 @@ def fromDoc( else: _errors__.append( ValidationException( - "invalid field `{}`, expected one of: `flatten`, `items`, `type`, `label`, `doc`, `name`".format( + "invalid field `{}`, expected one of: `items`, `type`, `label`, `doc`, `name`".format( k ), SourceLine(_doc, k, str), @@ -7602,7 +7433,6 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - flatten=flatten, items=items, type_=type_, label=label, @@ -7628,9 +7458,6 @@ def save( if self.name is not None: u = save_relative_uri(self.name, base_url, True, None, relative_uris) r["name"] = u - if self.flatten is not None: - u = save_relative_uri(self.flatten, self.name, False, 2, relative_uris) - r["flatten"] = u if self.items is not None: u = save_relative_uri(self.items, self.name, False, 2, relative_uris) r["items"] = u @@ -7655,7 +7482,7 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["flatten", "items", "type", "label", "doc", "name"]) + attrs = frozenset(["items", "type", "label", "doc", "name"]) class InputParameter(Parameter, InputFormat, LoadContents): @@ -11024,7 +10851,6 @@ def __init__( self, items: Any, type_: Any, - flatten: Optional[Any] = None, label: Optional[Any] = None, doc: Optional[Any] = None, name: Optional[Any] = None, @@ -11040,7 +10866,6 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.flatten = flatten self.items = items self.type_ = type_ self.label = label @@ -11051,8 +10876,7 @@ def __init__( def __eq__(self, other: Any) -> bool: if isinstance(other, CommandInputArraySchema): return bool( - self.flatten == other.flatten - and self.items == other.items + self.items == other.items and self.type_ == other.type_ and self.label == other.label and self.doc == other.doc @@ -11063,15 +10887,7 @@ def __eq__(self, other: Any) -> bool: def __hash__(self) -> int: return hash( - ( - self.flatten, - self.items, - self.type_, - self.label, - self.doc, - self.name, - self.inputBinding, - ) + (self.items, self.type_, self.label, self.doc, self.name, self.inputBinding) ) @classmethod @@ -11139,48 +10955,6 @@ def fromDoc( name = "_:" + str(_uuid__.uuid4()) if not __original_name_is_none: baseuri = name - if "flatten" in _doc: - try: - flatten = load_field( - _doc.get("flatten"), - uri_union_of_None_type_or_booltype_False_True_2_None, - baseuri, - loadingOptions, - lc=_doc.get("flatten") - ) - - except ValidationException as e: - error_message, to_print, verb_tensage = parse_errors(str(e)) - - if str(e) == "missing required field `flatten`": - _errors__.append( - ValidationException( - str(e), - None - ) - ) - else: - if error_message != str(e): - val_type = convert_typing(extract_type(type(_doc.get("flatten")))) - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [ValidationException(f"Value is a {val_type}, " - f"but valid {to_print} for this field " - f"{verb_tensage} {error_message}")], - ) - ) - else: - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [e], - ) - ) - else: - flatten = None try: if _doc.get("items") is None: raise ValidationException("missing required field `items`", None, []) @@ -11406,7 +11180,7 @@ def fromDoc( else: _errors__.append( ValidationException( - "invalid field `{}`, expected one of: `flatten`, `items`, `type`, `label`, `doc`, `name`, `inputBinding`".format( + "invalid field `{}`, expected one of: `items`, `type`, `label`, `doc`, `name`, `inputBinding`".format( k ), SourceLine(_doc, k, str), @@ -11416,7 +11190,6 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - flatten=flatten, items=items, type_=type_, label=label, @@ -11443,9 +11216,6 @@ def save( if self.name is not None: u = save_relative_uri(self.name, base_url, True, None, relative_uris) r["name"] = u - if self.flatten is not None: - u = save_relative_uri(self.flatten, self.name, False, 2, relative_uris) - r["flatten"] = u if self.items is not None: u = save_relative_uri(self.items, self.name, False, 2, relative_uris) r["items"] = u @@ -11477,9 +11247,7 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( - ["flatten", "items", "type", "label", "doc", "name", "inputBinding"] - ) + attrs = frozenset(["items", "type", "label", "doc", "name", "inputBinding"]) class CommandOutputRecordField(OutputRecordField): @@ -12716,7 +12484,6 @@ def __init__( self, items: Any, type_: Any, - flatten: Optional[Any] = None, label: Optional[Any] = None, doc: Optional[Any] = None, name: Optional[Any] = None, @@ -12731,7 +12498,6 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.flatten = flatten self.items = items self.type_ = type_ self.label = label @@ -12741,8 +12507,7 @@ def __init__( def __eq__(self, other: Any) -> bool: if isinstance(other, CommandOutputArraySchema): return bool( - self.flatten == other.flatten - and self.items == other.items + self.items == other.items and self.type_ == other.type_ and self.label == other.label and self.doc == other.doc @@ -12751,9 +12516,7 @@ def __eq__(self, other: Any) -> bool: return False def __hash__(self) -> int: - return hash( - (self.flatten, self.items, self.type_, self.label, self.doc, self.name) - ) + return hash((self.items, self.type_, self.label, self.doc, self.name)) @classmethod def fromDoc( @@ -12820,48 +12583,6 @@ def fromDoc( name = "_:" + str(_uuid__.uuid4()) if not __original_name_is_none: baseuri = name - if "flatten" in _doc: - try: - flatten = load_field( - _doc.get("flatten"), - uri_union_of_None_type_or_booltype_False_True_2_None, - baseuri, - loadingOptions, - lc=_doc.get("flatten") - ) - - except ValidationException as e: - error_message, to_print, verb_tensage = parse_errors(str(e)) - - if str(e) == "missing required field `flatten`": - _errors__.append( - ValidationException( - str(e), - None - ) - ) - else: - if error_message != str(e): - val_type = convert_typing(extract_type(type(_doc.get("flatten")))) - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [ValidationException(f"Value is a {val_type}, " - f"but valid {to_print} for this field " - f"{verb_tensage} {error_message}")], - ) - ) - else: - _errors__.append( - ValidationException( - "the `flatten` field is not valid because:", - SourceLine(_doc, "flatten", str), - [e], - ) - ) - else: - flatten = None try: if _doc.get("items") is None: raise ValidationException("missing required field `items`", None, []) @@ -13045,7 +12766,7 @@ def fromDoc( else: _errors__.append( ValidationException( - "invalid field `{}`, expected one of: `flatten`, `items`, `type`, `label`, `doc`, `name`".format( + "invalid field `{}`, expected one of: `items`, `type`, `label`, `doc`, `name`".format( k ), SourceLine(_doc, k, str), @@ -13055,7 +12776,6 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - flatten=flatten, items=items, type_=type_, label=label, @@ -13081,9 +12801,6 @@ def save( if self.name is not None: u = save_relative_uri(self.name, base_url, True, None, relative_uris) r["name"] = u - if self.flatten is not None: - u = save_relative_uri(self.flatten, self.name, False, 2, relative_uris) - r["flatten"] = u if self.items is not None: u = save_relative_uri(self.items, self.name, False, 2, relative_uris) r["items"] = u @@ -13108,7 +12825,7 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["flatten", "items", "type", "label", "doc", "name"]) + attrs = frozenset(["items", "type", "label", "doc", "name"]) class CommandInputParameter(InputParameter): @@ -25388,12 +25105,12 @@ def save( """ The **Any** type validates for any non-null value. """ -RecordFieldLoader = _RecordLoader(RecordField) -RecordSchemaLoader = _RecordLoader(RecordSchema) -EnumSchemaLoader = _RecordLoader(EnumSchema) -ArraySchemaLoader = _RecordLoader(ArraySchema) -MapSchemaLoader = _RecordLoader(MapSchema) -UnionSchemaLoader = _RecordLoader(UnionSchema) +RecordFieldLoader = _RecordLoader(RecordField, None, None) +RecordSchemaLoader = _RecordLoader(RecordSchema, None, None) +EnumSchemaLoader = _RecordLoader(EnumSchema, None, None) +ArraySchemaLoader = _RecordLoader(ArraySchema, None, None) +MapSchemaLoader = _RecordLoader(MapSchema, None, None) +UnionSchemaLoader = _RecordLoader(UnionSchema, None, None) CWLTypeLoader = _EnumLoader( ( "null", @@ -25413,11 +25130,11 @@ def save( File: A File object Directory: A Directory object """ -CWLArraySchemaLoader = _RecordLoader(CWLArraySchema) -CWLRecordFieldLoader = _RecordLoader(CWLRecordField) -CWLRecordSchemaLoader = _RecordLoader(CWLRecordSchema) -FileLoader = _RecordLoader(File) -DirectoryLoader = _RecordLoader(Directory) +CWLArraySchemaLoader = _RecordLoader(CWLArraySchema, None, None) +CWLRecordFieldLoader = _RecordLoader(CWLRecordField, None, None) +CWLRecordSchemaLoader = _RecordLoader(CWLRecordSchema, None, None) +FileLoader = _RecordLoader(File, None, None) +DirectoryLoader = _RecordLoader(Directory, None, None) CWLObjectTypeLoader = _UnionLoader((), "CWLObjectTypeLoader") union_of_None_type_or_CWLObjectTypeLoader = _UnionLoader( ( @@ -25426,28 +25143,36 @@ def save( ) ) array_of_union_of_None_type_or_CWLObjectTypeLoader = _ArrayLoader( - union_of_None_type_or_CWLObjectTypeLoader, False + union_of_None_type_or_CWLObjectTypeLoader ) map_of_union_of_None_type_or_CWLObjectTypeLoader = _MapLoader( - union_of_None_type_or_CWLObjectTypeLoader + union_of_None_type_or_CWLObjectTypeLoader, "None", None, None +) +InlineJavascriptRequirementLoader = _RecordLoader( + InlineJavascriptRequirement, None, None +) +SchemaDefRequirementLoader = _RecordLoader(SchemaDefRequirement, None, None) +LoadListingRequirementLoader = _RecordLoader(LoadListingRequirement, None, None) +DockerRequirementLoader = _RecordLoader(DockerRequirement, None, None) +SoftwareRequirementLoader = _RecordLoader(SoftwareRequirement, None, None) +InitialWorkDirRequirementLoader = _RecordLoader(InitialWorkDirRequirement, None, None) +EnvVarRequirementLoader = _RecordLoader(EnvVarRequirement, None, None) +ShellCommandRequirementLoader = _RecordLoader(ShellCommandRequirement, None, None) +ResourceRequirementLoader = _RecordLoader(ResourceRequirement, None, None) +WorkReuseLoader = _RecordLoader(WorkReuse, None, None) +NetworkAccessLoader = _RecordLoader(NetworkAccess, None, None) +InplaceUpdateRequirementLoader = _RecordLoader(InplaceUpdateRequirement, None, None) +ToolTimeLimitLoader = _RecordLoader(ToolTimeLimit, None, None) +SubworkflowFeatureRequirementLoader = _RecordLoader( + SubworkflowFeatureRequirement, None, None +) +ScatterFeatureRequirementLoader = _RecordLoader(ScatterFeatureRequirement, None, None) +MultipleInputFeatureRequirementLoader = _RecordLoader( + MultipleInputFeatureRequirement, None, None +) +StepInputExpressionRequirementLoader = _RecordLoader( + StepInputExpressionRequirement, None, None ) -InlineJavascriptRequirementLoader = _RecordLoader(InlineJavascriptRequirement) -SchemaDefRequirementLoader = _RecordLoader(SchemaDefRequirement) -LoadListingRequirementLoader = _RecordLoader(LoadListingRequirement) -DockerRequirementLoader = _RecordLoader(DockerRequirement) -SoftwareRequirementLoader = _RecordLoader(SoftwareRequirement) -InitialWorkDirRequirementLoader = _RecordLoader(InitialWorkDirRequirement) -EnvVarRequirementLoader = _RecordLoader(EnvVarRequirement) -ShellCommandRequirementLoader = _RecordLoader(ShellCommandRequirement) -ResourceRequirementLoader = _RecordLoader(ResourceRequirement) -WorkReuseLoader = _RecordLoader(WorkReuse) -NetworkAccessLoader = _RecordLoader(NetworkAccess) -InplaceUpdateRequirementLoader = _RecordLoader(InplaceUpdateRequirement) -ToolTimeLimitLoader = _RecordLoader(ToolTimeLimit) -SubworkflowFeatureRequirementLoader = _RecordLoader(SubworkflowFeatureRequirement) -ScatterFeatureRequirementLoader = _RecordLoader(ScatterFeatureRequirement) -MultipleInputFeatureRequirementLoader = _RecordLoader(MultipleInputFeatureRequirement) -StepInputExpressionRequirementLoader = _RecordLoader(StepInputExpressionRequirement) union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_LoadListingRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_InplaceUpdateRequirementLoader_or_ToolTimeLimitLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader = _UnionLoader( ( InlineJavascriptRequirementLoader, @@ -25470,8 +25195,7 @@ def save( ) ) array_of_union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_LoadListingRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_InplaceUpdateRequirementLoader_or_ToolTimeLimitLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader = _ArrayLoader( - union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_LoadListingRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_InplaceUpdateRequirementLoader_or_ToolTimeLimitLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader, - True, + union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_LoadListingRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_InplaceUpdateRequirementLoader_or_ToolTimeLimitLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader ) union_of_None_type_or_array_of_union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_LoadListingRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_InplaceUpdateRequirementLoader_or_ToolTimeLimitLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader_or_CWLObjectTypeLoader = _UnionLoader( ( @@ -25481,7 +25205,10 @@ def save( ) ) map_of_union_of_None_type_or_array_of_union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_LoadListingRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_InplaceUpdateRequirementLoader_or_ToolTimeLimitLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader_or_CWLObjectTypeLoader = _MapLoader( - union_of_None_type_or_array_of_union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_LoadListingRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_InplaceUpdateRequirementLoader_or_ToolTimeLimitLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader_or_CWLObjectTypeLoader + union_of_None_type_or_array_of_union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_LoadListingRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_InplaceUpdateRequirementLoader_or_ToolTimeLimitLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader_or_CWLObjectTypeLoader, + "CWLInputFile", + "@list", + True, ) CWLInputFileLoader = map_of_union_of_None_type_or_array_of_union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_LoadListingRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_InplaceUpdateRequirementLoader_or_ToolTimeLimitLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader_or_CWLObjectTypeLoader CWLVersionLoader = _EnumLoader( @@ -25529,30 +25256,30 @@ def save( deep_listing: Load the directory listing and recursively load all subdirectories as well. """ ExpressionLoader = _ExpressionLoader(str) -InputBindingLoader = _RecordLoader(InputBinding) -InputRecordFieldLoader = _RecordLoader(InputRecordField) -InputRecordSchemaLoader = _RecordLoader(InputRecordSchema) -InputEnumSchemaLoader = _RecordLoader(InputEnumSchema) -InputArraySchemaLoader = _RecordLoader(InputArraySchema) -OutputRecordFieldLoader = _RecordLoader(OutputRecordField) -OutputRecordSchemaLoader = _RecordLoader(OutputRecordSchema) -OutputEnumSchemaLoader = _RecordLoader(OutputEnumSchema) -OutputArraySchemaLoader = _RecordLoader(OutputArraySchema) -SecondaryFileSchemaLoader = _RecordLoader(SecondaryFileSchema) -EnvironmentDefLoader = _RecordLoader(EnvironmentDef) -CommandLineBindingLoader = _RecordLoader(CommandLineBinding) -CommandOutputBindingLoader = _RecordLoader(CommandOutputBinding) -CommandLineBindableLoader = _RecordLoader(CommandLineBindable) -CommandInputRecordFieldLoader = _RecordLoader(CommandInputRecordField) -CommandInputRecordSchemaLoader = _RecordLoader(CommandInputRecordSchema) -CommandInputEnumSchemaLoader = _RecordLoader(CommandInputEnumSchema) -CommandInputArraySchemaLoader = _RecordLoader(CommandInputArraySchema) -CommandOutputRecordFieldLoader = _RecordLoader(CommandOutputRecordField) -CommandOutputRecordSchemaLoader = _RecordLoader(CommandOutputRecordSchema) -CommandOutputEnumSchemaLoader = _RecordLoader(CommandOutputEnumSchema) -CommandOutputArraySchemaLoader = _RecordLoader(CommandOutputArraySchema) -CommandInputParameterLoader = _RecordLoader(CommandInputParameter) -CommandOutputParameterLoader = _RecordLoader(CommandOutputParameter) +InputBindingLoader = _RecordLoader(InputBinding, None, None) +InputRecordFieldLoader = _RecordLoader(InputRecordField, None, None) +InputRecordSchemaLoader = _RecordLoader(InputRecordSchema, None, None) +InputEnumSchemaLoader = _RecordLoader(InputEnumSchema, None, None) +InputArraySchemaLoader = _RecordLoader(InputArraySchema, None, None) +OutputRecordFieldLoader = _RecordLoader(OutputRecordField, None, None) +OutputRecordSchemaLoader = _RecordLoader(OutputRecordSchema, None, None) +OutputEnumSchemaLoader = _RecordLoader(OutputEnumSchema, None, None) +OutputArraySchemaLoader = _RecordLoader(OutputArraySchema, None, None) +SecondaryFileSchemaLoader = _RecordLoader(SecondaryFileSchema, None, None) +EnvironmentDefLoader = _RecordLoader(EnvironmentDef, None, None) +CommandLineBindingLoader = _RecordLoader(CommandLineBinding, None, None) +CommandOutputBindingLoader = _RecordLoader(CommandOutputBinding, None, None) +CommandLineBindableLoader = _RecordLoader(CommandLineBindable, None, None) +CommandInputRecordFieldLoader = _RecordLoader(CommandInputRecordField, None, None) +CommandInputRecordSchemaLoader = _RecordLoader(CommandInputRecordSchema, None, None) +CommandInputEnumSchemaLoader = _RecordLoader(CommandInputEnumSchema, None, None) +CommandInputArraySchemaLoader = _RecordLoader(CommandInputArraySchema, None, None) +CommandOutputRecordFieldLoader = _RecordLoader(CommandOutputRecordField, None, None) +CommandOutputRecordSchemaLoader = _RecordLoader(CommandOutputRecordSchema, None, None) +CommandOutputEnumSchemaLoader = _RecordLoader(CommandOutputEnumSchema, None, None) +CommandOutputArraySchemaLoader = _RecordLoader(CommandOutputArraySchema, None, None) +CommandInputParameterLoader = _RecordLoader(CommandInputParameter, None, None) +CommandOutputParameterLoader = _RecordLoader(CommandOutputParameter, None, None) stdinLoader = _EnumLoader(("stdin",), "stdin") """ Only valid as a `type` for a `CommandLineTool` input with no @@ -25667,12 +25394,14 @@ def save( stderr: random_stderr_filenameABCDEFG ``` """ -CommandLineToolLoader = _RecordLoader(CommandLineTool) -SoftwarePackageLoader = _RecordLoader(SoftwarePackage) -DirentLoader = _RecordLoader(Dirent) -ExpressionToolOutputParameterLoader = _RecordLoader(ExpressionToolOutputParameter) -WorkflowInputParameterLoader = _RecordLoader(WorkflowInputParameter) -ExpressionToolLoader = _RecordLoader(ExpressionTool) +CommandLineToolLoader = _RecordLoader(CommandLineTool, None, None) +SoftwarePackageLoader = _RecordLoader(SoftwarePackage, None, None) +DirentLoader = _RecordLoader(Dirent, None, None) +ExpressionToolOutputParameterLoader = _RecordLoader( + ExpressionToolOutputParameter, None, None +) +WorkflowInputParameterLoader = _RecordLoader(WorkflowInputParameter, None, None) +ExpressionToolLoader = _RecordLoader(ExpressionTool, None, None) LinkMergeMethodLoader = _EnumLoader( ( "merge_nested", @@ -25694,9 +25423,9 @@ def save( """ Picking non-null values among inbound data links, described in [WorkflowStepInput](#WorkflowStepInput). """ -WorkflowOutputParameterLoader = _RecordLoader(WorkflowOutputParameter) -WorkflowStepInputLoader = _RecordLoader(WorkflowStepInput) -WorkflowStepOutputLoader = _RecordLoader(WorkflowStepOutput) +WorkflowOutputParameterLoader = _RecordLoader(WorkflowOutputParameter, None, None) +WorkflowStepInputLoader = _RecordLoader(WorkflowStepInput, None, None) +WorkflowStepOutputLoader = _RecordLoader(WorkflowStepOutput, None, None) ScatterMethodLoader = _EnumLoader( ( "dotproduct", @@ -25708,12 +25437,12 @@ def save( """ The scatter method, as described in [workflow step scatter](#WorkflowStep). """ -WorkflowStepLoader = _RecordLoader(WorkflowStep) -WorkflowLoader = _RecordLoader(Workflow) -OperationInputParameterLoader = _RecordLoader(OperationInputParameter) -OperationOutputParameterLoader = _RecordLoader(OperationOutputParameter) -OperationLoader = _RecordLoader(Operation) -array_of_strtype = _ArrayLoader(strtype, True) +WorkflowStepLoader = _RecordLoader(WorkflowStep, None, None) +WorkflowLoader = _RecordLoader(Workflow, None, None) +OperationInputParameterLoader = _RecordLoader(OperationInputParameter, None, None) +OperationOutputParameterLoader = _RecordLoader(OperationOutputParameter, None, None) +OperationLoader = _RecordLoader(Operation, None, None) +array_of_strtype = _ArrayLoader(strtype) union_of_None_type_or_strtype_or_array_of_strtype = _UnionLoader( ( None_type, @@ -25734,8 +25463,7 @@ def save( ) ) array_of_union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype = _ArrayLoader( - union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype, - True, + union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype ) union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype_or_array_of_union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype = _UnionLoader( ( @@ -25754,7 +25482,7 @@ def save( 2, "v1.1", ) -array_of_RecordFieldLoader = _ArrayLoader(RecordFieldLoader, True) +array_of_RecordFieldLoader = _ArrayLoader(RecordFieldLoader) union_of_None_type_or_array_of_RecordFieldLoader = _UnionLoader( ( None_type, @@ -25780,15 +25508,6 @@ def save( ) Enum_nameLoader = _EnumLoader(("enum",), "Enum_name") typedsl_Enum_nameLoader_2 = _TypeDSLLoader(Enum_nameLoader, 2, "v1.1") -union_of_None_type_or_booltype = _UnionLoader( - ( - None_type, - booltype, - ) -) -uri_union_of_None_type_or_booltype_False_True_2_None = _URILoader( - union_of_None_type_or_booltype, False, True, 2, None -) uri_union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype_or_array_of_union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype_False_True_2_None = _URILoader( union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype_or_array_of_union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype, False, @@ -25812,8 +25531,7 @@ def save( ) ) array_of_union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype = _ArrayLoader( - union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype, - True, + union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype ) union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype_or_array_of_union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype = _UnionLoader( ( @@ -25837,7 +25555,7 @@ def save( 2, "v1.1", ) -array_of_CWLRecordFieldLoader = _ArrayLoader(CWLRecordFieldLoader, True) +array_of_CWLRecordFieldLoader = _ArrayLoader(CWLRecordFieldLoader) union_of_None_type_or_array_of_CWLRecordFieldLoader = _UnionLoader( ( None_type, @@ -25867,7 +25585,7 @@ def save( ) ) array_of_union_of_FileLoader_or_DirectoryLoader = _ArrayLoader( - union_of_FileLoader_or_DirectoryLoader, True + union_of_FileLoader_or_DirectoryLoader ) union_of_None_type_or_array_of_union_of_FileLoader_or_DirectoryLoader = _UnionLoader( ( @@ -25890,13 +25608,19 @@ def save( uri_Directory_classLoader_False_True_None_None = _URILoader( Directory_classLoader, False, True, None, None ) +union_of_None_type_or_booltype = _UnionLoader( + ( + None_type, + booltype, + ) +) union_of_None_type_or_LoadListingEnumLoader = _UnionLoader( ( None_type, LoadListingEnumLoader, ) ) -array_of_SecondaryFileSchemaLoader = _ArrayLoader(SecondaryFileSchemaLoader, True) +array_of_SecondaryFileSchemaLoader = _ArrayLoader(SecondaryFileSchemaLoader) union_of_None_type_or_SecondaryFileSchemaLoader_or_array_of_SecondaryFileSchemaLoader = _UnionLoader( ( None_type, @@ -25947,8 +25671,7 @@ def save( ) ) array_of_union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype = _ArrayLoader( - union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype, - True, + union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype ) union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype = _UnionLoader( ( @@ -25965,7 +25688,7 @@ def save( 2, "v1.1", ) -array_of_InputRecordFieldLoader = _ArrayLoader(InputRecordFieldLoader, True) +array_of_InputRecordFieldLoader = _ArrayLoader(InputRecordFieldLoader) union_of_None_type_or_array_of_InputRecordFieldLoader = _UnionLoader( ( None_type, @@ -25992,8 +25715,7 @@ def save( ) ) array_of_union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype = _ArrayLoader( - union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype, - True, + union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype ) union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype = _UnionLoader( ( @@ -26010,7 +25732,7 @@ def save( 2, "v1.1", ) -array_of_OutputRecordFieldLoader = _ArrayLoader(OutputRecordFieldLoader, True) +array_of_OutputRecordFieldLoader = _ArrayLoader(OutputRecordFieldLoader) union_of_None_type_or_array_of_OutputRecordFieldLoader = _UnionLoader( ( None_type, @@ -26035,8 +25757,7 @@ def save( ) ) array_of_union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader_or_OperationInputParameterLoader = _ArrayLoader( - union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader_or_OperationInputParameterLoader, - True, + union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader_or_OperationInputParameterLoader ) idmap_inputs_array_of_union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader_or_OperationInputParameterLoader = _IdMapLoader( array_of_union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader_or_OperationInputParameterLoader, @@ -26052,8 +25773,7 @@ def save( ) ) array_of_union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader_or_OperationOutputParameterLoader = _ArrayLoader( - union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader_or_OperationOutputParameterLoader, - True, + union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader_or_OperationOutputParameterLoader ) idmap_outputs_array_of_union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader_or_OperationOutputParameterLoader = _IdMapLoader( array_of_union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader_or_OperationOutputParameterLoader, @@ -26094,8 +25814,7 @@ def save( ) ) array_of_union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_LoadListingRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_InplaceUpdateRequirementLoader_or_ToolTimeLimitLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader_or_Any_type = _ArrayLoader( - union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_LoadListingRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_InplaceUpdateRequirementLoader_or_ToolTimeLimitLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader_or_Any_type, - True, + union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_LoadListingRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_InplaceUpdateRequirementLoader_or_ToolTimeLimitLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader_or_Any_type ) union_of_None_type_or_array_of_union_of_InlineJavascriptRequirementLoader_or_SchemaDefRequirementLoader_or_LoadListingRequirementLoader_or_DockerRequirementLoader_or_SoftwareRequirementLoader_or_InitialWorkDirRequirementLoader_or_EnvVarRequirementLoader_or_ShellCommandRequirementLoader_or_ResourceRequirementLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_InplaceUpdateRequirementLoader_or_ToolTimeLimitLoader_or_SubworkflowFeatureRequirementLoader_or_ScatterFeatureRequirementLoader_or_MultipleInputFeatureRequirementLoader_or_StepInputExpressionRequirementLoader_or_Any_type = _UnionLoader( ( @@ -26146,8 +25865,7 @@ def save( ) ) array_of_union_of_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader = _ArrayLoader( - union_of_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader, - True, + union_of_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader ) union_of_strtype_or_ExpressionLoader = _UnionLoader( ( @@ -26205,8 +25923,7 @@ def save( ) ) array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype = _ArrayLoader( - union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype, - True, + union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype ) union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype = _UnionLoader( ( @@ -26223,9 +25940,7 @@ def save( 2, "v1.1", ) -array_of_CommandInputRecordFieldLoader = _ArrayLoader( - CommandInputRecordFieldLoader, True -) +array_of_CommandInputRecordFieldLoader = _ArrayLoader(CommandInputRecordFieldLoader) union_of_None_type_or_array_of_CommandInputRecordFieldLoader = _UnionLoader( ( None_type, @@ -26254,8 +25969,7 @@ def save( ) ) array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype = _ArrayLoader( - union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype, - True, + union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype ) union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype = _UnionLoader( ( @@ -26278,9 +25992,7 @@ def save( CommandOutputBindingLoader, ) ) -array_of_CommandOutputRecordFieldLoader = _ArrayLoader( - CommandOutputRecordFieldLoader, True -) +array_of_CommandOutputRecordFieldLoader = _ArrayLoader(CommandOutputRecordFieldLoader) union_of_None_type_or_array_of_CommandOutputRecordFieldLoader = _UnionLoader( ( None_type, @@ -26336,11 +26048,11 @@ def save( uri_CommandLineTool_classLoader_False_True_None_None = _URILoader( CommandLineTool_classLoader, False, True, None, None ) -array_of_CommandInputParameterLoader = _ArrayLoader(CommandInputParameterLoader, True) +array_of_CommandInputParameterLoader = _ArrayLoader(CommandInputParameterLoader) idmap_inputs_array_of_CommandInputParameterLoader = _IdMapLoader( array_of_CommandInputParameterLoader, "id", "type" ) -array_of_CommandOutputParameterLoader = _ArrayLoader(CommandOutputParameterLoader, True) +array_of_CommandOutputParameterLoader = _ArrayLoader(CommandOutputParameterLoader) idmap_outputs_array_of_CommandOutputParameterLoader = _IdMapLoader( array_of_CommandOutputParameterLoader, "id", "type" ) @@ -26352,7 +26064,7 @@ def save( ) ) array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader = ( - _ArrayLoader(union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader, True) + _ArrayLoader(union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader) ) union_of_None_type_or_array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader = _UnionLoader( ( @@ -26360,7 +26072,7 @@ def save( array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader, ) ) -array_of_inttype = _ArrayLoader(inttype, True) +array_of_inttype = _ArrayLoader(inttype) union_of_None_type_or_array_of_inttype = _UnionLoader( ( None_type, @@ -26379,7 +26091,7 @@ def save( uri_SoftwareRequirement_classLoader_False_True_None_None = _URILoader( SoftwareRequirement_classLoader, False, True, None, None ) -array_of_SoftwarePackageLoader = _ArrayLoader(SoftwarePackageLoader, True) +array_of_SoftwarePackageLoader = _ArrayLoader(SoftwarePackageLoader) idmap_packages_array_of_SoftwarePackageLoader = _IdMapLoader( array_of_SoftwarePackageLoader, "package", "specs" ) @@ -26403,8 +26115,7 @@ def save( ) ) array_of_union_of_None_type_or_DirentLoader_or_ExpressionLoader_or_FileLoader_or_DirectoryLoader_or_array_of_union_of_FileLoader_or_DirectoryLoader = _ArrayLoader( - union_of_None_type_or_DirentLoader_or_ExpressionLoader_or_FileLoader_or_DirectoryLoader_or_array_of_union_of_FileLoader_or_DirectoryLoader, - True, + union_of_None_type_or_DirentLoader_or_ExpressionLoader_or_FileLoader_or_DirectoryLoader_or_array_of_union_of_FileLoader_or_DirectoryLoader ) union_of_ExpressionLoader_or_array_of_union_of_None_type_or_DirentLoader_or_ExpressionLoader_or_FileLoader_or_DirectoryLoader_or_array_of_union_of_FileLoader_or_DirectoryLoader = _UnionLoader( ( @@ -26418,7 +26129,7 @@ def save( uri_EnvVarRequirement_classLoader_False_True_None_None = _URILoader( EnvVarRequirement_classLoader, False, True, None, None ) -array_of_EnvironmentDefLoader = _ArrayLoader(EnvironmentDefLoader, True) +array_of_EnvironmentDefLoader = _ArrayLoader(EnvironmentDefLoader) idmap_envDef_array_of_EnvironmentDefLoader = _IdMapLoader( array_of_EnvironmentDefLoader, "envName", "envValue" ) @@ -26482,12 +26193,12 @@ def save( uri_ExpressionTool_classLoader_False_True_None_None = _URILoader( ExpressionTool_classLoader, False, True, None, None ) -array_of_WorkflowInputParameterLoader = _ArrayLoader(WorkflowInputParameterLoader, True) +array_of_WorkflowInputParameterLoader = _ArrayLoader(WorkflowInputParameterLoader) idmap_inputs_array_of_WorkflowInputParameterLoader = _IdMapLoader( array_of_WorkflowInputParameterLoader, "id", "type" ) array_of_ExpressionToolOutputParameterLoader = _ArrayLoader( - ExpressionToolOutputParameterLoader, True + ExpressionToolOutputParameterLoader ) idmap_outputs_array_of_ExpressionToolOutputParameterLoader = _IdMapLoader( array_of_ExpressionToolOutputParameterLoader, "id", "type" @@ -26510,7 +26221,7 @@ def save( uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_2_None = _URILoader( union_of_None_type_or_strtype_or_array_of_strtype, False, False, 2, None ) -array_of_WorkflowStepInputLoader = _ArrayLoader(WorkflowStepInputLoader, True) +array_of_WorkflowStepInputLoader = _ArrayLoader(WorkflowStepInputLoader) idmap_in__array_of_WorkflowStepInputLoader = _IdMapLoader( array_of_WorkflowStepInputLoader, "id", "source" ) @@ -26521,7 +26232,7 @@ def save( ) ) array_of_union_of_strtype_or_WorkflowStepOutputLoader = _ArrayLoader( - union_of_strtype_or_WorkflowStepOutputLoader, True + union_of_strtype_or_WorkflowStepOutputLoader ) union_of_array_of_union_of_strtype_or_WorkflowStepOutputLoader = _UnionLoader( (array_of_union_of_strtype_or_WorkflowStepOutputLoader,) @@ -26533,7 +26244,7 @@ def save( None, None, ) -array_of_Any_type = _ArrayLoader(Any_type, True) +array_of_Any_type = _ArrayLoader(Any_type) union_of_None_type_or_array_of_Any_type = _UnionLoader( ( None_type, @@ -26575,13 +26286,11 @@ def save( uri_Workflow_classLoader_False_True_None_None = _URILoader( Workflow_classLoader, False, True, None, None ) -array_of_WorkflowOutputParameterLoader = _ArrayLoader( - WorkflowOutputParameterLoader, True -) +array_of_WorkflowOutputParameterLoader = _ArrayLoader(WorkflowOutputParameterLoader) idmap_outputs_array_of_WorkflowOutputParameterLoader = _IdMapLoader( array_of_WorkflowOutputParameterLoader, "id", "type" ) -array_of_WorkflowStepLoader = _ArrayLoader(WorkflowStepLoader, True) +array_of_WorkflowStepLoader = _ArrayLoader(WorkflowStepLoader) union_of_array_of_WorkflowStepLoader = _UnionLoader((array_of_WorkflowStepLoader,)) idmap_steps_union_of_array_of_WorkflowStepLoader = _IdMapLoader( union_of_array_of_WorkflowStepLoader, "id", "None" @@ -26614,15 +26323,11 @@ def save( uri_Operation_classLoader_False_True_None_None = _URILoader( Operation_classLoader, False, True, None, None ) -array_of_OperationInputParameterLoader = _ArrayLoader( - OperationInputParameterLoader, True -) +array_of_OperationInputParameterLoader = _ArrayLoader(OperationInputParameterLoader) idmap_inputs_array_of_OperationInputParameterLoader = _IdMapLoader( array_of_OperationInputParameterLoader, "id", "type" ) -array_of_OperationOutputParameterLoader = _ArrayLoader( - OperationOutputParameterLoader, True -) +array_of_OperationOutputParameterLoader = _ArrayLoader(OperationOutputParameterLoader) idmap_outputs_array_of_OperationOutputParameterLoader = _IdMapLoader( array_of_OperationOutputParameterLoader, "id", "type" ) @@ -26635,8 +26340,7 @@ def save( ) ) array_of_union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader = _ArrayLoader( - union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader, - True, + union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader ) union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader_or_array_of_union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader = _UnionLoader( ( diff --git a/cwl_utils/parser/cwl_v1_2_utils.py b/cwl_utils/parser/cwl_v1_2_utils.py index b9d614b7..b58f3f40 100644 --- a/cwl_utils/parser/cwl_v1_2_utils.py +++ b/cwl_utils/parser/cwl_v1_2_utils.py @@ -44,9 +44,9 @@ def _compare_records( This handles normalizing record names, which will be relative to workflow step, so that they can be compared. """ - srcfields = {cwl.shortname(field.name): field.type for field in (src.fields or {})} + srcfields = {cwl.shortname(field.name): field.type_ for field in (src.fields or {})} sinkfields = { - cwl.shortname(field.name): field.type for field in (sink.fields or {}) + cwl.shortname(field.name): field.type_ for field in (sink.fields or {}) } for key in sinkfields.keys(): if ( @@ -77,10 +77,10 @@ def _compare_type(type1: Any, type2: Any) -> bool: return _compare_type(type1.items, type2.items) elif isinstance(type1, cwl.RecordSchema) and isinstance(type2, cwl.RecordSchema): fields1 = { - cwl.shortname(field.name): field.type for field in (type1.fields or {}) + cwl.shortname(field.name): field.type_ for field in (type1.fields or {}) } fields2 = { - cwl.shortname(field.name): field.type for field in (type2.fields or {}) + cwl.shortname(field.name): field.type_ for field in (type2.fields or {}) } if fields1.keys() != fields2.keys(): return False @@ -314,7 +314,7 @@ def check_types( return "exception" if linkMerge == "merge_nested": return check_types( - cwl.ArraySchema(items=srctype, type="array"), sinktype, None, None + cwl.ArraySchema(items=srctype, type_="array"), sinktype, None, None ) if linkMerge == "merge_flattened": return check_types(merge_flatten_type(srctype), sinktype, None, None) @@ -347,7 +347,7 @@ def content_limit_respected_read(f: IO[bytes]) -> str: def convert_stdstreams_to_files(clt: cwl.CommandLineTool) -> None: """Convert stdin, stdout and stderr type shortcuts to files.""" for out in clt.outputs: - if out.type == "stdout": + if out.type_ == "stdout": if out.outputBinding is not None: raise ValidationException( "Not allowed to specify outputBinding when using stdout shortcut." @@ -358,9 +358,9 @@ def convert_stdstreams_to_files(clt: cwl.CommandLineTool) -> None: json_dumps(clt.save(), sort_keys=True).encode("utf-8") ).hexdigest() ) - out.type = "File" + out.type_ = "File" out.outputBinding = cwl.CommandOutputBinding(glob=clt.stdout) - elif out.type == "stderr": + elif out.type_ == "stderr": if out.outputBinding is not None: raise ValidationException( "Not allowed to specify outputBinding when using stderr shortcut." @@ -371,10 +371,10 @@ def convert_stdstreams_to_files(clt: cwl.CommandLineTool) -> None: json_dumps(clt.save(), sort_keys=True).encode("utf-8") ).hexdigest() ) - out.type = "File" + out.type_ = "File" out.outputBinding = cwl.CommandOutputBinding(glob=clt.stderr) for inp in clt.inputs: - if inp.type == "stdin": + if inp.type_ == "stdin": if inp.inputBinding is not None: raise ValidationException( "Not allowed to specify unputBinding when using stdin shortcut." @@ -388,7 +388,7 @@ def convert_stdstreams_to_files(clt: cwl.CommandLineTool) -> None: "$(inputs.%s.path)" % cast(str, inp.id).rpartition("#")[2].split("/")[-1] ) - inp.type = "File" + inp.type_ = "File" def load_inputfile( @@ -401,8 +401,6 @@ def load_inputfile( baseuri = cwl.file_uri(os.getcwd()) + "/" if loadingOptions is None: loadingOptions = cwl.LoadingOptions() - - loadingOptions = cwl.LoadingOptions(copyfrom=loadingOptions, no_link_check=True) result, metadata = _inputfile_load( doc, baseuri, @@ -424,7 +422,6 @@ def load_inputfile_by_string( if loadingOptions is None: loadingOptions = cwl.LoadingOptions(fileuri=uri) - loadingOptions = cwl.LoadingOptions(copyfrom=loadingOptions, no_link_check=True) result, metadata = _inputfile_load( result, uri, @@ -444,7 +441,6 @@ def load_inputfile_by_yaml( if loadingOptions is None: loadingOptions = cwl.LoadingOptions(fileuri=uri) - loadingOptions = cwl.LoadingOptions(copyfrom=loadingOptions, no_link_check=True) result, metadata = _inputfile_load( yaml, uri, @@ -459,7 +455,7 @@ def merge_flatten_type(src: Any) -> Any: return [merge_flatten_type(t) for t in src] if isinstance(src, cwl.ArraySchema): return src - return cwl.ArraySchema(type="array", items=src) + return cwl.ArraySchema(type_="array", items=src) def type_for_step_input( @@ -477,9 +473,9 @@ def type_for_step_input( cast(str, step_input.id).split("#")[-1] == cast(str, in_.id).split("#")[-1] ): - input_type = step_input.type + input_type = step_input.type_ if step.scatter is not None and in_.id in aslist(step.scatter): - input_type = cwl.ArraySchema(items=input_type, type="array") + input_type = cwl.ArraySchema(items=input_type, type_="array") return input_type return "Any" @@ -497,15 +493,15 @@ def type_for_step_output( output.id.split("#")[-1].split("/")[-1] == sourcename.split("#")[-1].split("/")[-1] ): - output_type = output.type + output_type = output.type_ if step.scatter is not None: if step.scatterMethod == "nested_crossproduct": for _ in range(len(aslist(step.scatter))): output_type = cwl.ArraySchema( - items=output_type, type="array" + items=output_type, type_="array" ) else: - output_type = cwl.ArraySchema(items=output_type, type="array") + output_type = cwl.ArraySchema(items=output_type, type_="array") return output_type raise ValidationException( "param {} not found in {}.".format( @@ -526,15 +522,15 @@ def type_for_source( scatter_context: List[Optional[Tuple[int, str]]] = [] params = param_for_source_id(process, sourcenames, parent, scatter_context) if not isinstance(params, list): - new_type = params.type + new_type = params.type_ if scatter_context[0] is not None: if scatter_context[0][1] == "nested_crossproduct": for _ in range(scatter_context[0][0]): - new_type = cwl.ArraySchema(items=new_type, type="array") + new_type = cwl.ArraySchema(items=new_type, type_="array") else: - new_type = cwl.ArraySchema(items=new_type, type="array") + new_type = cwl.ArraySchema(items=new_type, type_="array") if linkMerge == "merge_nested": - new_type = cwl.ArraySchema(items=new_type, type="array") + new_type = cwl.ArraySchema(items=new_type, type_="array") elif linkMerge == "merge_flattened": new_type = merge_flatten_type(new_type) if pickValue is not None: @@ -546,26 +542,28 @@ def type_for_source( for p, sc in zip(params, scatter_context): if isinstance(p, str) and not any(_compare_type(t, p) for t in new_type): cur_type = p - elif hasattr(p, "type") and not any(_compare_type(t, p.type) for t in new_type): - cur_type = p.type + elif hasattr(p, "type_") and not any( + _compare_type(t, p.type_) for t in new_type + ): + cur_type = p.type_ else: cur_type = None if cur_type is not None: if sc is not None: if sc[1] == "nested_crossproduct": for _ in range(sc[0]): - cur_type = cwl.ArraySchema(items=cur_type, type="array") + cur_type = cwl.ArraySchema(items=cur_type, type_="array") else: - cur_type = cwl.ArraySchema(items=cur_type, type="array") + cur_type = cwl.ArraySchema(items=cur_type, type_="array") new_type.append(cur_type) if len(new_type) == 1: new_type = new_type[0] if linkMerge == "merge_nested": - new_type = cwl.ArraySchema(items=new_type, type="array") + new_type = cwl.ArraySchema(items=new_type, type_="array") elif linkMerge == "merge_flattened": new_type = merge_flatten_type(new_type) elif isinstance(sourcenames, List) and len(sourcenames) > 1: - new_type = cwl.ArraySchema(items=new_type, type="array") + new_type = cwl.ArraySchema(items=new_type, type_="array") if pickValue is not None: if isinstance(new_type, cwl.ArraySchema): if pickValue in ["first_non_null", "the_only_non_null"]: diff --git a/cwl_utils/parser/utils.py b/cwl_utils/parser/utils.py index f21b6821..8298a41e 100644 --- a/cwl_utils/parser/utils.py +++ b/cwl_utils/parser/utils.py @@ -12,6 +12,7 @@ from schema_salad.utils import json_dumps, yaml_no_ts import cwl_utils +import cwl_utils.parser from . import ( LoadingOptions, Process, @@ -54,10 +55,22 @@ def load_inputfile_by_uri( else: real_path = path.resolve().as_uri() + if version is None: + raise ValidationException("could not get the cwlVersion") + baseuri = str(real_path) if loadingOptions is None: - loadingOptions = cwl_v1_2.LoadingOptions(fileuri=baseuri) + if version == "v1.0": + loadingOptions = cwl_v1_0.LoadingOptions(fileuri=baseuri) + elif version == "v1.1": + loadingOptions = cwl_v1_1.LoadingOptions(fileuri=baseuri) + elif version == "v1.2": + loadingOptions = cwl_v1_2.LoadingOptions(fileuri=baseuri) + else: + raise ValidationException( + f"Version error. Did not recognise {version} as a CWL version" + ) doc = loadingOptions.fetcher.fetch_text(real_path) return load_inputfile_by_string(version, doc, baseuri, loadingOptions) @@ -185,8 +198,8 @@ def static_checker(workflow: cwl_utils.parser.Workflow) -> None: } type_dict = { **type_dict, - **{param.id: param.type for param in workflow.inputs}, - **{param.id: param.type for param in workflow.outputs}, + **{param.id: param.type_ for param in workflow.inputs}, + **{param.id: param.type_ for param in workflow.outputs}, } parser: ModuleType diff --git a/tests/test_parser_utils.py b/tests/test_parser_utils.py index 3146840d..075f6160 100644 --- a/tests/test_parser_utils.py +++ b/tests/test_parser_utils.py @@ -168,7 +168,7 @@ def test_v1_0_stdout_to_file() -> None: clt = cwl_utils.parser.cwl_v1_0.CommandLineTool( inputs=[], outputs=[ - cwl_utils.parser.cwl_v1_0.CommandOutputParameter(id="test", type="stdout") + cwl_utils.parser.cwl_v1_0.CommandOutputParameter(id="test", type_="stdout") ], ) cwl_utils.parser.cwl_v1_0_utils.convert_stdstreams_to_files(clt) @@ -183,7 +183,7 @@ def test_v1_0_stdout_to_file_with_binding() -> None: outputs=[ cwl_utils.parser.cwl_v1_0.CommandOutputParameter( id="test", - type="stdout", + type_="stdout", outputBinding=cwl_utils.parser.cwl_v1_0.CommandOutputBinding( glob="output.txt" ), @@ -199,7 +199,7 @@ def test_v1_0_stdout_to_file_preserve_original() -> None: clt = cwl_utils.parser.cwl_v1_0.CommandLineTool( inputs=[], outputs=[ - cwl_utils.parser.cwl_v1_0.CommandOutputParameter(id="test", type="stdout") + cwl_utils.parser.cwl_v1_0.CommandOutputParameter(id="test", type_="stdout") ], stdout="original.txt", ) @@ -213,7 +213,7 @@ def test_v1_0_stderr_to_file() -> None: clt = cwl_utils.parser.cwl_v1_0.CommandLineTool( inputs=[], outputs=[ - cwl_utils.parser.cwl_v1_0.CommandOutputParameter(id="test", type="stderr") + cwl_utils.parser.cwl_v1_0.CommandOutputParameter(id="test", type_="stderr") ], ) cwl_utils.parser.cwl_v1_0_utils.convert_stdstreams_to_files(clt) @@ -228,7 +228,7 @@ def test_v1_0_stderr_to_file_with_binding() -> None: outputs=[ cwl_utils.parser.cwl_v1_0.CommandOutputParameter( id="test", - type="stderr", + type_="stderr", outputBinding=cwl_utils.parser.cwl_v1_0.CommandOutputBinding( glob="err.txt" ), @@ -244,7 +244,7 @@ def test_v1_0_stderr_to_file_preserve_original() -> None: clt = cwl_utils.parser.cwl_v1_0.CommandLineTool( inputs=[], outputs=[ - cwl_utils.parser.cwl_v1_0.CommandOutputParameter(id="test", type="stderr") + cwl_utils.parser.cwl_v1_0.CommandOutputParameter(id="test", type_="stderr") ], stderr="original.txt", ) @@ -258,7 +258,7 @@ def test_v1_0_type_compare_list() -> None: uri = Path(get_data("testdata/echo_v1_0.cwl")).resolve().as_uri() cwl_obj = load_document_by_uri(uri) assert cwl_utils.parser.cwl_v1_0_utils._compare_type( - cwl_obj.inputs[0].type, cwl_obj.inputs[0].type + cwl_obj.inputs[0].type_, cwl_obj.inputs[0].type_ ) @@ -320,8 +320,8 @@ def test_v1_0_type_output_source_record() -> None: MutableSequence[cwl_utils.parser.cwl_v1_0.RecordField], source_type.fields ) assert len(fields) == 2 - assert fields[0].type == "File" - assert fields[1].type == "File" + assert fields[0].type_ == "File" + assert fields[1].type_ == "File" def test_v1_0_type_for_output_source_with_single_scatter_step() -> None: @@ -486,7 +486,7 @@ def test_v1_1_stdout_to_file() -> None: clt = cwl_utils.parser.cwl_v1_1.CommandLineTool( inputs=[], outputs=[ - cwl_utils.parser.cwl_v1_1.CommandOutputParameter(id="test", type="stdout") + cwl_utils.parser.cwl_v1_1.CommandOutputParameter(id="test", type_="stdout") ], ) cwl_utils.parser.cwl_v1_1_utils.convert_stdstreams_to_files(clt) @@ -501,7 +501,7 @@ def test_v1_1_stdout_to_file_with_binding() -> None: outputs=[ cwl_utils.parser.cwl_v1_1.CommandOutputParameter( id="test", - type="stdout", + type_="stdout", outputBinding=cwl_utils.parser.cwl_v1_1.CommandOutputBinding( glob="output.txt" ), @@ -517,7 +517,7 @@ def test_v1_1_stdout_to_file_preserve_original() -> None: clt = cwl_utils.parser.cwl_v1_1.CommandLineTool( inputs=[], outputs=[ - cwl_utils.parser.cwl_v1_1.CommandOutputParameter(id="test", type="stdout") + cwl_utils.parser.cwl_v1_1.CommandOutputParameter(id="test", type_="stdout") ], stdout="original.txt", ) @@ -531,7 +531,7 @@ def test_v1_1_stderr_to_file() -> None: clt = cwl_utils.parser.cwl_v1_1.CommandLineTool( inputs=[], outputs=[ - cwl_utils.parser.cwl_v1_1.CommandOutputParameter(id="test", type="stderr") + cwl_utils.parser.cwl_v1_1.CommandOutputParameter(id="test", type_="stderr") ], ) cwl_utils.parser.cwl_v1_1_utils.convert_stdstreams_to_files(clt) @@ -546,7 +546,7 @@ def test_v1_1_stderr_to_file_with_binding() -> None: outputs=[ cwl_utils.parser.cwl_v1_1.CommandOutputParameter( id="test", - type="stderr", + type_="stderr", outputBinding=cwl_utils.parser.cwl_v1_1.CommandOutputBinding( glob="err.txt" ), @@ -562,7 +562,7 @@ def test_v1_1_stderr_to_file_preserve_original() -> None: clt = cwl_utils.parser.cwl_v1_1.CommandLineTool( inputs=[], outputs=[ - cwl_utils.parser.cwl_v1_1.CommandOutputParameter(id="test", type="stderr") + cwl_utils.parser.cwl_v1_1.CommandOutputParameter(id="test", type_="stderr") ], stderr="original.txt", ) @@ -575,7 +575,7 @@ def test_v1_1_stdin_to_file() -> None: """Test that stdin shortcut is converted to stdin parameter with CWL v1.1.""" clt = cwl_utils.parser.cwl_v1_1.CommandLineTool( inputs=[ - cwl_utils.parser.cwl_v1_1.CommandInputParameter(id="test", type="stdin") + cwl_utils.parser.cwl_v1_1.CommandInputParameter(id="test", type_="stdin") ], outputs=[], ) @@ -589,7 +589,7 @@ def test_v1_1_stdin_to_file_with_binding() -> None: inputs=[ cwl_utils.parser.cwl_v1_1.CommandInputParameter( id="test", - type="stdin", + type_="stdin", inputBinding=cwl_utils.parser.cwl_v1_1.CommandLineBinding( prefix="--test" ), @@ -605,7 +605,7 @@ def test_v1_1_stdin_to_file_fail_with_original() -> None: """Test that stdin shortcut fails when stdin parameter is defined with CWL v1.1.""" clt = cwl_utils.parser.cwl_v1_1.CommandLineTool( inputs=[ - cwl_utils.parser.cwl_v1_1.CommandInputParameter(id="test", type="stdin") + cwl_utils.parser.cwl_v1_1.CommandInputParameter(id="test", type_="stdin") ], outputs=[], stdin="original.txt", @@ -619,7 +619,7 @@ def test_v1_1_type_compare_list() -> None: uri = Path(get_data("testdata/echo_v1_1.cwl")).resolve().as_uri() cwl_obj = load_document_by_uri(uri) assert cwl_utils.parser.cwl_v1_1_utils._compare_type( - cwl_obj.inputs[0].type, cwl_obj.inputs[0].type + cwl_obj.inputs[0].type_, cwl_obj.inputs[0].type_ ) @@ -681,8 +681,8 @@ def test_v1_1_type_output_source_record() -> None: MutableSequence[cwl_utils.parser.cwl_v1_1.RecordField], source_type.fields ) assert len(fields) == 2 - assert fields[0].type == "File" - assert fields[1].type == "File" + assert fields[0].type_ == "File" + assert fields[1].type_ == "File" def test_v1_1_type_for_output_source_with_single_scatter_step() -> None: @@ -848,7 +848,7 @@ def test_v1_2_stdout_to_file() -> None: clt = cwl_utils.parser.cwl_v1_2.CommandLineTool( inputs=[], outputs=[ - cwl_utils.parser.cwl_v1_2.CommandOutputParameter(id="test", type="stdout") + cwl_utils.parser.cwl_v1_2.CommandOutputParameter(id="test", type_="stdout") ], ) cwl_utils.parser.cwl_v1_2_utils.convert_stdstreams_to_files(clt) @@ -863,7 +863,7 @@ def test_v1_2_stdout_to_file_with_binding() -> None: outputs=[ cwl_utils.parser.cwl_v1_2.CommandOutputParameter( id="test", - type="stdout", + type_="stdout", outputBinding=cwl_utils.parser.cwl_v1_2.CommandOutputBinding( glob="output.txt" ), @@ -879,7 +879,7 @@ def test_v1_2_stdout_to_file_preserve_original() -> None: clt = cwl_utils.parser.cwl_v1_2.CommandLineTool( inputs=[], outputs=[ - cwl_utils.parser.cwl_v1_2.CommandOutputParameter(id="test", type="stdout") + cwl_utils.parser.cwl_v1_2.CommandOutputParameter(id="test", type_="stdout") ], stdout="original.txt", ) @@ -893,7 +893,7 @@ def test_v1_2_stderr_to_file() -> None: clt = cwl_utils.parser.cwl_v1_2.CommandLineTool( inputs=[], outputs=[ - cwl_utils.parser.cwl_v1_2.CommandOutputParameter(id="test", type="stderr") + cwl_utils.parser.cwl_v1_2.CommandOutputParameter(id="test", type_="stderr") ], ) cwl_utils.parser.cwl_v1_2_utils.convert_stdstreams_to_files(clt) @@ -908,7 +908,7 @@ def test_v1_2_stderr_to_file_with_binding() -> None: outputs=[ cwl_utils.parser.cwl_v1_2.CommandOutputParameter( id="test", - type="stderr", + type_="stderr", outputBinding=cwl_utils.parser.cwl_v1_2.CommandOutputBinding( glob="err.txt" ), @@ -924,7 +924,7 @@ def test_v1_2_stderr_to_file_preserve_original() -> None: clt = cwl_utils.parser.cwl_v1_2.CommandLineTool( inputs=[], outputs=[ - cwl_utils.parser.cwl_v1_2.CommandOutputParameter(id="test", type="stderr") + cwl_utils.parser.cwl_v1_2.CommandOutputParameter(id="test", type_="stderr") ], stderr="original.txt", ) @@ -937,7 +937,7 @@ def test_v1_2_stdin_to_file() -> None: """Test that stdin shortcut is converted to stdin parameter with CWL v1.2.""" clt = cwl_utils.parser.cwl_v1_2.CommandLineTool( inputs=[ - cwl_utils.parser.cwl_v1_2.CommandInputParameter(id="test", type="stdin") + cwl_utils.parser.cwl_v1_2.CommandInputParameter(id="test", type_="stdin") ], outputs=[], ) @@ -951,7 +951,7 @@ def test_v1_2_stdin_to_file_with_binding() -> None: inputs=[ cwl_utils.parser.cwl_v1_2.CommandInputParameter( id="test", - type="stdin", + type_="stdin", inputBinding=cwl_utils.parser.cwl_v1_2.CommandLineBinding( prefix="--test" ), @@ -967,7 +967,7 @@ def test_v1_2_stdin_to_file_fail_with_original() -> None: """Test that stdin shortcut fails when stdin parameter is defined with CWL v1.2.""" clt = cwl_utils.parser.cwl_v1_2.CommandLineTool( inputs=[ - cwl_utils.parser.cwl_v1_2.CommandInputParameter(id="test", type="stdin") + cwl_utils.parser.cwl_v1_2.CommandInputParameter(id="test", type_="stdin") ], outputs=[], stdin="original.txt", @@ -981,7 +981,7 @@ def test_v1_2_type_compare_list() -> None: uri = Path(get_data("testdata/echo_v1_2.cwl")).resolve().as_uri() cwl_obj = load_document_by_uri(uri) assert cwl_utils.parser.cwl_v1_2_utils._compare_type( - cwl_obj.inputs[0].type, cwl_obj.inputs[0].type + cwl_obj.inputs[0].type_, cwl_obj.inputs[0].type_ ) @@ -1043,8 +1043,8 @@ def test_v1_2_type_output_source_record() -> None: MutableSequence[cwl_utils.parser.cwl_v1_2.RecordField], source_type.fields ) assert len(fields) == 2 - assert fields[0].type == "File" - assert fields[1].type == "File" + assert fields[0].type_ == "File" + assert fields[1].type_ == "File" def test_v1_2_type_for_output_source_with_single_scatter_step() -> None: