diff --git a/.gitignore b/.gitignore index 0900bed7..376eb398 100644 --- a/.gitignore +++ b/.gitignore @@ -111,6 +111,9 @@ testenv*/ # PyCharm .idea/ +# UV +uv.lock + # Backup files *.orig *~ diff --git a/cwl_utils/cite_extract.py b/cwl_utils/cite_extract.py index d35081d5..e7ff61c6 100755 --- a/cwl_utils/cite_extract.py +++ b/cwl_utils/cite_extract.py @@ -33,7 +33,7 @@ def main() -> int: def extract_software_reqs( - process: cwl.Process, + process: cwl.Process | cwl.WorkflowStep, ) -> Iterator[cwl.SoftwareRequirement]: """Return an iterator over any SoftwareRequirements found in the given process.""" if process.requirements: diff --git a/cwl_utils/cwl_v1_0_expression_refactor.py b/cwl_utils/cwl_v1_0_expression_refactor.py index c66e7d6f..2c0fb72c 100755 --- a/cwl_utils/cwl_v1_0_expression_refactor.py +++ b/cwl_utils/cwl_v1_0_expression_refactor.py @@ -17,6 +17,17 @@ import cwl_utils.parser.cwl_v1_0_utils as utils from cwl_utils.errors import JavascriptException, WorkflowException from cwl_utils.expression import do_eval, interpolate +from cwl_utils.parser.cwl_v1_0_utils import ( + AnyTypeSchema, + BasicCommandInputTypeSchemas, + BasicCommandOutputTypeSchemas, + BasicInputTypeSchemas, + BasicOutputTypeSchemas, + CommandInputTypeSchemas, + CommandOutputTypeSchemas, + InputTypeSchemas, + OutputTypeSchemas, +) from cwl_utils.types import ( CWLDirectoryType, CWLFileType, @@ -25,6 +36,7 @@ CWLParameterContext, CWLRuntimeParameterContext, is_file_or_directory, + is_sequence, ) @@ -55,33 +67,64 @@ def escape_expression_field(contents: str) -> str: return contents.replace("${", "$/{").replace("$(", "$/(") -def clean_type_ids( - cwltype: cwl.ArraySchema | cwl.InputRecordSchema, -) -> cwl.ArraySchema | cwl.InputRecordSchema: - """Simplify type identifiers.""" - result = copy.deepcopy(cwltype) - if isinstance(result, cwl.ArraySchema): - if isinstance(result.items, MutableSequence): - for item in result.items: +def _clean_type_ids( + cwltype: InputTypeSchemas | CommandOutputTypeSchemas, +) -> None: + if isinstance(cwltype, cwl.ArraySchema): + if is_sequence(cwltype.items): + for item in cwltype.items: if hasattr(item, "id"): item.id = item.id.split("#")[-1] - elif isinstance(result.items, cwl.InputRecordSchema): - if result.items.name: - result.items.name = result.items.name.split("/")[-1] - if result.items.fields: - for field in result.items.fields: + elif isinstance(cwltype.items, cwl.RecordSchema): + if ( + isinstance( + cwltype.items, + (cwl.InputRecordSchema, cwl.CommandOutputRecordSchema), + ) + and cwltype.items.name + ): + cwltype.items.name = cwltype.items.name.split("/")[-1] + if cwltype.items.fields: + for field in cwltype.items.fields: field.name = field.name.split("/")[-1] - elif isinstance(result, cwl.InputRecordSchema): - if result.name: - result.name = result.name.split("/")[-1] - if result.fields: - for field in result.fields: + elif isinstance(cwltype, cwl.RecordSchema): + if cwltype.fields: + for field in cwltype.fields: field.name = field.name.split("/")[-1] + + +def clean_type_ids( + cwltype: AnyTypeSchema, +) -> AnyTypeSchema: + """Simplify type identifiers.""" + result = copy.deepcopy(cwltype) + if is_sequence(result): + for item in result: + _clean_type_ids(item) + else: + _clean_type_ids(result) return result +def _has_expression(string: str) -> bool: + if "${" in string: + return True + if "$(" in string: + return True + return False + + +def has_expression(field: str | Sequence[str]) -> bool: + if is_sequence(field): + for entry in field: + if _has_expression(entry): + return True + return False + return _has_expression(field) + + def get_expression( - string: str, inputs: CWLObjectType, self: CWLOutputType | None + string: Any, inputs: CWLObjectType, self: CWLOutputType | None ) -> str | None: """ Find and return a normalized CWL expression, if any. @@ -136,6 +179,148 @@ def get_expression( return None +def _plain_input_schema_to_clt_input_schema( + input_type: BasicInputTypeSchemas, +) -> BasicCommandInputTypeSchemas: + match input_type: + case cwl.InputArraySchema(): + return cwl.CommandInputArraySchema.fromDoc( + input_type.save(), + input_type.loadingOptions.baseuri, + input_type.loadingOptions, + ) + case cwl.InputEnumSchema(): + return cwl.CommandInputEnumSchema.fromDoc( + input_type.save(), + input_type.loadingOptions.baseuri, + input_type.loadingOptions, + ) + case cwl.InputRecordSchema(): + return cwl.CommandInputRecordSchema.fromDoc( + input_type.save(), + input_type.loadingOptions.baseuri, + input_type.loadingOptions, + ) + case str(): + return input_type + raise WorkflowException(f"Unexpected ExpressionTool input type: {input_type}.") + + +def plain_input_schema_to_clt_input_schema( + input_type: InputTypeSchemas, +) -> CommandInputTypeSchemas: + if is_sequence(input_type): + return [ + _plain_input_schema_to_clt_input_schema(input_type_item) + for input_type_item in input_type + ] + if input_type is None: + return None + return _plain_input_schema_to_clt_input_schema(input_type) + + +def _plain_input_schema_to_plain_output_schema( + input_type: BasicInputTypeSchemas, +) -> BasicOutputTypeSchemas: + match input_type: + case cwl.InputArraySchema(): + return cwl.OutputArraySchema.fromDoc( + input_type.save(), + input_type.loadingOptions.baseuri, + input_type.loadingOptions, + ) + case cwl.InputEnumSchema(): + return cwl.OutputEnumSchema.fromDoc( + input_type.save(), + input_type.loadingOptions.baseuri, + input_type.loadingOptions, + ) + case cwl.InputRecordSchema(): + return cwl.OutputRecordSchema.fromDoc( + input_type.save(), + input_type.loadingOptions.baseuri, + input_type.loadingOptions, + ) + case str(): + return input_type + raise WorkflowException(f"Unexpected ExpressionTool input type: {input_type}.") + + +def plain_input_schema_to_plain_output_schema( + input_type: InputTypeSchemas, +) -> OutputTypeSchemas: + if is_sequence(input_type): + return [ + _plain_input_schema_to_plain_output_schema(input_type_item) + for input_type_item in input_type + ] + if input_type is None: + return None + return _plain_input_schema_to_plain_output_schema(input_type) + + +def _plain_output_type_to_clt_output_type( + output_type: BasicOutputTypeSchemas, +) -> BasicCommandOutputTypeSchemas: + match output_type: + case cwl.OutputArraySchema(): + return cwl.CommandOutputArraySchema.fromDoc( + output_type.save(), + output_type.loadingOptions.baseuri, + output_type.loadingOptions, + ) + case cwl.OutputEnumSchema(): + return cwl.CommandOutputEnumSchema.fromDoc( + output_type.save(), + output_type.loadingOptions.baseuri, + output_type.loadingOptions, + ) + case cwl.OutputRecordSchema(): + return cwl.CommandOutputRecordSchema.fromDoc( + output_type.save(), + output_type.loadingOptions.baseuri, + output_type.loadingOptions, + ) + case str(): + return output_type + raise WorkflowException(f"Unexpected ExpressionTool output type: {output_type}.") + + +def plain_output_type_to_clt_output_type( + output_type: OutputTypeSchemas, +) -> CommandOutputTypeSchemas: + if is_sequence(output_type): + return [ + _plain_output_type_to_clt_output_type(output_type_item) + for output_type_item in output_type + ] + if output_type is None: + return None + return _plain_output_type_to_clt_output_type(output_type) + + +def parameter_to_plain_input_paramater( + parameter: ( + cwl.InputParameter + | cwl.CommandInputParameter + | cwl.CommandOutputParameter + | cwl.ExpressionToolOutputParameter + | cwl.WorkflowOutputParameter + ), +) -> cwl.InputParameter: + return cwl.InputParameter.fromDoc( + parameter.save(), parameter.loadingOptions.baseuri, parameter.loadingOptions + ) + + +def parameters_to_plain_input_paramaters( + parameters: Sequence[ + cwl.InputParameter | cwl.CommandInputParameter | cwl.CommandOutputParameter + ], +) -> Sequence[cwl.InputParameter]: + return [parameter_to_plain_input_paramater(parameter) for parameter in parameters] + + def etool_to_cltool( etool: cwl.ExpressionTool, expressionLib: list[str] | None = None ) -> cwl.CommandLineTool: @@ -151,7 +336,7 @@ def etool_to_cltool( doc=inp.doc, format=inp.format, default=inp.default, - type_=inp.type_, + type_=plain_input_schema_to_clt_input_schema(inp.type_), extension_fields=inp.extension_fields, loadingOptions=inp.loadingOptions, ) @@ -166,7 +351,7 @@ def etool_to_cltool( streamable=outp.streamable, doc=outp.doc, format=outp.format, - type_=outp.type_, + type_=plain_output_type_to_clt_output_type(outp.type_), extension_fields=outp.extension_fields, loadingOptions=outp.loadingOptions, ) @@ -329,52 +514,57 @@ def generate_etool_from_expr( | list[cwl.InputParameter | cwl.CommandInputParameter] ) = None, # if the "self" input should be a different type than the "result" output extra_processes: None | ( - Sequence[cwl.Workflow | cwl.WorkflowStep | cwl.CommandLineTool] + Sequence[ + cwl.Workflow + | cwl.WorkflowStep + | cwl.CommandLineTool + | cwl.ExpressionTool + | cwl.ProcessGenerator + ] ) = None, ) -> cwl.ExpressionTool: """Convert a CWL Expression into an ExpressionTool.""" - inputs = yaml.comments.CommentedSeq() + inputs: list[cwl.InputParameter] = [] if not no_inputs: - if not self_type: + if self_type is None: self_type = target - if isinstance(self_type, list): - new_type: ( - list[cwl.ArraySchema | cwl.InputRecordSchema] - | 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_) + assert self_type is not None + new_type: InputTypeSchemas + if is_sequence(self_type): + new_type_list: MutableSequence[BasicInputTypeSchemas] = [] + for entry in self_type: + clean_type = clean_type_ids(entry.type_) + if is_sequence(clean_type): + new_type_list.extend(clean_type) + elif clean_type is None: + pass + else: + new_type_list.append(clean_type) + new_type = new_type_list else: - raise WorkflowException(f"Don't know how to make type from {self_type!r}.") + new_type = clean_type_ids(self_type.type_) inputs.append( cwl.InputParameter( id="self", - label=self_type.label if not isinstance(self_type, list) else None, + label=self_type.label if not is_sequence(self_type) else None, secondaryFiles=( - self_type.secondaryFiles - if not isinstance(self_type, list) - else None + self_type.secondaryFiles if not is_sequence(self_type) else None ), streamable=( - self_type.streamable if not isinstance(self_type, list) else None + self_type.streamable if not is_sequence(self_type) 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, + doc=self_type.doc if not is_sequence(self_type) else None, + format=(self_type.format if not is_sequence(self_type) else None), type_=new_type, extension_fields=( - self_type.extension_fields - if not isinstance(self_type, list) - else None + self_type.extension_fields if not is_sequence(self_type) else None ), loadingOptions=( - self_type.loadingOptions - if not isinstance(self_type, list) - else None + self_type.loadingOptions if not is_sequence(self_type) else None ), ) ) - outputs = yaml.comments.CommentedSeq() + outputs: list[cwl.ExpressionToolOutputParameter] = [] outputs.append( cwl.ExpressionToolOutputParameter( id="result", @@ -382,8 +572,8 @@ def generate_etool_from_expr( secondaryFiles=target.secondaryFiles, streamable=target.streamable, doc=target.doc, - format=target.format, - type_=target.type_, + format=target.format[0] if target.format else None, + type_=plain_input_schema_to_plain_output_schema(target.type_), extension_fields=target.extension_fields, loadingOptions=target.loadingOptions, ) @@ -412,18 +602,24 @@ def generate_etool_from_expr( def get_input_for_id( - name: str, tool: cwl.CommandLineTool | cwl.Workflow + name: str, + tool: ( + cwl.CommandLineTool | cwl.Workflow | cwl.ProcessGenerator | cwl.ExpressionTool + ), ) -> cwl.CommandInputParameter | None: """Determine the CommandInputParameter for the given input name.""" name = name.split("/")[-1] for inp in cast(list[cwl.CommandInputParameter], tool.inputs): if inp.id and inp.id.split("#")[-1].split("/")[-1] == name: - return inp + return cwl.CommandInputParameter.fromDoc( + inp.save(), inp.loadingOptions.baseuri, inp.loadingOptions + ) if isinstance(tool, cwl.Workflow) and "/" in name: stepname, stem = name.split("/", 1) for step in tool.steps: if step.id == stepname: + assert not isinstance(step.run, str) result = get_input_for_id(stem, step.run) if result: return result @@ -432,7 +628,11 @@ def get_input_for_id( def find_expressionLib( processes: Sequence[ - cwl.CommandLineTool | cwl.Workflow | cwl.ExpressionTool | cwl.WorkflowStep + cwl.CommandLineTool + | cwl.Workflow + | cwl.ExpressionTool + | cwl.WorkflowStep + | cwl.ProcessGenerator ], ) -> list[str] | None: """ @@ -457,23 +657,35 @@ def replace_expr_with_etool( source: str | list[Any] | None, replace_etool: bool = False, extra_process: None | ( - cwl.Workflow | cwl.WorkflowStep | cwl.CommandLineTool + cwl.Workflow + | cwl.WorkflowStep + | cwl.CommandLineTool + | cwl.ExpressionTool + | cwl.ProcessGenerator ) = None, source_type: cwl.CommandInputParameter | None = None, ) -> None: """Modify the given workflow, replacing the expr with an standalone ExpressionTool.""" - extra_processes: list[cwl.Workflow | cwl.WorkflowStep | cwl.CommandLineTool] = [ - workflow - ] + extra_processes: list[ + cwl.WorkflowStep + | cwl.Workflow + | cwl.CommandLineTool + | cwl.ExpressionTool + | cwl.ProcessGenerator + ] = [workflow] if extra_process: extra_processes.append(extra_process) etool: cwl.ExpressionTool = generate_etool_from_expr( expr, target, source is None, source_type, extra_processes ) if replace_etool: - processes: list[cwl.WorkflowStep | cwl.Workflow | cwl.CommandLineTool] = [ - workflow - ] + processes: list[ + cwl.WorkflowStep + | cwl.Workflow + | cwl.CommandLineTool + | cwl.ExpressionTool + | cwl.ProcessGenerator + ] = [workflow] if extra_process: processes.append(extra_process) final_tool: cwl.ExpressionTool | cwl.CommandLineTool = etool_to_cltool( @@ -484,14 +696,16 @@ def replace_expr_with_etool( inps = [] if source: inps.append(cwl.WorkflowStepInput(id="self", source=source)) - workflow.steps.append( + new_steps: list[cwl.WorkflowStep] = [ cwl.WorkflowStep( id=name, in_=inps, out=[cwl.WorkflowStepOutput("result")], run=final_tool, ) - ) + ] + new_steps.extend(workflow.steps) + workflow.steps = new_steps def replace_wf_input_ref_with_step_output( @@ -522,26 +736,33 @@ def replace_wf_input_ref_with_step_output( def empty_inputs( process_or_step: ( - cwl.CommandLineTool | cwl.WorkflowStep | cwl.ExpressionTool | cwl.Workflow + cwl.CommandLineTool + | cwl.WorkflowStep + | cwl.ExpressionTool + | cwl.Workflow + | cwl.ProcessGenerator ), parent: cwl.Workflow | None = None, ) -> dict[str, Any]: """Produce a mock input object for the given 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_) + for param1 in process_or_step.inputs: + result[param1.id.split("#")[-1]] = example_input(param1.type_) else: - for param in process_or_step.in_: - param_id = param.id.split("/")[-1] - if param.source is None and param.valueFrom: - result[param_id] = example_input("string") - elif param.source is None and param.default: - result[param_id] = param.default - else: + for param2 in process_or_step.in_: + param2_id = param2.id.split("/")[-1] + if param2.source is None and param2.valueFrom: + result[param2_id] = example_input("string") + elif param2.source is None and param2.default: + result[param2_id] = param2.default + elif param2.source is not None: with suppress(WorkflowException): - result[param_id] = example_input( - utils.type_for_source(process_or_step.run, param.source, parent) + assert not isinstance(process_or_step.run, str) + result[param2_id] = example_input( + utils.type_for_source( + process_or_step.run, param2.source, parent + ) ) return result @@ -618,33 +839,22 @@ def process_workflow_inputs_and_outputs( ) -> bool: """Do any needed conversions on the given Workflow's inputs and outputs.""" modified = False - inputs = empty_inputs(workflow) for index, param in enumerate(workflow.inputs): with SourceLine(workflow.inputs, index, WorkflowException): - if param.format and get_expression(param.format, inputs, None): + if param.format is not None and has_expression(param.format): raise SourceLine( param.loadingOptions.original_doc, "format", raise_type=WorkflowException, ).makeError(TOPLEVEL_FORMAT_EXPR_ERROR.format(param.id.split("#")[-1])) - if param.secondaryFiles: - if get_expression(param.secondaryFiles, inputs, EMPTY_FILE): - raise SourceLine( - param.loadingOptions.original_doc, - "secondaryFiles", - raise_type=WorkflowException, - ).makeError(TOPLEVEL_SF_EXPR_ERROR.format(param.id.split("#")[-1])) - elif isinstance(param.secondaryFiles, MutableSequence): - for index2, entry in enumerate(param.secondaryFiles): - if get_expression(entry, inputs, EMPTY_FILE): - raise SourceLine( - param.loadingOptions.original_doc, - index2, - raise_type=WorkflowException, - ).makeError( - f"Entry {index}," - + TOPLEVEL_SF_EXPR_ERROR.format(param.id.split("#")[-1]) - ) + if param.secondaryFiles is not None and has_expression( + param.secondaryFiles + ): + raise SourceLine( + param.loadingOptions.original_doc, + "secondaryFiles", + raise_type=WorkflowException, + ).makeError(TOPLEVEL_SF_EXPR_ERROR.format(param.id.split("#")[-1])) return modified @@ -689,7 +899,7 @@ def process_workflow_reqs_and_hints( if expression: modified = True target = cwl.InputParameter( - id=None, + id="", type_="string", ) etool_id = ( @@ -710,7 +920,9 @@ def process_workflow_reqs_and_hints( prop_reqs += (cwl.EnvVarRequirement,) newEnvDef = copy.deepcopy(envDef) newEnvDef.envValue = f"$(inputs._envDef{index})" - envVarReq.envDef[index] = newEnvDef + new_envDef = list(envVarReq.envDef) + new_envDef[index] = newEnvDef + envVarReq.envDef = new_envDef generated_envVar_reqs.append((etool_id, index)) case cwl.ResourceRequirement(): for attr in cwl.ResourceRequirement.attrs: @@ -719,7 +931,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="", type_="long") etool_id = "_expression_workflow_ResourceRequirement_{}".format( attr ) @@ -744,7 +956,7 @@ def process_workflow_reqs_and_hints( if expression: modified = True target = cwl.InputParameter( - id=None, + id="", type_=cwl.InputArraySchema( ["File", "Directory"], "array", None, None ), @@ -765,18 +977,18 @@ def process_workflow_reqs_and_hints( prop_reqs += (cwl.InitialWorkDirRequirement,) else: iwdr = copy.deepcopy(req) - for index, entry in enumerate(req.listing): - expression = get_expression(entry, inputs, None) + for index1, entry1 in enumerate(req.listing): + expression = get_expression(entry1, inputs, None) if expression: modified = True target = cwl.InputParameter( - id=None, + id="", type_=cwl.InputArraySchema( ["File", "Directory"], "array", None, None ), ) etool_id = "_expression_workflow_InitialWorkDirRequirement_{}".format( - index + index1 ) replace_expr_with_etool( expression, @@ -786,17 +998,19 @@ def process_workflow_reqs_and_hints( None, replace_etool, ) - iwdr.listing[index] = f"$(inputs._iwdr_listing_{index}" - generated_iwdr_reqs.append((etool_id, index)) - elif isinstance(entry, cwl.Dirent): - if entry.entry: + new_listing = list(iwdr.listing) + new_listing[index1] = f"$(inputs._iwdr_listing_{index1}" + iwdr.listing = new_listing + generated_iwdr_reqs.append((etool_id, index1)) + elif isinstance(entry1, cwl.Dirent): + if entry1.entry: expression = get_expression( - entry.entry, inputs, None + entry1.entry, inputs, None ) if expression: expr: str = expression expr_result = do_eval( - ex=entry.entry, + ex=entry1.entry, jobinput=inputs, requirements=[], outdir="", @@ -806,7 +1020,7 @@ def process_workflow_reqs_and_hints( modified = True if is_file_or_directory(expr_result): target = cwl.InputParameter( - id=None, + id="", type_=expr_result["class"], ) replace_expr_with_etool( @@ -817,38 +1031,38 @@ def process_workflow_reqs_and_hints( None, replace_etool, ) - iwdr.listing[index] = ( - "$(inputs._iwdr_listing_{}".format( - index - ) + new_listing = list(iwdr.listing) + new_listing[index1] = ( + f"$(inputs._iwdr_listing_{index1}" ) + iwdr.listing = new_listing generated_iwdr_reqs.append( - (etool_id, index) + (etool_id, index1) ) elif isinstance(expr_result, str): target = cwl.InputParameter( - id=None, + id="", type_=["File"], ) - if entry.entryname is None: + if entry1.entryname is None: raise SourceLine( - entry.loadingOptions.original_doc, - index, + entry1.loadingOptions.original_doc, + index1, raise_type=WorkflowException, ).makeError( - f"Entry {index}," + f"Entry {index1}," + "Invalid CWL, if 'entry' " "is a string, then entryName must be specified." ) expr = ( '${return {"class": "File", "basename": "' - + entry.entryname + + entry1.entryname + '", "contents": (function(){' + expr[2:-1] + "})() }; }" ) etool_id = "_expression_workflow_InitialWorkDirRequirement_{}".format( - index + index1 ) replace_expr_with_etool( expr, @@ -858,24 +1072,24 @@ def process_workflow_reqs_and_hints( None, replace_etool, ) - iwdr.listing[index] = ( - f"$(inputs._iwdr_listing_{index}" + new_listing = list(iwdr.listing) + new_listing[index1] = ( + f"$(inputs._iwdr_listing_{index1}" ) - generated_iwdr_reqs.append((etool_id, index)) + iwdr.listing = new_listing + generated_iwdr_reqs.append((etool_id, index1)) - elif entry.entryname: + elif entry1.entryname: expression = get_expression( - entry.entryname, inputs, None + entry1.entryname, inputs, None ) if expression: modified = True target = cwl.InputParameter( - id=None, + id="", type_="string", ) - etool_id = "_expression_workflow_InitialWorkDirRequirement_{}".format( - index - ) + etool_id = f"_expression_workflow_InitialWorkDirRequirement_{index1}" replace_expr_with_etool( expression, etool_id, @@ -884,10 +1098,12 @@ def process_workflow_reqs_and_hints( None, replace_etool, ) - iwdr.listing[index] = ( - f"$(inputs._iwdr_listing_{index}" + new_listing = list(iwdr.listing) + new_listing[index1] = ( + f"$(inputs._iwdr_listing_{index1}" ) - generated_iwdr_reqs.append((etool_id, index)) + iwdr.listing = new_listing + generated_iwdr_reqs.append((etool_id, index1)) if generated_iwdr_reqs: prop_reqs += (cwl.InitialWorkDirRequirement,) else: @@ -902,14 +1118,18 @@ def process_workflow_reqs_and_hints( continue else: step.requirements = yaml.comments.CommentedSeq() - step.requirements.append(envVarReq) - for entry in generated_envVar_reqs: - step.in_.append( + new_requirements = list(step.requirements) + new_requirements.append(envVarReq) + step.requirements = new_requirements + new_ins = list(step.in_) + for entry2 in generated_envVar_reqs: + new_ins.append( cwl.WorkflowStepInput( - id=f"_envDef{entry[1]}", - source=f"{entry[0]}/result", + id=f"_envDef{entry2[1]}", + source=f"{entry2[0]}/result", ) ) + step.in_ = new_ins if resourceReq and workflow.steps: for step in workflow.steps: @@ -920,15 +1140,19 @@ def process_workflow_reqs_and_hints( if isinstance(req, cwl.ResourceRequirement): continue else: - step.requirements = yaml.comments.CommentedSeq() - step.requirements.append(resourceReq) - for entry in generated_res_reqs: - step.in_.append( + step.requirements = [] + new_requirements = list(step.requirements) + new_requirements.append(resourceReq) + step.requirements = new_requirements + new_ins = list(step.in_) + for entry3 in generated_res_reqs: + new_ins.append( cwl.WorkflowStepInput( - id=f"_{entry[1]}", - source=f"{entry[0]}/result", + id=f"_{entry3[1]}", + source=f"{entry3[0]}/result", ) ) + step.in_ = new_ins if iwdr and workflow.steps: for step in workflow.steps: @@ -940,32 +1164,39 @@ def process_workflow_reqs_and_hints( continue else: step.requirements = yaml.comments.CommentedSeq() - step.requirements.append(iwdr) + new_requirements = list(step.requirements) + new_requirements.append(resourceReq) + new_requirements.append(iwdr) + step.requirements = new_requirements + new_ins = list(step.in_) if generated_iwdr_reqs: - for entry in generated_iwdr_reqs: - step.in_.append( + for entry4 in generated_iwdr_reqs: + new_ins.append( cwl.WorkflowStepInput( id=f"_iwdr_listing_{index}", - source=f"{entry[0]}/result", + source=f"{entry4[0]}/result", ) ) else: - step.in_.append( + new_ins.append( cwl.WorkflowStepInput( id="_iwdr_listing", source="_expression_workflow_InitialWorkDirRequirement/result", ) ) + step.in_ = new_ins if workflow.requirements: - workflow.requirements[:] = [ + workflow.requirements = [ x for x in workflow.requirements if not isinstance(x, prop_reqs) ] return modified def process_level_reqs( - process: cwl.CommandLineTool, + process: ( + cwl.CommandLineTool | cwl.ExpressionTool | cwl.ProcessGenerator | cwl.Workflow + ), step: cwl.WorkflowStep, parent: cwl.Workflow, replace_etool: bool, @@ -985,6 +1216,7 @@ def process_level_reqs( if not process.requirements: return False modified = False + assert not isinstance(step.run, str) target_process = step.run inputs = empty_inputs(process) generated_res_reqs: list[tuple[str, str]] = [] @@ -994,6 +1226,7 @@ def process_level_reqs( return False step_name = step.id.split("#", 1)[-1] for req_index, req in enumerate(process.requirements): + assert target_process.requirements is not None match req: case cwl.EnvVarRequirement() if req.envDef: for env_index, envDef in enumerate(req.envDef): @@ -1001,7 +1234,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="", type_="string") etool_id = "_expression_{}_EnvVarRequirement_{}".format( step_name, env_index ) @@ -1014,7 +1247,10 @@ def process_level_reqs( replace_etool, process, ) - target_process.requirements[req_index][ + cast( + cwl.EnvVarRequirement, + target_process.requirements[req_index], + ).envDef[ env_index ].envValue = f"$(inputs._envDef{env_index})" generated_envVar_reqs.append((etool_id, env_index)) @@ -1025,11 +1261,11 @@ 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="", type_="long") etool_id = "_expression_{}_ResourceRequirement_{}".format( step_name, attr ) - replace_clt_hintreq_expr_with_etool( + replace_step_process_hintreq_expr_with_etool( expression, etool_id, parent, @@ -1054,7 +1290,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="", type_=target_type) etool_id = "_expression_{}_InitialWorkDirRequirement".format( step_name ) @@ -1067,15 +1303,18 @@ def process_level_reqs( replace_etool, process, ) - target_process.requirements[req_index].listing = ( - "$(inputs._iwdr_listing)", - ) - step.in_.append( + cast( + cwl.InitialWorkDirRequirement, + target_process.requirements[req_index], + ).listing = ("$(inputs._iwdr_listing)",) + new_step_ins = list(step.in_) + new_step_ins.append( cwl.WorkflowStepInput( id="_iwdr_listing", source=f"{etool_id}/result", ) ) + step.in_ = new_step_ins add_input_to_process( target_process, "_iwdr_listing", @@ -1083,15 +1322,15 @@ def process_level_reqs( process.loadingOptions, ) else: - for listing_index, entry in enumerate(req.listing): - expression = get_expression(entry, inputs, None) + for listing_index, entry5 in enumerate(req.listing): + expression = get_expression(entry5, inputs, None) if expression: modified = True target_type = cwl.InputArraySchema( ["File", "Directory"], "array", None, None ) target = cwl.InputParameter( - id=None, + id="", type_=target_type, ) etool_id = ( @@ -1108,31 +1347,41 @@ def process_level_reqs( replace_etool, process, ) - target_process.requirements[req_index].listing[ - listing_index - ] = f"$(inputs._iwdr_listing_{listing_index}" + new_iwdr_listing = list( + cast( + cwl.InitialWorkDirRequirement, + target_process.requirements[req_index], + ).listing + ) + new_iwdr_listing[listing_index] = ( + f"$(inputs._iwdr_listing_{listing_index}" + ) + cast( + cwl.InitialWorkDirRequirement, + target_process.requirements[req_index], + ).listing = new_iwdr_listing generated_iwdr_reqs.append( (etool_id, listing_index, target_type) ) - elif isinstance(entry, cwl.Dirent): - if entry.entry: - expression = get_expression(entry.entry, inputs, None) + elif isinstance(entry5, cwl.Dirent): + if entry5.entry: + expression = get_expression(entry5.entry, inputs, None) if expression: modified = True - if entry.entryname is not None: + if entry5.entryname is not None: entryname_expr = get_expression( - entry.entryname, inputs, None + entry5.entryname, inputs, None ) entryname = ( - entry.entryname + entry5.entryname if entryname_expr - else f'"{entry.entryname}"' # noqa: B907 + else f'"{entry5.entryname}"' # noqa: B907 ) new_expression = ( "${var result; var entryname = " + entryname + "; var entry = " - + entry.entry[2:-1] + + entry5.entry[2:-1] + """; if (typeof entry === 'string' || entry instanceof String) { result = {"class": "File", "basename": entryname, "contents": entry} ; @@ -1148,14 +1397,14 @@ def process_level_reqs( new_expression = expression d_target_type = ["File", "Directory"] target = cwl.InputParameter( - id=None, + id="", type_=d_target_type, ) etool_id = "_expression_{}_InitialWorkDirRequirement_{}".format( step_name, listing_index ) - replace_clt_hintreq_expr_with_etool( + replace_step_process_hintreq_expr_with_etool( new_expression, etool_id, parent, @@ -1163,22 +1412,26 @@ def process_level_reqs( step, replace_etool, ) - target_process.requirements[req_index].listing[ - listing_index - ].entry = "$(inputs._iwdr_listing_{})".format( + cast( + cwl.Dirent, + cast( + cwl.InitialWorkDirRequirement, + target_process.requirements[req_index], + ).listing[listing_index], + ).entry = "$(inputs._iwdr_listing_{})".format( listing_index ) generated_iwdr_reqs.append( (etool_id, listing_index, d_target_type) ) - elif entry.entryname: + elif entry5.entryname: expression = get_expression( - entry.entryname, inputs, None + entry5.entryname, inputs, None ) if expression: modified = True target = cwl.InputParameter( - id=None, + id="", type_="string", ) etool_id = "_expression_{}_InitialWorkDirRequirement_{}".format( @@ -1193,26 +1446,40 @@ def process_level_reqs( replace_etool, process, ) - target_process.requirements[req_index].listing[ - listing_index - ].entryname = "$(inputs._iwdr_listing_{})".format( + cast( + cwl.Dirent, + cast( + cwl.InitialWorkDirRequirement, + target_process.requirements[req_index], + ).listing[listing_index], + ).entryname = "$(inputs._iwdr_listing_{})".format( listing_index ) generated_iwdr_reqs.append( (etool_id, listing_index, "string") ) - for entry in generated_envVar_reqs: - name = f"_envDef{entry[1]}" - step.in_.append(cwl.WorkflowStepInput(id=name, source=f"{entry[0]}/result")) + new_step_ins = list(step.in_) + for env_entry in generated_envVar_reqs: + name = f"_envDef{env_entry[1]}" + new_step_ins.append( + cwl.WorkflowStepInput(id=name, source=f"{env_entry[0]}/result") + ) add_input_to_process(target_process, name, "string", process.loadingOptions) - for entry in generated_res_reqs: - name = f"_{entry[1]}" - step.in_.append(cwl.WorkflowStepInput(id=name, source=f"{entry[0]}/result")) + for res_entry in generated_res_reqs: + name = f"_{res_entry[1]}" + new_step_ins.append( + cwl.WorkflowStepInput(id=name, source=f"{res_entry[0]}/result") + ) add_input_to_process(target_process, name, "long", process.loadingOptions) - for entry in generated_iwdr_reqs: - name = f"_iwdr_listing_{entry[1]}" - step.in_.append(cwl.WorkflowStepInput(id=name, source=f"{entry[0]}/result")) - add_input_to_process(target_process, name, entry[2], process.loadingOptions) + for iwdr_entry in generated_iwdr_reqs: + name = f"_iwdr_listing_{iwdr_entry[1]}" + new_step_ins.append( + cwl.WorkflowStepInput(id=name, source=f"{iwdr_entry[0]}/result") + ) + add_input_to_process( + target_process, name, iwdr_entry[2], process.loadingOptions + ) + step.in_ = new_step_ins return modified @@ -1221,13 +1488,15 @@ def add_input_to_process( ) -> None: """Add a new InputParameter to the given CommandLineTool.""" if isinstance(process, cwl.CommandLineTool): - process.inputs.append( + new_process_inputs = list(process.inputs) + new_process_inputs.append( cwl.CommandInputParameter( id=name, type_=inptype, loadingOptions=loadingOptions, ) ) + process.inputs = new_process_inputs def traverse_CommandLineTool( @@ -1241,7 +1510,7 @@ def traverse_CommandLineTool( """Extract any CWL Expressions within the given CommandLineTool into sibling steps.""" modified = False # don't modify clt, modify step.run - target_clt = step.run + target_clt = cast(cwl.CommandLineTool, step.run) inputs = empty_inputs(clt) if not step.id: return False @@ -1255,24 +1524,28 @@ 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="", type_=target_type) replace_step_clt_expr_with_etool( expression, etool_id, parent, target, step, replace_etool ) - target_clt.arguments[index] = cwl.CommandLineBinding( + new_target_clt_arguments = list(target_clt.arguments or []) + new_target_clt_arguments[index] = cwl.CommandLineBinding( valueFrom=f"$(inputs.{inp_id})" ) - target_clt.inputs.append( + target_clt.arguments = new_target_clt_arguments + new_target_clt_inputs = list(target_clt.inputs) + new_target_clt_inputs.append( cwl.CommandInputParameter( id=inp_id, type_=target_type, ) ) - step.in_.append( - cwl.WorkflowStepInput( - f"{etool_id}/result", None, inp_id, None, None - ) + target_clt.inputs = new_target_clt_inputs + new_step_ins = list(step.in_) + new_step_ins.append( + cwl.WorkflowStepInput(id=f"{etool_id}/result", source=inp_id) ) + step.in_ = new_step_ins remove_JSReq(target_clt, skip_command_line1) elif isinstance(arg, cwl.CommandLineBinding) and arg.valueFrom: expression = get_expression(arg.valueFrom, inputs, None) @@ -1281,22 +1554,28 @@ 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="", type_=target_type) replace_step_clt_expr_with_etool( expression, etool_id, parent, target, step, replace_etool ) - target_clt.arguments[index].valueFrom = "$(inputs.{})".format( - inp_id + new_target_clt_arguments = list(target_clt.arguments or []) + new_target_clt_arguments[index] = cwl.CommandLineBinding( + valueFrom="$(inputs.{})".format(inp_id) ) - target_clt.inputs.append( + target_clt.arguments = new_target_clt_arguments + new_target_clt_inputs = list(target_clt.inputs) + new_target_clt_inputs.append( cwl.CommandInputParameter( id=inp_id, type_=target_type, ) ) - step.in_.append( + target_clt.inputs = new_target_clt_inputs + new_step_ins = list(step.in_) + new_step_ins.append( cwl.WorkflowStepInput(id=inp_id, source=f"{etool_id}/result") ) + step.in_ = new_step_ins remove_JSReq(target_clt, skip_command_line1) for streamtype in "stdout", "stderr": # add 'stdin' for v1.1 version stream_value = getattr(clt, streamtype) @@ -1307,17 +1586,21 @@ 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="", 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( + new_target_clt_inputs = list(target_clt.inputs) + new_target_clt_inputs.append( cwl.CommandInputParameter(id=inp_id, type_=target_type) ) - step.in_.append( + target_clt.inputs = new_target_clt_inputs + new_step_ins = list(step.in_) + new_step_ins.append( cwl.WorkflowStepInput(id=inp_id, source=f"{etool_id}/result") ) + step.in_ = new_step_ins for inp in clt.inputs: if not skip_command_line1 and inp.inputBinding and inp.inputBinding.valueFrom: expression = get_expression( @@ -1332,12 +1615,19 @@ def traverse_CommandLineTool( expression, etool_id, parent, inp, step, replace_etool, self_id ) inp.inputBinding.valueFrom = f"$(inputs.{inp_id})" - target_clt.inputs.append( - cwl.CommandInputParameter(id=inp_id, type_=inp.type_) + new_target_clt_inputs = list(target_clt.inputs) + new_target_clt_inputs.append( + cwl.CommandInputParameter( + id=inp_id, + type_=plain_input_schema_to_clt_input_schema(inp.type_), + ) ) - step.in_.append( + target_clt.inputs = new_target_clt_inputs + new_step_ins = list(step.in_) + new_step_ins.append( cwl.WorkflowStepInput(id=inp_id, source=f"{etool_id}/result") ) + step.in_ = new_step_ins for outp in clt.outputs: if outp.outputBinding: if outp.outputBinding.glob: @@ -1346,21 +1636,28 @@ def traverse_CommandLineTool( modified = True 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) + glob_target_type: CommandInputTypeSchemas = [ + "string", + cwl.CommandInputArraySchema("string", "array"), + ] + target = cwl.InputParameter(id="", type_=glob_target_type) replace_step_clt_expr_with_etool( expression, etool_id, parent, target, step, replace_etool ) outp.outputBinding.glob = f"$(inputs.{inp_id})" - target_clt.inputs.append( + new_target_clt_inputs = list(target_clt.inputs) + new_target_clt_inputs.append( cwl.CommandInputParameter( id=inp_id, type_=glob_target_type, ) ) - step.in_.append( + target_clt.inputs = new_target_clt_inputs + new_step_ins = list(step.in_) + new_step_ins.append( cwl.WorkflowStepInput(id=inp_id, source=f"{etool_id}/result") ) + step.in_ = new_step_ins if outp.outputBinding.outputEval and not skip_command_line2: self: CWLOutputType = [ { @@ -1384,34 +1681,45 @@ def traverse_CommandLineTool( step, etool_id, outp_id ) self_type = cwl.InputParameter( - id=None, + id="", type_=cwl.InputArraySchema("File", "array", None, None), ) + if isinstance(outp, cwl.CommandOutputParameter): + target = parameter_to_plain_input_paramater(outp) + else: + target = outp etool = generate_etool_from_expr( - expression, outp, False, self_type, [clt, step, parent] + expression, target, False, self_type, [clt, step, parent] ) if outp.outputBinding.loadContents: - etool.inputs[0].type_.inputBinding = cwl.CommandLineBinding( + etool.inputs[0].inputBinding = cwl.CommandLineBinding( loadContents=True ) - etool.inputs.extend(cltool_inputs_to_etool_inputs(clt)) - sub_wf_inputs = cltool_inputs_to_etool_inputs(clt) + etool.inputs = list(etool.inputs) + process_inputs_to_etool_inputs( + clt + ) + sub_wf_inputs = process_inputs_to_etool_inputs(clt) orig_step_inputs = copy.deepcopy(step.in_) for orig_step_input in orig_step_inputs: - orig_step_input.id = orig_step_input.id.split("/")[-1] - if isinstance(orig_step_input.source, MutableSequence): + if is_sequence(orig_step_input.source): + new_orig_step_input_source = list(orig_step_input.source) for index, source in enumerate(orig_step_input.source): - orig_step_input.source[index] = source.split("#")[-1] + new_orig_step_input_source[index] = source.split("#")[ + -1 + ] + orig_step_input.source = new_orig_step_input_source + elif orig_step_input.source is None: + continue else: orig_step_input.source = orig_step_input.source.split("#")[ -1 ] - orig_step_inputs[:] = [ + orig_step_inputs = [ x for x in orig_step_inputs if not x.id.startswith("_") ] - for inp in orig_step_inputs: - inp.source = inp.id - inp.linkMerge = None + for wsi in orig_step_inputs: + wsi.source = wsi.id + wsi.linkMerge = None if replace_etool: processes = [parent] final_etool: cwl.CommandLineTool | cwl.ExpressionTool = ( @@ -1430,8 +1738,8 @@ def traverse_CommandLineTool( step ) # a deepcopy would be convenient, but params2.cwl gives it problems new_clt_step.id = new_clt_step.id.split("#")[-1] - new_clt_step.run = copy.copy(step.run) - new_clt_step.run.id = None + new_clt_step.run = copy.copy(target_clt) + new_clt_step.run.id = "" remove_JSReq(new_clt_step.run, skip_command_line1) for new_outp in new_clt_step.run.outputs: if new_outp.id.split("#")[-1] == outp_id: @@ -1459,12 +1767,17 @@ def traverse_CommandLineTool( type(new_outp), ) new_clt_step.in_ = copy.deepcopy(step.in_) - for inp in new_clt_step.in_: - inp.id = inp.id.split("/")[-1] - inp.source = inp.id - inp.linkMerge = None - for index, out in enumerate(new_clt_step.out): - new_clt_step.out[index] = out.split("/")[-1] + for wsi2 in new_clt_step.in_: + wsi2.id = wsi2.id.split("/")[-1] + wsi2.source = wsi2.id + wsi2.linkMerge = None + new_clt_step_out = list(new_clt_step.out) + for index, out in enumerate(new_clt_step_out): + if isinstance(out, str): + new_clt_step_out[index] = out.split("/")[-1] + else: + out.id = out.id.split("/")[-1] + new_clt_step.out = new_clt_step_out for tool_inp in new_clt_step.run.inputs: tool_inp.id = tool_inp.id.split("#")[-1] for tool_out in new_clt_step.run.outputs: @@ -1495,24 +1808,33 @@ def traverse_CommandLineTool( if isinstance(req, cwl.SubworkflowFeatureRequirement): has_sub_wf_req = True if not has_sub_wf_req: - parent.requirements.append( - cwl.SubworkflowFeatureRequirement() - ) + new_parent_reqs = list(parent.requirements) + new_parent_reqs.append(cwl.SubworkflowFeatureRequirement()) + parent.requirements = new_parent_reqs return modified def rename_step_source(workflow: cwl.Workflow, old: str, new: str) -> None: """Update step source names to the new name.""" - def simplify_wf_id(uri: str) -> str: - return uri.split("#")[-1].split("/", 1)[1] + def simplify_wf_ids(uris: Sequence[str] | str | None) -> set[str]: + if isinstance(uris, str): + uri_seq: Sequence[str] = [uris] + elif uris is None: + return set() + else: + uri_seq = uris + return {uri.split("#")[-1].split("/", 1)[1] for uri in uri_seq} def simplify_step_id(uri: str) -> str: return uri.split("#")[-1] for wf_outp in workflow.outputs: - if wf_outp.outputSource and simplify_wf_id(wf_outp.outputSource) == old: - wf_outp.outputSource = new + simplified_wf_ids = simplify_wf_ids(wf_outp.outputSource) + if wf_outp.outputSource and old in simplified_wf_ids: + simplified_wf_ids.remove(old) + simplified_wf_ids.add(new) + wf_outp.outputSource = list(simplified_wf_ids) for step in workflow.steps: if step.in_: for inp in step.in_: @@ -1528,7 +1850,9 @@ def simplify_step_id(uri: str) -> str: else: for index, source in enumerate(inp.source): if simplify_step_id(source) == old: - inp.source[index] = new + new_inp_source = list(inp.source) + new_inp_source[index] = new + inp.source = new_inp_source def remove_JSReq( @@ -1539,7 +1863,7 @@ def remove_JSReq( if skip_command_line1 and isinstance(process, cwl.CommandLineTool): return if process.hints: - process.hints[:] = [ + process.hints = [ hint for hint in process.hints if not isinstance(hint, cwl.InlineJavascriptRequirement) @@ -1547,7 +1871,7 @@ def remove_JSReq( if not process.hints: process.hints = None if process.requirements: - process.requirements[:] = [ + process.requirements = [ req for req in process.requirements if not isinstance(req, cwl.InlineJavascriptRequirement) @@ -1566,7 +1890,8 @@ def replace_step_clt_expr_with_etool( self_name: str | None = None, ) -> None: """Convert a step level CWL Expression to a sibling expression step.""" - etool_inputs = cltool_inputs_to_etool_inputs(step.run) + assert not isinstance(step.run, str) + etool_inputs = process_inputs_to_etool_inputs(step.run) temp_etool = generate_etool_from_expr2( expr, target, etool_inputs, self_name, step.run, [workflow] ) @@ -1580,8 +1905,9 @@ def replace_step_clt_expr_with_etool( wf_step_inputs = copy.deepcopy(step.in_) for wf_step_input in wf_step_inputs: wf_step_input.id = wf_step_input.id.split("/")[-1] - wf_step_inputs[:] = [x for x in wf_step_inputs if not x.id.startswith("_")] - workflow.steps.append( + wf_step_inputs = [x for x in wf_step_inputs if not x.id.startswith("_")] + new_steps = list(workflow.steps) + new_steps.append( cwl.WorkflowStep( id=name, in_=wf_step_inputs, @@ -1589,9 +1915,10 @@ def replace_step_clt_expr_with_etool( run=etool, ) ) + workflow.steps = new_steps -def replace_clt_hintreq_expr_with_etool( +def replace_step_process_hintreq_expr_with_etool( expr: str, name: str, workflow: cwl.Workflow, @@ -1602,7 +1929,8 @@ def replace_clt_hintreq_expr_with_etool( ) -> cwl.CommandLineTool | cwl.ExpressionTool: """Factor out an expression inside a CommandLineTool req or hint into a sibling step.""" # Same as replace_step_clt_expr_with_etool or different? - etool_inputs = cltool_inputs_to_etool_inputs(step.run) + assert not isinstance(step.run, str) + etool_inputs = process_inputs_to_etool_inputs(step.run) temp_etool = generate_etool_from_expr2( expr, target, etool_inputs, self_name, step.run, [workflow] ) @@ -1616,8 +1944,9 @@ def replace_clt_hintreq_expr_with_etool( wf_step_inputs = copy.deepcopy(step.in_) for wf_step_input in wf_step_inputs: wf_step_input.id = wf_step_input.id.split("/")[-1] - wf_step_inputs[:] = [x for x in wf_step_inputs if not x.id.startswith("_")] - workflow.steps.append( + wf_step_inputs = [x for x in wf_step_inputs if not x.id.startswith("_")] + new_steps = list(workflow.steps) + new_steps.append( cwl.WorkflowStep( id=name, in_=wf_step_inputs, @@ -1625,30 +1954,33 @@ def replace_clt_hintreq_expr_with_etool( run=etool, ) ) + workflow.steps = new_steps return etool -def cltool_inputs_to_etool_inputs( - tool: cwl.CommandLineTool, +def process_inputs_to_etool_inputs( + tool: ( + cwl.CommandLineTool | cwl.ExpressionTool | cwl.ProcessGenerator | cwl.Workflow + ), ) -> list[cwl.InputParameter]: - """Copy CommandLineTool input objects into the equivalent ExpressionTool input objects.""" - inputs = yaml.comments.CommentedSeq() + """Copy Process input parameters to matching ExpressionTool versions.""" + inputs = [] if tool.inputs: - for clt_inp in tool.inputs: - clt_inp_id = clt_inp.id.split("#")[-1].split("/")[-1] - if not clt_inp_id.startswith("_"): + for process_inp in tool.inputs: + process_inp_id = process_inp.id.split("#")[-1].split("/")[-1] + if not process_inp_id.startswith("_"): inputs.append( cwl.InputParameter( - id=clt_inp_id, - label=clt_inp.label, - secondaryFiles=clt_inp.secondaryFiles, - streamable=clt_inp.streamable, - doc=clt_inp.doc, - format=clt_inp.format, - default=clt_inp.default, - type_=clt_inp.type_, - extension_fields=clt_inp.extension_fields, - loadingOptions=clt_inp.loadingOptions, + id=process_inp_id, + label=process_inp.label, + secondaryFiles=process_inp.secondaryFiles, + streamable=process_inp.streamable, + doc=process_inp.doc, + format=process_inp.format, + default=process_inp.default, + type_=process_inp.type_, + extension_fields=process_inp.extension_fields, + loadingOptions=process_inp.loadingOptions, ) ) return inputs @@ -1656,17 +1988,18 @@ def cltool_inputs_to_etool_inputs( def cltool_step_outputs_to_workflow_outputs( cltool_step: cwl.WorkflowStep, etool_step_id: str, etool_out_id: str -) -> list[cwl.OutputParameter]: +) -> list[cwl.WorkflowOutputParameter]: """ Copy CommandLineTool outputs into the equivalent Workflow output parameters. Connects the outputSources for each of the new output parameters to the step they came from. """ - outputs = yaml.comments.CommentedSeq() + outputs: list[cwl.WorkflowOutputParameter] = [] if not cltool_step.id: raise WorkflowException(f"Missing step id from {cltool_step}.") default_step_id = cltool_step.id.split("#")[-1] + assert not isinstance(cltool_step.run, str) if cltool_step.run.outputs: for clt_out in cltool_step.run.outputs: clt_out_id = clt_out.id.split("#")[-1].split("/")[-1] @@ -1699,7 +2032,13 @@ def generate_etool_from_expr2( cwl.InputParameter | cwl.CommandInputParameter | cwl.CommandOutputParameter ], self_name: str | None = None, - process: cwl.CommandLineTool | cwl.ExpressionTool | None = None, + process: ( + cwl.CommandLineTool + | cwl.ExpressionTool + | cwl.Workflow + | cwl.ProcessGenerator + | None + ) = None, extra_processes: None | ( Sequence[cwl.Workflow | cwl.WorkflowStep | cwl.CommandLineTool] ) = None, @@ -1713,8 +2052,8 @@ def generate_etool_from_expr2( secondaryFiles=target.secondaryFiles, streamable=target.streamable, doc=target.doc, - format=target.format, - type_=target.type_, + format=target.format[0] if target.format else None, + type_=plain_input_schema_to_plain_output_schema(target.type_), ) ) expression = "${" @@ -1729,19 +2068,47 @@ def generate_etool_from_expr2( ) hints = None procs: list[ - cwl.CommandLineTool | cwl.ExpressionTool | cwl.Workflow | cwl.WorkflowStep + cwl.CommandLineTool + | cwl.ExpressionTool + | cwl.Workflow + | cwl.WorkflowStep + | cwl.ProcessGenerator ] = [] if process: procs.append(process) if extra_processes: procs.extend(extra_processes) inlineJSReq = cwl.InlineJavascriptRequirement(find_expressionLib(procs)) - reqs = [inlineJSReq] + reqs: MutableSequence[ + cwl.CUDARequirement + | cwl.DockerRequirement + | cwl.EnvVarRequirement + | cwl.InitialWorkDirRequirement + | cwl.InlineJavascriptRequirement + | cwl.InplaceUpdateRequirement + | cwl.LoadListingRequirement + | cwl.MPIRequirement + | cwl.MultipleInputFeatureRequirement + | cwl.NetworkAccess + | cwl.ResourceRequirement + | cwl.ScatterFeatureRequirement + | cwl.SchemaDefRequirement + | cwl.Secrets + | cwl.ShellCommandRequirement + | cwl.ShmSize + | cwl.SoftwareRequirement + | cwl.StepInputExpressionRequirement + | cwl.SubworkflowFeatureRequirement + | cwl.TimeLimit + | cwl.WorkReuse + ] = [inlineJSReq] if process: if process.hints: hints = copy.deepcopy(process.hints) - hints[:] = [ - x for x in hints if not isinstance(x, cwl.InitialWorkDirRequirement) + hints = [ + x + for x in copy.deepcopy(hints) + if not isinstance(x, cwl.InitialWorkDirRequirement) ] if process.requirements: reqs.extend(copy.deepcopy(process.requirements)) @@ -1750,7 +2117,7 @@ def generate_etool_from_expr2( ] return cwl.ExpressionTool( id="_:" + str(uuid.uuid4()), - inputs=inputs, + inputs=parameters_to_plain_input_paramaters(inputs), outputs=outputs, expression=expression, requirements=reqs, @@ -1772,43 +2139,29 @@ def traverse_step( return False step_id = step.id.split("#")[-1] original_process = copy.deepcopy(step.run) + assert not isinstance(original_process, str) + assert not isinstance(step.run, str) original_step_ins = copy.deepcopy(step.in_) for inp in step.in_: if inp.valueFrom: if not inp.source: self = None else: - if isinstance(inp.source, MutableSequence): - self = [] - for source in inp.source: - if not step.scatter: - self.append( - example_input( - utils.type_for_source(parent, source.split("#")[-1]) - ) - ) - else: - scattered_source_type = utils.type_for_source( - parent, source - ) - if isinstance(scattered_source_type, list): - for stype in scattered_source_type: - self.append(example_input(stype.type_)) - else: - self.append(example_input(scattered_source_type.type_)) - else: + self = [] + for source in inp.source: if not step.scatter: - self = example_input( - utils.type_for_source(parent, inp.source.split("#")[-1]) + self.append( + example_input( + utils.type_for_source(parent, source.split("#")[-1]) + ) ) else: - scattered_source_type2 = utils.type_for_source( - parent, inp.source - ) - if isinstance(scattered_source_type2, list): - self = example_input(scattered_source_type2[0].type_) + scattered_source_type = utils.type_for_source(parent, source) + if is_sequence(scattered_source_type): + for stype in scattered_source_type: + self.append(example_input(stype.type_)) else: - self = example_input(scattered_source_type2.type_) + self.append(example_input(scattered_source_type.type_)) expression = get_expression(inp.valueFrom, inputs, self) if expression: modified = True @@ -1824,31 +2177,23 @@ def traverse_step( | cwl.CommandOutputParameter ) = None if inp.source: - if isinstance(inp.source, MutableSequence): - input_source_id = [] - source_types: list[cwl.InputParameter] = [] - for source in inp.source: - source_id = source.split("#")[-1] - input_source_id.append(source_id) - temp_type = utils.type_for_source( - step.run, source_id, parent - ) - if isinstance(temp_type, list): - for ttype in temp_type: - if ttype not in source_types: - source_types.append(ttype) - else: - if temp_type not in source_types: - source_types.append(temp_type) - source_type = cwl.InputParameter( - id=None, - type_=cwl.ArraySchema(source_types, "array"), - ) - else: - input_source_id = inp.source.split("#")[-1] - source_type = utils.param_for_source_id( - step.run, input_source_id, parent - ) + input_source_id = [] + source_types: list[BasicInputTypeSchemas] = [] + for source in inp.source: + source_id = source.split("#")[-1] + input_source_id.append(source_id) + temp_type = utils.type_for_source(step.run, source_id, parent) + if is_sequence(temp_type): + for ttype in temp_type: + if ttype not in source_types: + source_types.append(ttype) + else: + if temp_type not in source_types: + source_types.append(temp_type) + source_type = cwl.InputParameter( + id="", + type_=cwl.InputArraySchema(source_types, "array"), + ) # target.id = target.id.split('#')[-1] if isinstance(original_process, cwl.ExpressionTool): found_JSReq = False @@ -1864,9 +2209,11 @@ def traverse_step( if not step.run.requirements: step.run.requirements = [] expr_lib = find_expressionLib([parent]) - step.run.requirements.append( + new_step_run_requirements = list(step.run.requirements) + new_step_run_requirements.append( cwl.InlineJavascriptRequirement(expr_lib) ) + step.run.requirements = new_step_run_requirements replace_step_valueFrom_expr_with_etool( expression, etool_id, @@ -1883,6 +2230,7 @@ def traverse_step( inp.valueFrom = None inp.source = f"{etool_id}/result" # TODO: skip or special process for sub workflows? + assert not isinstance(original_process, str) process_modified = process_level_reqs( original_process, step, @@ -1908,35 +2256,35 @@ def traverse_step( def workflow_step_to_InputParameters( - step_ins: list[cwl.WorkflowStepInput], parent: cwl.Workflow, except_in_id: str -) -> list[cwl.InputParameter | cwl.CommandOutputParameter]: - """Create InputParameters to match the given WorkflowStep inputs.""" + step_ins: Sequence[cwl.WorkflowStepInput], parent: cwl.Workflow, except_in_id: str +) -> list[cwl.InputParameter]: + """Create ExpressionTool InputParameters to match the given WorkflowStep inputs.""" params = [] for inp in step_ins: - if not inp.id: - continue inp_id = inp.id.split("#")[-1].split("/")[-1] if inp.source and inp_id != except_in_id: param = copy.deepcopy( utils.param_for_source_id(parent, sourcenames=inp.source) ) - if isinstance(param, MutableSequence): + if is_sequence(param): for p in param: 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_) - params.append(p) + new_param = parameter_to_plain_input_paramater(p) + new_param.id = inp_id + new_param.type_ = clean_type_ids(new_param.type_) + params.append(new_param) else: 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_) - params.append(param) + new_param = parameter_to_plain_input_paramater(param) + new_param.id = inp_id + new_param.type_ = clean_type_ids(new_param.type_) + params.append(new_param) return params @@ -1947,14 +2295,16 @@ def replace_step_valueFrom_expr_with_etool( target: cwl.CommandInputParameter | cwl.InputParameter, step: cwl.WorkflowStep, step_inp: cwl.WorkflowStepInput, - original_process: cwl.CommandLineTool | cwl.ExpressionTool, - original_step_ins: list[cwl.WorkflowStepInput], + original_process: ( + cwl.CommandLineTool | cwl.ExpressionTool | cwl.ProcessGenerator | cwl.Workflow + ), + original_step_ins: Sequence[cwl.WorkflowStepInput], source: str | list[str] | None, replace_etool: bool, source_type: ( cwl.InputParameter | cwl.CommandOutputParameter - | MutableSequence[cwl.InputParameter | cwl.CommandOutputParameter] + | Sequence[cwl.InputParameter | cwl.CommandOutputParameter] | None ) = None, ) -> None: @@ -1988,7 +2338,7 @@ def replace_step_valueFrom_expr_with_etool( etool: cwl.ExpressionTool | cwl.CommandLineTool = cltool else: etool = temp_etool - wf_step_inputs = copy.deepcopy(original_step_ins) + wf_step_inputs = list(original_step_ins) if source: wf_step_inputs.append(cwl.WorkflowStepInput(id="self", source=step_inp.source)) for wf_step_input in wf_step_inputs: @@ -1996,12 +2346,11 @@ def replace_step_valueFrom_expr_with_etool( if wf_step_input.valueFrom: wf_step_input.valueFrom = None if wf_step_input.source: - if isinstance(wf_step_input.source, MutableSequence): - for index, inp_source in enumerate(wf_step_input.source): - wf_step_input.source[index] = inp_source.split("#")[-1] - else: - wf_step_input.source = wf_step_input.source.split("#")[-1] - wf_step_inputs[:] = [ + new_source = list(wf_step_input.source) + for index, inp_source in enumerate(wf_step_input.source): + new_source[index] = inp_source.split("#")[-1] + wf_step_input.source = new_source + wf_step_inputs = [ x for x in wf_step_inputs if x.id and not (x.id.startswith("_") or x.id.endswith(step_inp_id)) @@ -2017,7 +2366,8 @@ def replace_step_valueFrom_expr_with_etool( # do we still need to scatter? else: scatter = None - workflow.steps.append( + new_steps = list(workflow.steps) + new_steps.append( cwl.WorkflowStep( id=name, in_=wf_step_inputs, @@ -2027,6 +2377,7 @@ def replace_step_valueFrom_expr_with_etool( scatterMethod=step.scatterMethod, ) ) + workflow.steps = new_steps def traverse_workflow( @@ -2059,7 +2410,7 @@ def traverse_workflow( if process_workflow_reqs_and_hints(workflow, replace_etool): modified = True if workflow.requirements: - workflow.requirements[:] = [ + workflow.requirements = [ x for x in workflow.requirements if not isinstance( diff --git a/cwl_utils/cwl_v1_1_expression_refactor.py b/cwl_utils/cwl_v1_1_expression_refactor.py index 3f260e56..3523cd82 100755 --- a/cwl_utils/cwl_v1_1_expression_refactor.py +++ b/cwl_utils/cwl_v1_1_expression_refactor.py @@ -17,6 +17,17 @@ import cwl_utils.parser.cwl_v1_1_utils as utils from cwl_utils.errors import JavascriptException, WorkflowException from cwl_utils.expression import do_eval, interpolate +from cwl_utils.parser.cwl_v1_1_utils import ( + AnyTypeSchema, + BasicCommandInputTypeSchemas, + BasicCommandOutputTypeSchemas, + BasicInputTypeSchemas, + BasicOutputTypeSchemas, + CommandInputTypeSchemas, + CommandOutputTypeSchemas, + InputTypeSchemas, + OutputTypeSchemas, +) from cwl_utils.types import ( CWLDirectoryType, CWLFileType, @@ -25,6 +36,7 @@ CWLParameterContext, CWLRuntimeParameterContext, is_file_or_directory, + is_sequence, ) @@ -44,7 +56,7 @@ def expand_stream_shortcuts(process: cwl.CommandLineTool) -> cwl.CommandLineTool ).hexdigest() result.stdout = stdout_path result.outputs[index].type_ = "File" - output.outputBinding = cwl.CommandOutputBinding(stdout_path, None, None) + output.outputBinding = cwl.CommandOutputBinding(glob=stdout_path) if result: return result return process @@ -55,33 +67,64 @@ def escape_expression_field(contents: str) -> str: return contents.replace("${", "$/{").replace("$(", "$/(") -def clean_type_ids( - cwltype: cwl.ArraySchema | cwl.InputRecordSchema, -) -> cwl.ArraySchema | cwl.InputRecordSchema: - """Simplify type identifiers.""" - result = copy.deepcopy(cwltype) - if isinstance(result, cwl.ArraySchema): - if isinstance(result.items, MutableSequence): - for item in result.items: +def _clean_type_ids( + cwltype: InputTypeSchemas | CommandOutputTypeSchemas, +) -> None: + if isinstance(cwltype, cwl.ArraySchema): + if is_sequence(cwltype.items): + for item in cwltype.items: if hasattr(item, "id"): item.id = item.id.split("#")[-1] - elif isinstance(result.items, cwl.InputRecordSchema): - if result.items.name: - result.items.name = result.items.name.split("/")[-1] - if result.items.fields: - for field in result.items.fields: + elif isinstance(cwltype.items, cwl.RecordSchema): + if ( + isinstance( + cwltype.items, + (cwl.InputRecordSchema, cwl.CommandOutputRecordSchema), + ) + and cwltype.items.name + ): + cwltype.items.name = cwltype.items.name.split("/")[-1] + if cwltype.items.fields: + for field in cwltype.items.fields: field.name = field.name.split("/")[-1] - elif isinstance(result, cwl.InputRecordSchema): - if result.name: - result.name = result.name.split("/")[-1] - if result.fields: - for field in result.fields: + elif isinstance(cwltype, cwl.RecordSchema): + if cwltype.fields: + for field in cwltype.fields: field.name = field.name.split("/")[-1] + + +def clean_type_ids( + cwltype: AnyTypeSchema, +) -> AnyTypeSchema: + """Simplify type identifiers.""" + result = copy.deepcopy(cwltype) + if is_sequence(result): + for item in result: + _clean_type_ids(item) + else: + _clean_type_ids(result) return result +def _has_expression(string: str) -> bool: + if "${" in string: + return True + if "$(" in string: + return True + return False + + +def has_expression(field: str | Sequence[str]) -> bool: + if is_sequence(field): + for entry in field: + if _has_expression(entry): + return True + return False + return _has_expression(field) + + def get_expression( - string: str, inputs: CWLObjectType, self: CWLOutputType | None + string: Any, inputs: CWLObjectType, self: CWLOutputType | None ) -> str | None: """ Find and return a normalized CWL expression, if any. @@ -136,6 +179,146 @@ def get_expression( return None +def _plain_input_schema_to_clt_input_schema( + input_type: BasicInputTypeSchemas, +) -> BasicCommandInputTypeSchemas: + match input_type: + case cwl.InputArraySchema(): + return cwl.CommandInputArraySchema.fromDoc( + input_type.save(), + input_type.loadingOptions.baseuri, + input_type.loadingOptions, + ) + case cwl.InputEnumSchema(): + return cwl.CommandInputEnumSchema.fromDoc( + input_type.save(), + input_type.loadingOptions.baseuri, + input_type.loadingOptions, + ) + case cwl.InputRecordSchema(): + return cwl.CommandInputRecordSchema.fromDoc( + input_type.save(), + input_type.loadingOptions.baseuri, + input_type.loadingOptions, + ) + case str(): + return input_type + raise WorkflowException(f"Unexpected ExpressionTool input type: {input_type}.") + + +def plain_input_schema_to_clt_input_schema( + input_type: InputTypeSchemas, +) -> CommandInputTypeSchemas: + if is_sequence(input_type): + return [ + _plain_input_schema_to_clt_input_schema(input_type_item) + for input_type_item in input_type + ] + return _plain_input_schema_to_clt_input_schema(input_type) + + +def _plain_input_schema_to_plain_output_schema( + input_type: BasicInputTypeSchemas, +) -> BasicOutputTypeSchemas: + match input_type: + case cwl.InputArraySchema(): + return cwl.OutputArraySchema.fromDoc( + input_type.save(), + input_type.loadingOptions.baseuri, + input_type.loadingOptions, + ) + case cwl.InputEnumSchema(): + return cwl.OutputEnumSchema.fromDoc( + input_type.save(), + input_type.loadingOptions.baseuri, + input_type.loadingOptions, + ) + case cwl.InputRecordSchema(): + return cwl.OutputRecordSchema.fromDoc( + input_type.save(), + input_type.loadingOptions.baseuri, + input_type.loadingOptions, + ) + case str(): + return input_type + raise WorkflowException(f"Unexpected ExpressionTool input type: {input_type}.") + + +def plain_input_schema_to_plain_output_schema( + input_type: InputTypeSchemas, +) -> OutputTypeSchemas: + if is_sequence(input_type): + return [ + _plain_input_schema_to_plain_output_schema(input_type_item) + for input_type_item in input_type + ] + return _plain_input_schema_to_plain_output_schema(input_type) + + +def _plain_output_type_to_clt_output_type( + output_type: BasicOutputTypeSchemas, +) -> BasicCommandOutputTypeSchemas: + match output_type: + case cwl.OutputArraySchema(): + return cwl.CommandOutputArraySchema.fromDoc( + output_type.save(), + output_type.loadingOptions.baseuri, + output_type.loadingOptions, + ) + case cwl.OutputEnumSchema(): + return cwl.CommandOutputEnumSchema.fromDoc( + output_type.save(), + output_type.loadingOptions.baseuri, + output_type.loadingOptions, + ) + case cwl.OutputRecordSchema(): + return cwl.CommandOutputRecordSchema.fromDoc( + output_type.save(), + output_type.loadingOptions.baseuri, + output_type.loadingOptions, + ) + case str(): + return output_type + raise WorkflowException(f"Unexpected ExpressionTool output type: {output_type}.") + + +def plain_output_type_to_clt_output_type( + output_type: OutputTypeSchemas, +) -> CommandOutputTypeSchemas: + if is_sequence(output_type): + return [ + _plain_output_type_to_clt_output_type(output_type_item) + for output_type_item in output_type + ] + return _plain_output_type_to_clt_output_type(output_type) + + +def parameter_to_workflow_input_paramater( + parameter: ( + cwl.WorkflowInputParameter + | cwl.CommandInputParameter + | cwl.CommandOutputParameter + | cwl.ExpressionToolOutputParameter + | cwl.WorkflowOutputParameter + ), +) -> cwl.WorkflowInputParameter: + return cwl.WorkflowInputParameter.fromDoc( + parameter.save(), parameter.loadingOptions.baseuri, parameter.loadingOptions + ) + + +def parameters_to_workflow_input_paramaters( + parameters: Sequence[ + cwl.WorkflowInputParameter + | cwl.CommandInputParameter + | cwl.CommandOutputParameter + ], +) -> Sequence[cwl.WorkflowInputParameter]: + return [ + parameter_to_workflow_input_paramater(parameter) for parameter in parameters + ] + + def etool_to_cltool( etool: cwl.ExpressionTool, expressionLib: list[str] | None = None ) -> cwl.CommandLineTool: @@ -151,7 +334,7 @@ def etool_to_cltool( doc=inp.doc, format=inp.format, default=inp.default, - type_=inp.type_, + type_=plain_input_schema_to_clt_input_schema(inp.type_), extension_fields=inp.extension_fields, loadingOptions=inp.loadingOptions, ) @@ -166,7 +349,7 @@ def etool_to_cltool( streamable=outp.streamable, doc=outp.doc, format=outp.format, - type_=outp.type_, + type_=plain_output_type_to_clt_output_type(outp.type_), extension_fields=outp.extension_fields, loadingOptions=outp.loadingOptions, ) @@ -329,50 +512,57 @@ def generate_etool_from_expr( | list[cwl.WorkflowInputParameter | cwl.CommandInputParameter] ) = None, # if the "self" input should be a different type than the "result" output extra_processes: None | ( - Sequence[cwl.Workflow | cwl.WorkflowStep | cwl.CommandLineTool] + Sequence[ + cwl.Workflow + | cwl.WorkflowStep + | cwl.CommandLineTool + | cwl.ExpressionTool + | cwl.ProcessGenerator + ] ) = None, ) -> cwl.ExpressionTool: """Convert a CWL Expression into an ExpressionTool.""" - inputs = yaml.comments.CommentedSeq() + inputs: list[cwl.WorkflowInputParameter] = [] if not no_inputs: - if not self_type: + if self_type is None: self_type = target - if isinstance(self_type, list): - new_type: ( - list[cwl.ArraySchema | cwl.InputRecordSchema] - | cwl.ArraySchema - | cwl.InputRecordSchema - ) = [clean_type_ids(t.type_) for t in self_type] + assert self_type is not None + new_type: InputTypeSchemas + if is_sequence(self_type): + new_type_list: MutableSequence[BasicInputTypeSchemas] = [] + for entry in self_type: + clean_type = clean_type_ids(entry.type_) + if is_sequence(clean_type): + new_type_list.extend(clean_type) + elif clean_type is None: + pass + else: + new_type_list.append(clean_type) + new_type = new_type_list else: new_type = clean_type_ids(self_type.type_) inputs.append( cwl.WorkflowInputParameter( id="self", - label=self_type.label if not isinstance(self_type, list) else None, + label=self_type.label if not is_sequence(self_type) else None, secondaryFiles=( - self_type.secondaryFiles - if not isinstance(self_type, list) - else None + self_type.secondaryFiles if not is_sequence(self_type) else None ), streamable=( - self_type.streamable if not isinstance(self_type, list) else None + self_type.streamable if not is_sequence(self_type) 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, + doc=self_type.doc if not is_sequence(self_type) else None, + format=(self_type.format if not is_sequence(self_type) else None), type_=new_type, extension_fields=( - self_type.extension_fields - if not isinstance(self_type, list) - else None + self_type.extension_fields if not is_sequence(self_type) else None ), loadingOptions=( - self_type.loadingOptions - if not isinstance(self_type, list) - else None + self_type.loadingOptions if not is_sequence(self_type) else None ), ) ) - outputs = yaml.comments.CommentedSeq() + outputs: list[cwl.ExpressionToolOutputParameter] = [] outputs.append( cwl.ExpressionToolOutputParameter( id="result", @@ -380,8 +570,8 @@ def generate_etool_from_expr( secondaryFiles=target.secondaryFiles, streamable=target.streamable, doc=target.doc, - format=target.format, - type_=target.type_, + format=target.format[0] if target.format else None, + type_=plain_input_schema_to_plain_output_schema(target.type_), extension_fields=target.extension_fields, loadingOptions=target.loadingOptions, ) @@ -410,18 +600,24 @@ def generate_etool_from_expr( def get_input_for_id( - name: str, tool: cwl.CommandLineTool | cwl.Workflow + name: str, + tool: ( + cwl.CommandLineTool | cwl.Workflow | cwl.ProcessGenerator | cwl.ExpressionTool + ), ) -> cwl.CommandInputParameter | None: """Determine the CommandInputParameter for the given input name.""" name = name.split("/")[-1] for inp in cast(list[cwl.CommandInputParameter], tool.inputs): if inp.id and inp.id.split("#")[-1].split("/")[-1] == name: - return inp + return cwl.CommandInputParameter.fromDoc( + inp.save(), inp.loadingOptions.baseuri, inp.loadingOptions + ) if isinstance(tool, cwl.Workflow) and "/" in name: stepname, stem = name.split("/", 1) for step in tool.steps: if step.id == stepname: + assert not isinstance(step.run, str) result = get_input_for_id(stem, step.run) if result: return result @@ -430,7 +626,11 @@ def get_input_for_id( def find_expressionLib( processes: Sequence[ - cwl.CommandLineTool | cwl.Workflow | cwl.ExpressionTool | cwl.WorkflowStep + cwl.CommandLineTool + | cwl.Workflow + | cwl.ExpressionTool + | cwl.WorkflowStep + | cwl.ProcessGenerator ], ) -> list[str] | None: """ @@ -455,23 +655,35 @@ def replace_expr_with_etool( source: str | list[Any] | None, replace_etool: bool = False, extra_process: None | ( - cwl.Workflow | cwl.WorkflowStep | cwl.CommandLineTool + cwl.Workflow + | cwl.WorkflowStep + | cwl.CommandLineTool + | cwl.ExpressionTool + | cwl.ProcessGenerator ) = None, source_type: cwl.CommandInputParameter | None = None, ) -> None: """Modify the given workflow, replacing the expr with an standalone ExpressionTool.""" - extra_processes: list[cwl.Workflow | cwl.WorkflowStep | cwl.CommandLineTool] = [ - workflow - ] + extra_processes: list[ + cwl.WorkflowStep + | cwl.Workflow + | cwl.CommandLineTool + | cwl.ExpressionTool + | cwl.ProcessGenerator + ] = [workflow] if extra_process: extra_processes.append(extra_process) etool: cwl.ExpressionTool = generate_etool_from_expr( expr, target, source is None, source_type, extra_processes ) if replace_etool: - processes: list[cwl.WorkflowStep | cwl.Workflow | cwl.CommandLineTool] = [ - workflow - ] + processes: list[ + cwl.WorkflowStep + | cwl.Workflow + | cwl.CommandLineTool + | cwl.ExpressionTool + | cwl.ProcessGenerator + ] = [workflow] if extra_process: processes.append(extra_process) final_tool: cwl.ExpressionTool | cwl.CommandLineTool = etool_to_cltool( @@ -482,14 +694,16 @@ def replace_expr_with_etool( inps = [] if source: inps.append(cwl.WorkflowStepInput(id="self", source=source)) - workflow.steps.append( + new_steps: list[cwl.WorkflowStep] = [ cwl.WorkflowStep( id=name, in_=inps, out=[cwl.WorkflowStepOutput("result")], run=final_tool, ) - ) + ] + new_steps.extend(workflow.steps) + workflow.steps = new_steps def replace_wf_input_ref_with_step_output( @@ -520,26 +734,33 @@ def replace_wf_input_ref_with_step_output( def empty_inputs( process_or_step: ( - cwl.CommandLineTool | cwl.WorkflowStep | cwl.ExpressionTool | cwl.Workflow + cwl.CommandLineTool + | cwl.WorkflowStep + | cwl.ExpressionTool + | cwl.Workflow + | cwl.ProcessGenerator ), parent: cwl.Workflow | None = None, ) -> dict[str, Any]: """Produce a mock input object for the given 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_) + for param1 in process_or_step.inputs: + result[param1.id.split("#")[-1]] = example_input(param1.type_) else: - for param in process_or_step.in_: - param_id = param.id.split("/")[-1] - if param.source is None and param.valueFrom: - result[param_id] = example_input("string") - elif param.source is None and param.default: - result[param_id] = param.default - else: + for param2 in process_or_step.in_: + param2_id = param2.id.split("/")[-1] + if param2.source is None and param2.valueFrom: + result[param2_id] = example_input("string") + elif param2.source is None and param2.default: + result[param2_id] = param2.default + elif param2.source is not None: with suppress(WorkflowException): - result[param_id] = example_input( - utils.type_for_source(process_or_step.run, param.source, parent) + assert not isinstance(process_or_step.run, str) + result[param2_id] = example_input( + utils.type_for_source( + process_or_step.run, param2.source, parent + ) ) return result @@ -616,18 +837,17 @@ def process_workflow_inputs_and_outputs( ) -> bool: """Do any needed conversions on the given Workflow's inputs and outputs.""" modified = False - inputs = empty_inputs(workflow) for index, param in enumerate(workflow.inputs): with SourceLine(workflow.inputs, index, WorkflowException): - if param.format and get_expression(param.format, inputs, None): + if param.format is not None and has_expression(param.format): raise SourceLine( param.loadingOptions.original_doc, "format", raise_type=WorkflowException, ).makeError(TOPLEVEL_FORMAT_EXPR_ERROR.format(param.id.split("#")[-1])) if param.secondaryFiles: - if hasattr(param.secondaryFiles, "pattern") and get_expression( - param.secondaryFiles.pattern, inputs, EMPTY_FILE + if hasattr(param.secondaryFiles, "pattern") and has_expression( + param.secondaryFiles.pattern ): raise SourceLine( param.loadingOptions.original_doc, @@ -636,7 +856,7 @@ def process_workflow_inputs_and_outputs( ).makeError(TOPLEVEL_SF_EXPR_ERROR.format(param.id.split("#")[-1])) elif isinstance(param.secondaryFiles, MutableSequence): for index2, entry in enumerate(param.secondaryFiles): - if get_expression(entry.pattern, inputs, EMPTY_FILE): + if has_expression(entry.pattern): raise SourceLine( param.loadingOptions.original_doc, index2, @@ -645,6 +865,7 @@ def process_workflow_inputs_and_outputs( f"Entry {index}," + TOPLEVEL_SF_EXPR_ERROR.format(param.id.split("#")[-1]) ) + return modified @@ -689,7 +910,7 @@ def process_workflow_reqs_and_hints( if expression: modified = True target = cwl.WorkflowInputParameter( - id=None, + id="", type_="string", ) etool_id = ( @@ -710,7 +931,9 @@ def process_workflow_reqs_and_hints( prop_reqs += (cwl.EnvVarRequirement,) newEnvDef = copy.deepcopy(envDef) newEnvDef.envValue = f"$(inputs._envDef{index})" - envVarReq.envDef[index] = newEnvDef + new_envDef = list(envVarReq.envDef) + new_envDef[index] = newEnvDef + envVarReq.envDef = new_envDef generated_envVar_reqs.append((etool_id, index)) case cwl.ResourceRequirement(): for attr in cwl.ResourceRequirement.attrs: @@ -719,9 +942,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="", type_="long") etool_id = "_expression_workflow_ResourceRequirement_{}".format( attr ) @@ -746,7 +967,7 @@ def process_workflow_reqs_and_hints( if expression: modified = True target = cwl.WorkflowInputParameter( - id=None, + id="", type_=cwl.InputArraySchema( ["File", "Directory"], "array", None, None ), @@ -767,18 +988,18 @@ def process_workflow_reqs_and_hints( prop_reqs += (cwl.InitialWorkDirRequirement,) else: iwdr = copy.deepcopy(req) - for index, entry in enumerate(req.listing): - expression = get_expression(entry, inputs, None) + for index1, entry1 in enumerate(req.listing): + expression = get_expression(entry1, inputs, None) if expression: modified = True target = cwl.WorkflowInputParameter( - id=None, + id="", type_=cwl.InputArraySchema( ["File", "Directory"], "array", None, None ), ) etool_id = "_expression_workflow_InitialWorkDirRequirement_{}".format( - index + index1 ) replace_expr_with_etool( expression, @@ -788,17 +1009,19 @@ def process_workflow_reqs_and_hints( None, replace_etool, ) - iwdr.listing[index] = f"$(inputs._iwdr_listing_{index}" - generated_iwdr_reqs.append((etool_id, index)) - elif isinstance(entry, cwl.Dirent): - if entry.entry: + new_listing = list(iwdr.listing) + new_listing[index1] = f"$(inputs._iwdr_listing_{index1}" + iwdr.listing = new_listing + generated_iwdr_reqs.append((etool_id, index1)) + elif isinstance(entry1, cwl.Dirent): + if entry1.entry: expression = get_expression( - entry.entry, inputs, None + entry1.entry, inputs, None ) if expression: expr: str = expression expr_result = do_eval( - ex=entry.entry, + ex=entry1.entry, jobinput=inputs, requirements=[], outdir="", @@ -808,7 +1031,7 @@ def process_workflow_reqs_and_hints( modified = True if is_file_or_directory(expr_result): target = cwl.WorkflowInputParameter( - id=None, + id="", type_=expr_result["class"], ) replace_expr_with_etool( @@ -819,38 +1042,38 @@ def process_workflow_reqs_and_hints( None, replace_etool, ) - iwdr.listing[index] = ( - "$(inputs._iwdr_listing_{}".format( - index - ) + new_listing = list(iwdr.listing) + new_listing[index1] = ( + f"$(inputs._iwdr_listing_{index1}" ) + iwdr.listing = new_listing generated_iwdr_reqs.append( - (etool_id, index) + (etool_id, index1) ) elif isinstance(expr_result, str): target = cwl.WorkflowInputParameter( - id=None, + id="", type_=["File"], ) - if entry.entryname is None: + if entry1.entryname is None: raise SourceLine( - entry.loadingOptions.original_doc, - index, + entry1.loadingOptions.original_doc, + index1, raise_type=WorkflowException, ).makeError( - f"Entry {index}," + f"Entry {index1}," + "Invalid CWL, if 'entry' " "is a string, then entryName must be specified." ) expr = ( '${return {"class": "File", "basename": "' - + entry.entryname + + entry1.entryname + '", "contents": (function(){' + expr[2:-1] + "})() }; }" ) etool_id = "_expression_workflow_InitialWorkDirRequirement_{}".format( - index + index1 ) replace_expr_with_etool( expr, @@ -860,24 +1083,24 @@ def process_workflow_reqs_and_hints( None, replace_etool, ) - iwdr.listing[index] = ( - f"$(inputs._iwdr_listing_{index}" + new_listing = list(iwdr.listing) + new_listing[index1] = ( + f"$(inputs._iwdr_listing_{index1}" ) - generated_iwdr_reqs.append((etool_id, index)) + iwdr.listing = new_listing + generated_iwdr_reqs.append((etool_id, index1)) - elif entry.entryname: + elif entry1.entryname: expression = get_expression( - entry.entryname, inputs, None + entry1.entryname, inputs, None ) if expression: modified = True target = cwl.WorkflowInputParameter( - id=None, + id="", type_="string", ) - etool_id = "_expression_workflow_InitialWorkDirRequirement_{}".format( - index - ) + etool_id = f"_expression_workflow_InitialWorkDirRequirement_{index1}" replace_expr_with_etool( expression, etool_id, @@ -886,10 +1109,12 @@ def process_workflow_reqs_and_hints( None, replace_etool, ) - iwdr.listing[index] = ( - f"$(inputs._iwdr_listing_{index}" + new_listing = list(iwdr.listing) + new_listing[index1] = ( + f"$(inputs._iwdr_listing_{index1}" ) - generated_iwdr_reqs.append((etool_id, index)) + iwdr.listing = new_listing + generated_iwdr_reqs.append((etool_id, index1)) if generated_iwdr_reqs: prop_reqs += (cwl.InitialWorkDirRequirement,) else: @@ -904,14 +1129,18 @@ def process_workflow_reqs_and_hints( continue else: step.requirements = yaml.comments.CommentedSeq() - step.requirements.append(envVarReq) - for entry in generated_envVar_reqs: - step.in_.append( + new_requirements = list(step.requirements) + new_requirements.append(envVarReq) + step.requirements = new_requirements + new_ins = list(step.in_) + for entry2 in generated_envVar_reqs: + new_ins.append( cwl.WorkflowStepInput( - id=f"_envDef{entry[1]}", - source=f"{entry[0]}/result", + id=f"_envDef{entry2[1]}", + source=f"{entry2[0]}/result", ) ) + step.in_ = new_ins if resourceReq and workflow.steps: for step in workflow.steps: @@ -922,15 +1151,19 @@ def process_workflow_reqs_and_hints( if isinstance(req, cwl.ResourceRequirement): continue else: - step.requirements = yaml.comments.CommentedSeq() - step.requirements.append(resourceReq) - for entry in generated_res_reqs: - step.in_.append( + step.requirements = [] + new_requirements = list(step.requirements) + new_requirements.append(resourceReq) + step.requirements = new_requirements + new_ins = list(step.in_) + for entry3 in generated_res_reqs: + new_ins.append( cwl.WorkflowStepInput( - id=f"_{entry[1]}", - source=f"{entry[0]}/result", + id=f"_{entry3[1]}", + source=f"{entry3[0]}/result", ) ) + step.in_ = new_ins if iwdr and workflow.steps: for step in workflow.steps: @@ -942,32 +1175,39 @@ def process_workflow_reqs_and_hints( continue else: step.requirements = yaml.comments.CommentedSeq() - step.requirements.append(iwdr) + new_requirements = list(step.requirements) + new_requirements.append(resourceReq) + new_requirements.append(iwdr) + step.requirements = new_requirements + new_ins = list(step.in_) if generated_iwdr_reqs: - for entry in generated_iwdr_reqs: - step.in_.append( + for entry4 in generated_iwdr_reqs: + new_ins.append( cwl.WorkflowStepInput( id=f"_iwdr_listing_{index}", - source=f"{entry[0]}/result", + source=f"{entry4[0]}/result", ) ) else: - step.in_.append( + new_ins.append( cwl.WorkflowStepInput( id="_iwdr_listing", source="_expression_workflow_InitialWorkDirRequirement/result", ) ) + step.in_ = new_ins if workflow.requirements: - workflow.requirements[:] = [ + workflow.requirements = [ x for x in workflow.requirements if not isinstance(x, prop_reqs) ] return modified def process_level_reqs( - process: cwl.CommandLineTool, + process: ( + cwl.CommandLineTool | cwl.ExpressionTool | cwl.ProcessGenerator | cwl.Workflow + ), step: cwl.WorkflowStep, parent: cwl.Workflow, replace_etool: bool, @@ -987,6 +1227,7 @@ def process_level_reqs( if not process.requirements: return False modified = False + assert not isinstance(step.run, str) target_process = step.run inputs = empty_inputs(process) generated_res_reqs: list[tuple[str, str]] = [] @@ -996,6 +1237,7 @@ def process_level_reqs( return False step_name = step.id.split("#", 1)[-1] for req_index, req in enumerate(process.requirements): + assert target_process.requirements is not None match req: case cwl.EnvVarRequirement() if req.envDef: for env_index, envDef in enumerate(req.envDef): @@ -1003,7 +1245,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="", type_="string") etool_id = "_expression_{}_EnvVarRequirement_{}".format( step_name, env_index ) @@ -1016,7 +1258,10 @@ def process_level_reqs( replace_etool, process, ) - target_process.requirements[req_index][ + cast( + cwl.EnvVarRequirement, + target_process.requirements[req_index], + ).envDef[ env_index ].envValue = f"$(inputs._envDef{env_index})" generated_envVar_reqs.append((etool_id, env_index)) @@ -1027,11 +1272,11 @@ 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="", type_="long") etool_id = "_expression_{}_ResourceRequirement_{}".format( step_name, attr ) - replace_clt_hintreq_expr_with_etool( + replace_step_process_hintreq_expr_with_etool( expression, etool_id, parent, @@ -1056,7 +1301,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="", type_=target_type) etool_id = "_expression_{}_InitialWorkDirRequirement".format( step_name ) @@ -1069,15 +1314,18 @@ def process_level_reqs( replace_etool, process, ) - target_process.requirements[req_index].listing = ( - "$(inputs._iwdr_listing)", - ) - step.in_.append( + cast( + cwl.InitialWorkDirRequirement, + target_process.requirements[req_index], + ).listing = ("$(inputs._iwdr_listing)",) + new_step_ins = list(step.in_) + new_step_ins.append( cwl.WorkflowStepInput( id="_iwdr_listing", source=f"{etool_id}/result", ) ) + step.in_ = new_step_ins add_input_to_process( target_process, "_iwdr_listing", @@ -1085,15 +1333,15 @@ def process_level_reqs( process.loadingOptions, ) else: - for listing_index, entry in enumerate(req.listing): - expression = get_expression(entry, inputs, None) + for listing_index, entry5 in enumerate(req.listing): + expression = get_expression(entry5, inputs, None) if expression: modified = True target_type = cwl.InputArraySchema( ["File", "Directory"], "array", None, None ) target = cwl.WorkflowInputParameter( - id=None, + id="", type_=target_type, ) etool_id = ( @@ -1110,31 +1358,41 @@ def process_level_reqs( replace_etool, process, ) - target_process.requirements[req_index].listing[ - listing_index - ] = f"$(inputs._iwdr_listing_{listing_index}" + new_iwdr_listing = list( + cast( + cwl.InitialWorkDirRequirement, + target_process.requirements[req_index], + ).listing + ) + new_iwdr_listing[listing_index] = ( + f"$(inputs._iwdr_listing_{listing_index}" + ) + cast( + cwl.InitialWorkDirRequirement, + target_process.requirements[req_index], + ).listing = new_iwdr_listing generated_iwdr_reqs.append( (etool_id, listing_index, target_type) ) - elif isinstance(entry, cwl.Dirent): - if entry.entry: - expression = get_expression(entry.entry, inputs, None) + elif isinstance(entry5, cwl.Dirent): + if entry5.entry: + expression = get_expression(entry5.entry, inputs, None) if expression: modified = True - if entry.entryname is not None: + if entry5.entryname is not None: entryname_expr = get_expression( - entry.entryname, inputs, None + entry5.entryname, inputs, None ) entryname = ( - entry.entryname + entry5.entryname if entryname_expr - else f'"{entry.entryname}"' # noqa: B907 + else f'"{entry5.entryname}"' # noqa: B907 ) new_expression = ( "${var result; var entryname = " + entryname + "; var entry = " - + entry.entry[2:-1] + + entry5.entry[2:-1] + """; if (typeof entry === 'string' || entry instanceof String) { result = {"class": "File", "basename": entryname, "contents": entry} ; @@ -1150,14 +1408,14 @@ def process_level_reqs( new_expression = expression d_target_type = ["File", "Directory"] target = cwl.WorkflowInputParameter( - id=None, + id="", type_=d_target_type, ) etool_id = "_expression_{}_InitialWorkDirRequirement_{}".format( step_name, listing_index ) - replace_clt_hintreq_expr_with_etool( + replace_step_process_hintreq_expr_with_etool( new_expression, etool_id, parent, @@ -1165,22 +1423,26 @@ def process_level_reqs( step, replace_etool, ) - target_process.requirements[req_index].listing[ - listing_index - ].entry = "$(inputs._iwdr_listing_{})".format( + cast( + cwl.Dirent, + cast( + cwl.InitialWorkDirRequirement, + target_process.requirements[req_index], + ).listing[listing_index], + ).entry = "$(inputs._iwdr_listing_{})".format( listing_index ) generated_iwdr_reqs.append( (etool_id, listing_index, d_target_type) ) - elif entry.entryname: + elif entry5.entryname: expression = get_expression( - entry.entryname, inputs, None + entry5.entryname, inputs, None ) if expression: modified = True target = cwl.WorkflowInputParameter( - id=None, + id="", type_="string", ) etool_id = "_expression_{}_InitialWorkDirRequirement_{}".format( @@ -1195,26 +1457,40 @@ def process_level_reqs( replace_etool, process, ) - target_process.requirements[req_index].listing[ - listing_index - ].entryname = "$(inputs._iwdr_listing_{})".format( + cast( + cwl.Dirent, + cast( + cwl.InitialWorkDirRequirement, + target_process.requirements[req_index], + ).listing[listing_index], + ).entryname = "$(inputs._iwdr_listing_{})".format( listing_index ) generated_iwdr_reqs.append( (etool_id, listing_index, "string") ) - for entry in generated_envVar_reqs: - name = f"_envDef{entry[1]}" - step.in_.append(cwl.WorkflowStepInput(id=name, source=f"{entry[0]}/result")) + new_step_ins = list(step.in_) + for env_entry in generated_envVar_reqs: + name = f"_envDef{env_entry[1]}" + new_step_ins.append( + cwl.WorkflowStepInput(id=name, source=f"{env_entry[0]}/result") + ) add_input_to_process(target_process, name, "string", process.loadingOptions) - for entry in generated_res_reqs: - name = f"_{entry[1]}" - step.in_.append(cwl.WorkflowStepInput(id=name, source=f"{entry[0]}/result")) + for res_entry in generated_res_reqs: + name = f"_{res_entry[1]}" + new_step_ins.append( + cwl.WorkflowStepInput(id=name, source=f"{res_entry[0]}/result") + ) add_input_to_process(target_process, name, "long", process.loadingOptions) - for entry in generated_iwdr_reqs: - name = f"_iwdr_listing_{entry[1]}" - step.in_.append(cwl.WorkflowStepInput(id=name, source=f"{entry[0]}/result")) - add_input_to_process(target_process, name, entry[2], process.loadingOptions) + for iwdr_entry in generated_iwdr_reqs: + name = f"_iwdr_listing_{iwdr_entry[1]}" + new_step_ins.append( + cwl.WorkflowStepInput(id=name, source=f"{iwdr_entry[0]}/result") + ) + add_input_to_process( + target_process, name, iwdr_entry[2], process.loadingOptions + ) + step.in_ = new_step_ins return modified @@ -1223,13 +1499,15 @@ def add_input_to_process( ) -> None: """Add a new InputParameter to the given CommandLineTool.""" if isinstance(process, cwl.CommandLineTool): - process.inputs.append( + new_process_inputs = list(process.inputs) + new_process_inputs.append( cwl.CommandInputParameter( id=name, type_=inptype, loadingOptions=loadingOptions, ) ) + process.inputs = new_process_inputs def traverse_CommandLineTool( @@ -1243,7 +1521,7 @@ def traverse_CommandLineTool( """Extract any CWL Expressions within the given CommandLineTool into sibling steps.""" modified = False # don't modify clt, modify step.run - target_clt = step.run + target_clt = cast(cwl.CommandLineTool, step.run) inputs = empty_inputs(clt) if not step.id: return False @@ -1257,24 +1535,28 @@ 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="", type_=target_type) replace_step_clt_expr_with_etool( expression, etool_id, parent, target, step, replace_etool ) - target_clt.arguments[index] = cwl.CommandLineBinding( + new_target_clt_arguments = list(target_clt.arguments or []) + new_target_clt_arguments[index] = cwl.CommandLineBinding( valueFrom=f"$(inputs.{inp_id})" ) - target_clt.inputs.append( + target_clt.arguments = new_target_clt_arguments + new_target_clt_inputs = list(target_clt.inputs) + new_target_clt_inputs.append( cwl.CommandInputParameter( id=inp_id, type_=target_type, ) ) - step.in_.append( - cwl.WorkflowStepInput( - f"{etool_id}/result", None, inp_id, None, None - ) + target_clt.inputs = new_target_clt_inputs + new_step_ins = list(step.in_) + new_step_ins.append( + cwl.WorkflowStepInput(id=f"{etool_id}/result", source=inp_id) ) + step.in_ = new_step_ins remove_JSReq(target_clt, skip_command_line1) elif isinstance(arg, cwl.CommandLineBinding) and arg.valueFrom: expression = get_expression(arg.valueFrom, inputs, None) @@ -1283,22 +1565,28 @@ 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="", type_=target_type) replace_step_clt_expr_with_etool( expression, etool_id, parent, target, step, replace_etool ) - target_clt.arguments[index].valueFrom = "$(inputs.{})".format( - inp_id + new_target_clt_arguments = list(target_clt.arguments or []) + new_target_clt_arguments[index] = cwl.CommandLineBinding( + valueFrom="$(inputs.{})".format(inp_id) ) - target_clt.inputs.append( + target_clt.arguments = new_target_clt_arguments + new_target_clt_inputs = list(target_clt.inputs) + new_target_clt_inputs.append( cwl.CommandInputParameter( id=inp_id, type_=target_type, ) ) - step.in_.append( + target_clt.inputs = new_target_clt_inputs + new_step_ins = list(step.in_) + new_step_ins.append( cwl.WorkflowStepInput(id=inp_id, source=f"{etool_id}/result") ) + step.in_ = new_step_ins remove_JSReq(target_clt, skip_command_line1) for streamtype in "stdout", "stderr": # add 'stdin' for v1.1 version stream_value = getattr(clt, streamtype) @@ -1309,17 +1597,21 @@ 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="", 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( + new_target_clt_inputs = list(target_clt.inputs) + new_target_clt_inputs.append( cwl.CommandInputParameter(id=inp_id, type_=target_type) ) - step.in_.append( + target_clt.inputs = new_target_clt_inputs + new_step_ins = list(step.in_) + new_step_ins.append( cwl.WorkflowStepInput(id=inp_id, source=f"{etool_id}/result") ) + step.in_ = new_step_ins for inp in clt.inputs: if not skip_command_line1 and inp.inputBinding and inp.inputBinding.valueFrom: expression = get_expression( @@ -1334,12 +1626,19 @@ def traverse_CommandLineTool( expression, etool_id, parent, inp, step, replace_etool, self_id ) inp.inputBinding.valueFrom = f"$(inputs.{inp_id})" - target_clt.inputs.append( - cwl.CommandInputParameter(id=inp_id, type_=inp.type_) + new_target_clt_inputs = list(target_clt.inputs) + new_target_clt_inputs.append( + cwl.CommandInputParameter( + id=inp_id, + type_=plain_input_schema_to_clt_input_schema(inp.type_), + ) ) - step.in_.append( + target_clt.inputs = new_target_clt_inputs + new_step_ins = list(step.in_) + new_step_ins.append( cwl.WorkflowStepInput(id=inp_id, source=f"{etool_id}/result") ) + step.in_ = new_step_ins for outp in clt.outputs: if outp.outputBinding: if outp.outputBinding.glob: @@ -1348,21 +1647,28 @@ def traverse_CommandLineTool( modified = True 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) + glob_target_type: CommandInputTypeSchemas = [ + "string", + cwl.CommandInputArraySchema("string", "array"), + ] + target = cwl.WorkflowInputParameter(id="", type_=glob_target_type) replace_step_clt_expr_with_etool( expression, etool_id, parent, target, step, replace_etool ) outp.outputBinding.glob = f"$(inputs.{inp_id})" - target_clt.inputs.append( + new_target_clt_inputs = list(target_clt.inputs) + new_target_clt_inputs.append( cwl.CommandInputParameter( id=inp_id, type_=glob_target_type, ) ) - step.in_.append( + target_clt.inputs = new_target_clt_inputs + new_step_ins = list(step.in_) + new_step_ins.append( cwl.WorkflowStepInput(id=inp_id, source=f"{etool_id}/result") ) + step.in_ = new_step_ins if outp.outputBinding.outputEval and not skip_command_line2: self: CWLOutputType = [ { @@ -1386,34 +1692,45 @@ def traverse_CommandLineTool( step, etool_id, outp_id ) self_type = cwl.WorkflowInputParameter( - id=None, + id="", type_=cwl.InputArraySchema("File", "array", None, None), ) + if isinstance(outp, cwl.CommandOutputParameter): + target = parameter_to_workflow_input_paramater(outp) + else: + target = outp etool = generate_etool_from_expr( - expression, outp, False, self_type, [clt, step, parent] + expression, target, False, self_type, [clt, step, parent] ) if outp.outputBinding.loadContents: - etool.inputs[0].type_.inputBinding = cwl.CommandLineBinding( + etool.inputs[0].inputBinding = cwl.CommandLineBinding( loadContents=True ) - etool.inputs.extend(cltool_inputs_to_etool_inputs(clt)) - sub_wf_inputs = cltool_inputs_to_etool_inputs(clt) + etool.inputs = list(etool.inputs) + process_inputs_to_etool_inputs( + clt + ) + sub_wf_inputs = process_inputs_to_etool_inputs(clt) orig_step_inputs = copy.deepcopy(step.in_) for orig_step_input in orig_step_inputs: - orig_step_input.id = orig_step_input.id.split("/")[-1] - if isinstance(orig_step_input.source, MutableSequence): + if is_sequence(orig_step_input.source): + new_orig_step_input_source = list(orig_step_input.source) for index, source in enumerate(orig_step_input.source): - orig_step_input.source[index] = source.split("#")[-1] + new_orig_step_input_source[index] = source.split("#")[ + -1 + ] + orig_step_input.source = new_orig_step_input_source + elif orig_step_input.source is None: + continue else: orig_step_input.source = orig_step_input.source.split("#")[ -1 ] - orig_step_inputs[:] = [ + orig_step_inputs = [ x for x in orig_step_inputs if not x.id.startswith("_") ] - for inp in orig_step_inputs: - inp.source = inp.id - inp.linkMerge = None + for wsi in orig_step_inputs: + wsi.source = wsi.id + wsi.linkMerge = None if replace_etool: processes = [parent] final_etool: cwl.CommandLineTool | cwl.ExpressionTool = ( @@ -1432,8 +1749,8 @@ def traverse_CommandLineTool( step ) # a deepcopy would be convenient, but params2.cwl gives it problems new_clt_step.id = new_clt_step.id.split("#")[-1] - new_clt_step.run = copy.copy(step.run) - new_clt_step.run.id = None + new_clt_step.run = copy.copy(target_clt) + new_clt_step.run.id = "" remove_JSReq(new_clt_step.run, skip_command_line1) for new_outp in new_clt_step.run.outputs: if new_outp.id.split("#")[-1] == outp_id: @@ -1461,12 +1778,17 @@ def traverse_CommandLineTool( type(new_outp), ) new_clt_step.in_ = copy.deepcopy(step.in_) - for inp in new_clt_step.in_: - inp.id = inp.id.split("/")[-1] - inp.source = inp.id - inp.linkMerge = None - for index, out in enumerate(new_clt_step.out): - new_clt_step.out[index] = out.split("/")[-1] + for wsi2 in new_clt_step.in_: + wsi2.id = wsi2.id.split("/")[-1] + wsi2.source = wsi2.id + wsi2.linkMerge = None + new_clt_step_out = list(new_clt_step.out) + for index, out in enumerate(new_clt_step_out): + if isinstance(out, str): + new_clt_step_out[index] = out.split("/")[-1] + else: + out.id = out.id.split("/")[-1] + new_clt_step.out = new_clt_step_out for tool_inp in new_clt_step.run.inputs: tool_inp.id = tool_inp.id.split("#")[-1] for tool_out in new_clt_step.run.outputs: @@ -1497,24 +1819,33 @@ def traverse_CommandLineTool( if isinstance(req, cwl.SubworkflowFeatureRequirement): has_sub_wf_req = True if not has_sub_wf_req: - parent.requirements.append( - cwl.SubworkflowFeatureRequirement() - ) + new_parent_reqs = list(parent.requirements) + new_parent_reqs.append(cwl.SubworkflowFeatureRequirement()) + parent.requirements = new_parent_reqs return modified def rename_step_source(workflow: cwl.Workflow, old: str, new: str) -> None: """Update step source names to the new name.""" - def simplify_wf_id(uri: str) -> str: - return uri.split("#")[-1].split("/", 1)[1] + def simplify_wf_ids(uris: Sequence[str] | str | None) -> set[str]: + if isinstance(uris, str): + uri_seq: Sequence[str] = [uris] + elif uris is None: + return set() + else: + uri_seq = uris + return {uri.split("#")[-1].split("/", 1)[1] for uri in uri_seq} def simplify_step_id(uri: str) -> str: return uri.split("#")[-1] for wf_outp in workflow.outputs: - if wf_outp.outputSource and simplify_wf_id(wf_outp.outputSource) == old: - wf_outp.outputSource = new + simplified_wf_ids = simplify_wf_ids(wf_outp.outputSource) + if wf_outp.outputSource and old in simplified_wf_ids: + simplified_wf_ids.remove(old) + simplified_wf_ids.add(new) + wf_outp.outputSource = list(simplified_wf_ids) for step in workflow.steps: if step.in_: for inp in step.in_: @@ -1530,7 +1861,9 @@ def simplify_step_id(uri: str) -> str: else: for index, source in enumerate(inp.source): if simplify_step_id(source) == old: - inp.source[index] = new + new_inp_source = list(inp.source) + new_inp_source[index] = new + inp.source = new_inp_source def remove_JSReq( @@ -1541,7 +1874,7 @@ def remove_JSReq( if skip_command_line1 and isinstance(process, cwl.CommandLineTool): return if process.hints: - process.hints[:] = [ + process.hints = [ hint for hint in process.hints if not isinstance(hint, cwl.InlineJavascriptRequirement) @@ -1549,7 +1882,7 @@ def remove_JSReq( if not process.hints: process.hints = None if process.requirements: - process.requirements[:] = [ + process.requirements = [ req for req in process.requirements if not isinstance(req, cwl.InlineJavascriptRequirement) @@ -1562,13 +1895,14 @@ def replace_step_clt_expr_with_etool( expr: str, name: str, workflow: cwl.Workflow, - target: cwl.WorkflowInputParameter, + target: cwl.CommandInputParameter | cwl.WorkflowInputParameter, step: cwl.WorkflowStep, replace_etool: bool, self_name: str | None = None, ) -> None: """Convert a step level CWL Expression to a sibling expression step.""" - etool_inputs = cltool_inputs_to_etool_inputs(step.run) + assert not isinstance(step.run, str) + etool_inputs = process_inputs_to_etool_inputs(step.run) temp_etool = generate_etool_from_expr2( expr, target, etool_inputs, self_name, step.run, [workflow] ) @@ -1582,8 +1916,9 @@ def replace_step_clt_expr_with_etool( wf_step_inputs = copy.deepcopy(step.in_) for wf_step_input in wf_step_inputs: wf_step_input.id = wf_step_input.id.split("/")[-1] - wf_step_inputs[:] = [x for x in wf_step_inputs if not x.id.startswith("_")] - workflow.steps.append( + wf_step_inputs = [x for x in wf_step_inputs if not x.id.startswith("_")] + new_steps = list(workflow.steps) + new_steps.append( cwl.WorkflowStep( id=name, in_=wf_step_inputs, @@ -1591,9 +1926,10 @@ def replace_step_clt_expr_with_etool( run=etool, ) ) + workflow.steps = new_steps -def replace_clt_hintreq_expr_with_etool( +def replace_step_process_hintreq_expr_with_etool( expr: str, name: str, workflow: cwl.Workflow, @@ -1604,7 +1940,8 @@ def replace_clt_hintreq_expr_with_etool( ) -> cwl.CommandLineTool | cwl.ExpressionTool: """Factor out an expression inside a CommandLineTool req or hint into a sibling step.""" # Same as replace_step_clt_expr_with_etool or different? - etool_inputs = cltool_inputs_to_etool_inputs(step.run) + assert not isinstance(step.run, str) + etool_inputs = process_inputs_to_etool_inputs(step.run) temp_etool = generate_etool_from_expr2( expr, target, etool_inputs, self_name, step.run, [workflow] ) @@ -1618,8 +1955,9 @@ def replace_clt_hintreq_expr_with_etool( wf_step_inputs = copy.deepcopy(step.in_) for wf_step_input in wf_step_inputs: wf_step_input.id = wf_step_input.id.split("/")[-1] - wf_step_inputs[:] = [x for x in wf_step_inputs if not x.id.startswith("_")] - workflow.steps.append( + wf_step_inputs = [x for x in wf_step_inputs if not x.id.startswith("_")] + new_steps = list(workflow.steps) + new_steps.append( cwl.WorkflowStep( id=name, in_=wf_step_inputs, @@ -1627,30 +1965,33 @@ def replace_clt_hintreq_expr_with_etool( run=etool, ) ) + workflow.steps = new_steps return etool -def cltool_inputs_to_etool_inputs( - tool: cwl.CommandLineTool, +def process_inputs_to_etool_inputs( + tool: ( + cwl.CommandLineTool | cwl.ExpressionTool | cwl.ProcessGenerator | cwl.Workflow + ), ) -> list[cwl.WorkflowInputParameter]: - """Copy CommandLineTool input objects into the equivalent ExpressionTool input objects.""" - inputs = yaml.comments.CommentedSeq() + """Copy Process input parameters to matching ExpressionTool versions.""" + inputs = [] if tool.inputs: - for clt_inp in tool.inputs: - clt_inp_id = clt_inp.id.split("#")[-1].split("/")[-1] - if not clt_inp_id.startswith("_"): + for process_inp in tool.inputs: + process_inp_id = process_inp.id.split("#")[-1].split("/")[-1] + if not process_inp_id.startswith("_"): inputs.append( cwl.WorkflowInputParameter( - id=clt_inp_id, - label=clt_inp.label, - secondaryFiles=clt_inp.secondaryFiles, - streamable=clt_inp.streamable, - doc=clt_inp.doc, - format=clt_inp.format, - default=clt_inp.default, - type_=clt_inp.type_, - extension_fields=clt_inp.extension_fields, - loadingOptions=clt_inp.loadingOptions, + id=process_inp_id, + label=process_inp.label, + secondaryFiles=process_inp.secondaryFiles, + streamable=process_inp.streamable, + doc=process_inp.doc, + format=process_inp.format, + default=process_inp.default, + type_=process_inp.type_, + extension_fields=process_inp.extension_fields, + loadingOptions=process_inp.loadingOptions, ) ) return inputs @@ -1658,17 +1999,18 @@ def cltool_inputs_to_etool_inputs( def cltool_step_outputs_to_workflow_outputs( cltool_step: cwl.WorkflowStep, etool_step_id: str, etool_out_id: str -) -> list[cwl.OutputParameter]: +) -> list[cwl.WorkflowOutputParameter]: """ Copy CommandLineTool outputs into the equivalent Workflow output parameters. Connects the outputSources for each of the new output parameters to the step they came from. """ - outputs = yaml.comments.CommentedSeq() + outputs: list[cwl.WorkflowOutputParameter] = [] if not cltool_step.id: raise WorkflowException(f"Missing step id from {cltool_step}.") default_step_id = cltool_step.id.split("#")[-1] + assert not isinstance(cltool_step.run, str) if cltool_step.run.outputs: for clt_out in cltool_step.run.outputs: clt_out_id = clt_out.id.split("#")[-1].split("/")[-1] @@ -1696,14 +2038,20 @@ def cltool_step_outputs_to_workflow_outputs( def generate_etool_from_expr2( expr: str, - target: cwl.CommandInputParameter | cwl.WorkflowInputParameter, + target: cwl.WorkflowInputParameter | cwl.CommandInputParameter, inputs: Sequence[ cwl.WorkflowInputParameter | cwl.CommandInputParameter | cwl.CommandOutputParameter ], self_name: str | None = None, - process: cwl.CommandLineTool | cwl.ExpressionTool | None = None, + process: ( + cwl.CommandLineTool + | cwl.ExpressionTool + | cwl.Workflow + | cwl.ProcessGenerator + | None + ) = None, extra_processes: None | ( Sequence[cwl.Workflow | cwl.WorkflowStep | cwl.CommandLineTool] ) = None, @@ -1717,8 +2065,8 @@ def generate_etool_from_expr2( secondaryFiles=target.secondaryFiles, streamable=target.streamable, doc=target.doc, - format=target.format, - type_=target.type_, + format=target.format[0] if target.format else None, + type_=plain_input_schema_to_plain_output_schema(target.type_), ) ) expression = "${" @@ -1733,19 +2081,47 @@ def generate_etool_from_expr2( ) hints = None procs: list[ - cwl.CommandLineTool | cwl.ExpressionTool | cwl.Workflow | cwl.WorkflowStep + cwl.CommandLineTool + | cwl.ExpressionTool + | cwl.Workflow + | cwl.WorkflowStep + | cwl.ProcessGenerator ] = [] if process: procs.append(process) if extra_processes: procs.extend(extra_processes) inlineJSReq = cwl.InlineJavascriptRequirement(find_expressionLib(procs)) - reqs = [inlineJSReq] + reqs: MutableSequence[ + cwl.CUDARequirement + | cwl.DockerRequirement + | cwl.EnvVarRequirement + | cwl.InitialWorkDirRequirement + | cwl.InlineJavascriptRequirement + | cwl.InplaceUpdateRequirement + | cwl.LoadListingRequirement + | cwl.MPIRequirement + | cwl.MultipleInputFeatureRequirement + | cwl.NetworkAccess + | cwl.ResourceRequirement + | cwl.ScatterFeatureRequirement + | cwl.SchemaDefRequirement + | cwl.Secrets + | cwl.ShellCommandRequirement + | cwl.ShmSize + | cwl.SoftwareRequirement + | cwl.StepInputExpressionRequirement + | cwl.SubworkflowFeatureRequirement + | cwl.ToolTimeLimit + | cwl.WorkReuse + ] = [inlineJSReq] if process: if process.hints: hints = copy.deepcopy(process.hints) - hints[:] = [ - x for x in hints if not isinstance(x, cwl.InitialWorkDirRequirement) + hints = [ + x + for x in copy.deepcopy(hints) + if not isinstance(x, cwl.InitialWorkDirRequirement) ] if process.requirements: reqs.extend(copy.deepcopy(process.requirements)) @@ -1754,7 +2130,7 @@ def generate_etool_from_expr2( ] return cwl.ExpressionTool( id="_:" + str(uuid.uuid4()), - inputs=inputs, + inputs=parameters_to_workflow_input_paramaters(inputs), outputs=outputs, expression=expression, requirements=reqs, @@ -1776,43 +2152,29 @@ def traverse_step( return False step_id = step.id.split("#")[-1] original_process = copy.deepcopy(step.run) + assert not isinstance(original_process, str) + assert not isinstance(step.run, str) original_step_ins = copy.deepcopy(step.in_) for inp in step.in_: if inp.valueFrom: if not inp.source: self = None else: - if isinstance(inp.source, MutableSequence): - self = [] - for source in inp.source: - if not step.scatter: - self.append( - example_input( - utils.type_for_source(parent, source.split("#")[-1]) - ) - ) - else: - scattered_source_type = utils.type_for_source( - parent, source - ) - if isinstance(scattered_source_type, list): - for stype in scattered_source_type: - self.append(example_input(stype.type_)) - else: - self.append(example_input(scattered_source_type.type_)) - else: + self = [] + for source in inp.source: if not step.scatter: - self = example_input( - utils.type_for_source(parent, inp.source.split("#")[-1]) + self.append( + example_input( + utils.type_for_source(parent, source.split("#")[-1]) + ) ) else: - scattered_source_type2 = utils.type_for_source( - parent, inp.source - ) - if isinstance(scattered_source_type2, list): - self = example_input(scattered_source_type2[0].type_) + scattered_source_type = utils.type_for_source(parent, source) + if is_sequence(scattered_source_type): + for stype in scattered_source_type: + self.append(example_input(stype.type_)) else: - self = example_input(scattered_source_type2.type_) + self.append(example_input(scattered_source_type.type_)) expression = get_expression(inp.valueFrom, inputs, self) if expression: modified = True @@ -1821,42 +2183,32 @@ def traverse_step( if not target: raise WorkflowException("target not found") input_source_id = None - source_type: None | ( - MutableSequence[ - cwl.CommandInputParameter - | cwl.CommandOutputParameter - | cwl.WorkflowInputParameter + source_type: ( + None + | MutableSequence[ + cwl.WorkflowInputParameter | cwl.CommandOutputParameter ] - | cwl.CommandInputParameter - | cwl.CommandOutputParameter | cwl.WorkflowInputParameter + | cwl.CommandOutputParameter ) = None if inp.source: - if isinstance(inp.source, MutableSequence): - input_source_id = [] - source_types: list[cwl.WorkflowInputParameter] = [] - for source in inp.source: - source_id = source.split("#")[-1] - input_source_id.append(source_id) - temp_type = utils.type_for_source( - step.run, source_id, parent - ) - if isinstance(temp_type, list): - for ttype in temp_type: - if ttype not in source_types: - source_types.append(ttype) - else: - if temp_type not in source_types: - source_types.append(temp_type) - source_type = cwl.WorkflowInputParameter( - id=None, - type_=cwl.ArraySchema(source_types, "array"), - ) - else: - input_source_id = inp.source.split("#")[-1] - source_type = utils.param_for_source_id( - step.run, input_source_id, parent - ) + input_source_id = [] + source_types: list[BasicInputTypeSchemas] = [] + for source in inp.source: + source_id = source.split("#")[-1] + input_source_id.append(source_id) + temp_type = utils.type_for_source(step.run, source_id, parent) + if is_sequence(temp_type): + for ttype in temp_type: + if ttype not in source_types: + source_types.append(ttype) + else: + if temp_type not in source_types: + source_types.append(temp_type) + source_type = cwl.WorkflowInputParameter( + id="", + type_=cwl.InputArraySchema(source_types, "array"), + ) # target.id = target.id.split('#')[-1] if isinstance(original_process, cwl.ExpressionTool): found_JSReq = False @@ -1872,9 +2224,11 @@ def traverse_step( if not step.run.requirements: step.run.requirements = [] expr_lib = find_expressionLib([parent]) - step.run.requirements.append( + new_step_run_requirements = list(step.run.requirements) + new_step_run_requirements.append( cwl.InlineJavascriptRequirement(expr_lib) ) + step.run.requirements = new_step_run_requirements replace_step_valueFrom_expr_with_etool( expression, etool_id, @@ -1891,6 +2245,7 @@ def traverse_step( inp.valueFrom = None inp.source = f"{etool_id}/result" # TODO: skip or special process for sub workflows? + assert not isinstance(original_process, str) process_modified = process_level_reqs( original_process, step, @@ -1916,29 +2271,35 @@ def traverse_step( def workflow_step_to_WorkflowInputParameters( - step_ins: list[cwl.WorkflowStepInput], parent: cwl.Workflow, except_in_id: str -) -> MutableSequence[ - cwl.CommandInputParameter | cwl.CommandOutputParameter | cwl.WorkflowInputParameter -]: + step_ins: Sequence[cwl.WorkflowStepInput], parent: cwl.Workflow, except_in_id: str +) -> list[cwl.WorkflowInputParameter]: """Create WorkflowInputParameters to match the given WorkflowStep inputs.""" - params = [] + params: list[cwl.WorkflowInputParameter] = [] for inp in step_ins: - if not inp.id: - continue inp_id = inp.id.split("#")[-1].split("/")[-1] if inp.source and inp_id != except_in_id: param = copy.deepcopy( utils.param_for_source_id(parent, sourcenames=inp.source) ) - if isinstance(param, MutableSequence): + if is_sequence(param): for p in param: - p.id = inp_id - p.type_ = clean_type_ids(p.type_) - params.append(p) + if not p.type_: + raise WorkflowException( + f"Don't know how to get type id for {p!r}." + ) + new_param = parameter_to_workflow_input_paramater(p) + new_param.id = inp_id + new_param.type_ = clean_type_ids(new_param.type_) + params.append(new_param) else: - param.id = inp_id - param.type_ = clean_type_ids(param.type_) - params.append(param) + if not param.type_: + raise WorkflowException( + f"Don't know how to get type id for {param!r}." + ) + new_param = parameter_to_workflow_input_paramater(param) + new_param.id = inp_id + new_param.type_ = clean_type_ids(new_param.type_) + params.append(new_param) return params @@ -1949,15 +2310,17 @@ def replace_step_valueFrom_expr_with_etool( target: cwl.CommandInputParameter | cwl.WorkflowInputParameter, step: cwl.WorkflowStep, step_inp: cwl.WorkflowStepInput, - original_process: cwl.CommandLineTool | cwl.ExpressionTool, - original_step_ins: list[cwl.WorkflowStepInput], + original_process: ( + cwl.CommandLineTool | cwl.ExpressionTool | cwl.ProcessGenerator | cwl.Workflow + ), + original_step_ins: Sequence[cwl.WorkflowStepInput], source: str | list[str] | None, replace_etool: bool, source_type: None | ( cwl.CommandInputParameter | cwl.CommandOutputParameter | cwl.WorkflowInputParameter - | MutableSequence[ + | Sequence[ cwl.CommandInputParameter | cwl.CommandOutputParameter | cwl.WorkflowInputParameter @@ -1994,22 +2357,19 @@ def replace_step_valueFrom_expr_with_etool( etool: cwl.ExpressionTool | cwl.CommandLineTool = cltool else: etool = temp_etool - wf_step_inputs = copy.deepcopy(original_step_ins) + wf_step_inputs = list(original_step_ins) if source: wf_step_inputs.append(cwl.WorkflowStepInput(id="self", source=step_inp.source)) for wf_step_input in wf_step_inputs: - if not wf_step_input.id: - continue wf_step_input.id = wf_step_input.id.split("/")[-1] if wf_step_input.valueFrom: wf_step_input.valueFrom = None if wf_step_input.source: - if isinstance(wf_step_input.source, MutableSequence): - for index, inp_source in enumerate(wf_step_input.source): - wf_step_input.source[index] = inp_source.split("#")[-1] - else: - wf_step_input.source = wf_step_input.source.split("#")[-1] - wf_step_inputs[:] = [ + new_source = list(wf_step_input.source) + for index, inp_source in enumerate(wf_step_input.source): + new_source[index] = inp_source.split("#")[-1] + wf_step_input.source = new_source + wf_step_inputs = [ x for x in wf_step_inputs if x.id and not (x.id.startswith("_") or x.id.endswith(step_inp_id)) @@ -2025,7 +2385,8 @@ def replace_step_valueFrom_expr_with_etool( # do we still need to scatter? else: scatter = None - workflow.steps.append( + new_steps = list(workflow.steps) + new_steps.append( cwl.WorkflowStep( id=name, in_=wf_step_inputs, @@ -2035,6 +2396,7 @@ def replace_step_valueFrom_expr_with_etool( scatterMethod=step.scatterMethod, ) ) + workflow.steps = new_steps def traverse_workflow( @@ -2067,7 +2429,7 @@ def traverse_workflow( if process_workflow_reqs_and_hints(workflow, replace_etool): modified = True if workflow.requirements: - workflow.requirements[:] = [ + workflow.requirements = [ x for x in workflow.requirements if not isinstance( diff --git a/cwl_utils/cwl_v1_2_expression_refactor.py b/cwl_utils/cwl_v1_2_expression_refactor.py index 3d7f86e7..670ddda8 100755 --- a/cwl_utils/cwl_v1_2_expression_refactor.py +++ b/cwl_utils/cwl_v1_2_expression_refactor.py @@ -5,7 +5,7 @@ import copy import hashlib import uuid -from collections.abc import Mapping, MutableSequence, Sequence +from collections.abc import MutableSequence, Sequence from contextlib import suppress from typing import Any, cast @@ -17,6 +17,17 @@ import cwl_utils.parser.cwl_v1_2_utils as utils from cwl_utils.errors import JavascriptException, WorkflowException from cwl_utils.expression import do_eval, interpolate +from cwl_utils.parser.cwl_v1_2_utils import ( + AnyTypeSchema, + BasicCommandInputTypeSchemas, + BasicCommandOutputTypeSchemas, + BasicInputTypeSchemas, + BasicOutputTypeSchemas, + CommandInputTypeSchemas, + CommandOutputTypeSchemas, + InputTypeSchemas, + OutputTypeSchemas, +) from cwl_utils.types import ( CWLDirectoryType, CWLFileType, @@ -24,6 +35,8 @@ CWLOutputType, CWLParameterContext, CWLRuntimeParameterContext, + is_file_or_directory, + is_sequence, ) @@ -43,7 +56,7 @@ def expand_stream_shortcuts(process: cwl.CommandLineTool) -> cwl.CommandLineTool ).hexdigest() result.stdout = stdout_path result.outputs[index].type_ = "File" - output.outputBinding = cwl.CommandOutputBinding(stdout_path, None, None) + output.outputBinding = cwl.CommandOutputBinding(glob=stdout_path) if result: return result return process @@ -54,33 +67,66 @@ def escape_expression_field(contents: str) -> str: return contents.replace("${", "$/{").replace("$(", "$/(") -def clean_type_ids( - cwltype: cwl.ArraySchema | cwl.InputRecordSchema, -) -> cwl.ArraySchema | cwl.InputRecordSchema: - """Simplify type identifiers.""" - result = copy.deepcopy(cwltype) - if isinstance(result, cwl.ArraySchema): - if isinstance(result.items, MutableSequence): - for item in result.items: +def _clean_type_ids( + cwltype: InputTypeSchemas | CommandOutputTypeSchemas, +) -> None: + if isinstance(cwltype, cwl.ArraySchema): + if is_sequence(cwltype.items): + for item in cwltype.items: if hasattr(item, "id"): item.id = item.id.split("#")[-1] - elif isinstance(result.items, cwl.InputRecordSchema): - if result.items.name: - result.items.name = result.items.name.split("/")[-1] - if result.items.fields: - for field in result.items.fields: + elif isinstance(cwltype.items, cwl.RecordSchema): + if ( + isinstance( + cwltype.items, + (cwl.InputRecordSchema, cwl.CommandOutputRecordSchema), + ) + and cwltype.items.name + ): + cwltype.items.name = cwltype.items.name.split("/")[-1] + if cwltype.items.fields: + for field in cwltype.items.fields: field.name = field.name.split("/")[-1] - elif isinstance(result, cwl.InputRecordSchema): - if result.name: - result.name = result.name.split("/")[-1] - if result.fields: - for field in result.fields: + elif isinstance(cwltype, cwl.RecordSchema): + if cwltype.name: + cwltype.name = cwltype.name.split("/")[-1] + if cwltype.fields: + for field in cwltype.fields: field.name = field.name.split("/")[-1] + + +def clean_type_ids( + cwltype: AnyTypeSchema, +) -> AnyTypeSchema: + """Simplify type identifiers.""" + result = copy.deepcopy(cwltype) + if is_sequence(result): + for item in result: + _clean_type_ids(item) + else: + _clean_type_ids(result) return result +def _has_expression(string: str) -> bool: + if "${" in string: + return True + if "$(" in string: + return True + return False + + +def has_expression(field: str | Sequence[str]) -> bool: + if is_sequence(field): + for entry in field: + if _has_expression(entry): + return True + return False + return _has_expression(field) + + def get_expression( - string: str, inputs: CWLObjectType, self: CWLOutputType | None + string: Any, inputs: CWLObjectType, self: CWLOutputType | None ) -> str | None: """ Find and return a normalized CWL expression, if any. @@ -135,6 +181,186 @@ def get_expression( return None +def _plain_input_schema_to_clt_input_schema( + input_type: BasicInputTypeSchemas, +) -> BasicCommandInputTypeSchemas: + match input_type: + case cwl.InputArraySchema(): + return cwl.CommandInputArraySchema.fromDoc( + input_type.save(), + input_type.loadingOptions.baseuri, + input_type.loadingOptions, + ) + case cwl.InputEnumSchema(): + return cwl.CommandInputEnumSchema.fromDoc( + input_type.save(), + input_type.loadingOptions.baseuri, + input_type.loadingOptions, + ) + case cwl.InputRecordSchema(): + return cwl.CommandInputRecordSchema.fromDoc( + input_type.save(), + input_type.loadingOptions.baseuri, + input_type.loadingOptions, + ) + case str(): + return input_type + raise WorkflowException(f"Unexpected ExpressionTool input type: {input_type}.") + + +def plain_input_schema_to_clt_input_schema( + input_type: InputTypeSchemas, +) -> CommandInputTypeSchemas: + if is_sequence(input_type): + return [ + _plain_input_schema_to_clt_input_schema(input_type_item) + for input_type_item in input_type + ] + return _plain_input_schema_to_clt_input_schema(input_type) + + +def _plain_input_schema_to_plain_output_schema( + input_type: BasicInputTypeSchemas, +) -> BasicOutputTypeSchemas: + match input_type: + case cwl.InputArraySchema(): + return cwl.OutputArraySchema.fromDoc( + input_type.save(), + input_type.loadingOptions.baseuri, + input_type.loadingOptions, + ) + case cwl.InputEnumSchema(): + return cwl.OutputEnumSchema.fromDoc( + input_type.save(), + input_type.loadingOptions.baseuri, + input_type.loadingOptions, + ) + case cwl.InputRecordSchema(): + return cwl.OutputRecordSchema.fromDoc( + input_type.save(), + input_type.loadingOptions.baseuri, + input_type.loadingOptions, + ) + case str(): + return input_type + raise WorkflowException(f"Unexpected ExpressionTool input type: {input_type}.") + + +def plain_input_schema_to_plain_output_schema( + input_type: InputTypeSchemas, +) -> OutputTypeSchemas: + if is_sequence(input_type): + return [ + _plain_input_schema_to_plain_output_schema(input_type_item) + for input_type_item in input_type + ] + return _plain_input_schema_to_plain_output_schema(input_type) + + +def _plain_output_schema_to_plain_input_schema( + input_type: BasicOutputTypeSchemas, +) -> BasicInputTypeSchemas: + match input_type: + case cwl.OutputArraySchema(): + return cwl.InputArraySchema.fromDoc( + input_type.save(), + input_type.loadingOptions.baseuri, + input_type.loadingOptions, + ) + case cwl.OutputEnumSchema(): + return cwl.InputEnumSchema.fromDoc( + input_type.save(), + input_type.loadingOptions.baseuri, + input_type.loadingOptions, + ) + case cwl.OutputRecordSchema(): + return cwl.InputRecordSchema.fromDoc( + input_type.save(), + input_type.loadingOptions.baseuri, + input_type.loadingOptions, + ) + case str(): + return input_type + raise WorkflowException(f"Unexpected ExpressionTool input type: {input_type}.") + + +def plain_output_schema_to_plain_input_schema( + input_type: OutputTypeSchemas, +) -> InputTypeSchemas: + if is_sequence(input_type): + return [ + _plain_output_schema_to_plain_input_schema(input_type_item) + for input_type_item in input_type + ] + return _plain_output_schema_to_plain_input_schema(input_type) + + +def _plain_output_type_to_clt_output_type( + output_type: BasicOutputTypeSchemas, +) -> BasicCommandOutputTypeSchemas: + match output_type: + case cwl.OutputArraySchema(): + return cwl.CommandOutputArraySchema.fromDoc( + output_type.save(), + output_type.loadingOptions.baseuri, + output_type.loadingOptions, + ) + case cwl.OutputEnumSchema(): + return cwl.CommandOutputEnumSchema.fromDoc( + output_type.save(), + output_type.loadingOptions.baseuri, + output_type.loadingOptions, + ) + case cwl.OutputRecordSchema(): + return cwl.CommandOutputRecordSchema.fromDoc( + output_type.save(), + output_type.loadingOptions.baseuri, + output_type.loadingOptions, + ) + case str(): + return output_type + raise WorkflowException(f"Unexpected ExpressionTool output type: {output_type}.") + + +def plain_output_type_to_clt_output_type( + output_type: OutputTypeSchemas, +) -> CommandOutputTypeSchemas: + if is_sequence(output_type): + return [ + _plain_output_type_to_clt_output_type(output_type_item) + for output_type_item in output_type + ] + return _plain_output_type_to_clt_output_type(output_type) + + +def parameter_to_workflow_input_paramater( + parameter: ( + cwl.WorkflowInputParameter + | cwl.CommandInputParameter + | cwl.CommandOutputParameter + | cwl.ExpressionToolOutputParameter + | cwl.WorkflowOutputParameter + | cwl.OperationOutputParameter + | cwl.OperationInputParameter + ), +) -> cwl.WorkflowInputParameter: + return cwl.WorkflowInputParameter.fromDoc( + parameter.save(), parameter.loadingOptions.baseuri, parameter.loadingOptions + ) + + +def parameters_to_workflow_input_paramaters( + parameters: Sequence[ + cwl.WorkflowInputParameter + | cwl.CommandInputParameter + | cwl.CommandOutputParameter + ], +) -> Sequence[cwl.WorkflowInputParameter]: + return [ + parameter_to_workflow_input_paramater(parameter) for parameter in parameters + ] + + def etool_to_cltool( etool: cwl.ExpressionTool, expressionLib: list[str] | None = None ) -> cwl.CommandLineTool: @@ -150,7 +376,7 @@ def etool_to_cltool( doc=inp.doc, format=inp.format, default=inp.default, - type_=inp.type_, + type_=plain_input_schema_to_clt_input_schema(inp.type_), extension_fields=inp.extension_fields, loadingOptions=inp.loadingOptions, ) @@ -165,7 +391,7 @@ def etool_to_cltool( streamable=outp.streamable, doc=outp.doc, format=outp.format, - type_=outp.type_, + type_=plain_output_type_to_clt_output_type(outp.type_), extension_fields=outp.extension_fields, loadingOptions=outp.loadingOptions, ) @@ -325,53 +551,61 @@ def generate_etool_from_expr( self_type: None | ( cwl.WorkflowInputParameter | cwl.CommandInputParameter - | list[cwl.WorkflowInputParameter | cwl.CommandInputParameter] + | Sequence[cwl.WorkflowInputParameter | cwl.CommandInputParameter] ) = None, # if the "self" input should be a different type than the "result" output extra_processes: None | ( - Sequence[cwl.Workflow | cwl.WorkflowStep | cwl.CommandLineTool] + Sequence[ + cwl.Workflow + | cwl.WorkflowStep + | cwl.CommandLineTool + | cwl.ExpressionTool + | cwl.ProcessGenerator + | cwl.Operation + ] ) = None, ) -> cwl.ExpressionTool: """Convert a CWL Expression into an ExpressionTool.""" - inputs = yaml.comments.CommentedSeq() + inputs: list[cwl.WorkflowInputParameter] = [] if not no_inputs: - if not self_type: + if self_type is None: self_type = target - if isinstance(self_type, list): - new_type: ( - list[cwl.ArraySchema | cwl.InputRecordSchema] - | cwl.ArraySchema - | cwl.InputRecordSchema - ) = [clean_type_ids(t.type_) for t in self_type] + assert self_type is not None + new_type: InputTypeSchemas + if is_sequence(self_type): + new_type_list: MutableSequence[BasicInputTypeSchemas] = [] + for entry in self_type: + clean_type = clean_type_ids(entry.type_) + if is_sequence(clean_type): + new_type_list.extend(clean_type) + elif clean_type is None: + pass + else: + new_type_list.append(clean_type) + new_type = new_type_list else: new_type = clean_type_ids(self_type.type_) inputs.append( cwl.WorkflowInputParameter( id="self", - label=self_type.label if not isinstance(self_type, list) else None, + label=self_type.label if not is_sequence(self_type) else None, secondaryFiles=( - self_type.secondaryFiles - if not isinstance(self_type, list) - else None + self_type.secondaryFiles if not is_sequence(self_type) else None ), streamable=( - self_type.streamable if not isinstance(self_type, list) else None + self_type.streamable if not is_sequence(self_type) 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, + doc=self_type.doc if not is_sequence(self_type) else None, + format=(self_type.format if not is_sequence(self_type) else None), type_=new_type, extension_fields=( - self_type.extension_fields - if not isinstance(self_type, list) - else None + self_type.extension_fields if not is_sequence(self_type) else None ), loadingOptions=( - self_type.loadingOptions - if not isinstance(self_type, list) - else None + self_type.loadingOptions if not is_sequence(self_type) else None ), ) ) - outputs = yaml.comments.CommentedSeq() + outputs: list[cwl.ExpressionToolOutputParameter] = [] outputs.append( cwl.ExpressionToolOutputParameter( id="result", @@ -379,8 +613,8 @@ def generate_etool_from_expr( secondaryFiles=target.secondaryFiles, streamable=target.streamable, doc=target.doc, - format=target.format, - type_=target.type_, + format=target.format[0] if target.format else None, + type_=plain_input_schema_to_plain_output_schema(target.type_), extension_fields=target.extension_fields, loadingOptions=target.loadingOptions, ) @@ -409,18 +643,28 @@ def generate_etool_from_expr( def get_input_for_id( - name: str, tool: cwl.CommandLineTool | cwl.Workflow + name: str, + tool: ( + cwl.CommandLineTool + | cwl.Workflow + | cwl.ProcessGenerator + | cwl.ExpressionTool + | cwl.Operation + ), ) -> cwl.CommandInputParameter | None: """Determine the CommandInputParameter for the given input name.""" name = name.split("/")[-1] for inp in cast(list[cwl.CommandInputParameter], tool.inputs): if inp.id and inp.id.split("#")[-1].split("/")[-1] == name: - return inp + return cwl.CommandInputParameter.fromDoc( + inp.save(), inp.loadingOptions.baseuri, inp.loadingOptions + ) if isinstance(tool, cwl.Workflow) and "/" in name: stepname, stem = name.split("/", 1) for step in tool.steps: if step.id == stepname: + assert not isinstance(step.run, str) result = get_input_for_id(stem, step.run) if result: return result @@ -429,7 +673,12 @@ def get_input_for_id( def find_expressionLib( processes: Sequence[ - cwl.CommandLineTool | cwl.Workflow | cwl.ExpressionTool | cwl.WorkflowStep + cwl.CommandLineTool + | cwl.Workflow + | cwl.ExpressionTool + | cwl.WorkflowStep + | cwl.ProcessGenerator + | cwl.Operation ], ) -> list[str] | None: """ @@ -451,26 +700,41 @@ def replace_expr_with_etool( name: str, workflow: cwl.Workflow, target: cwl.CommandInputParameter | cwl.WorkflowInputParameter, - source: str | list[Any] | None, + source: str | Sequence[Any] | None, replace_etool: bool = False, extra_process: None | ( - cwl.Workflow | cwl.WorkflowStep | cwl.CommandLineTool + cwl.Workflow + | cwl.WorkflowStep + | cwl.CommandLineTool + | cwl.ExpressionTool + | cwl.ProcessGenerator + | cwl.Operation ) = None, source_type: cwl.CommandInputParameter | None = None, ) -> None: """Modify the given workflow, replacing the expr with an standalone ExpressionTool.""" - extra_processes: list[cwl.Workflow | cwl.WorkflowStep | cwl.CommandLineTool] = [ - workflow - ] + extra_processes: list[ + cwl.WorkflowStep + | cwl.Workflow + | cwl.CommandLineTool + | cwl.ExpressionTool + | cwl.ProcessGenerator + | cwl.Operation + ] = [workflow] if extra_process: extra_processes.append(extra_process) etool: cwl.ExpressionTool = generate_etool_from_expr( expr, target, source is None, source_type, extra_processes ) if replace_etool: - processes: list[cwl.WorkflowStep | cwl.Workflow | cwl.CommandLineTool] = [ - workflow - ] + processes: list[ + cwl.WorkflowStep + | cwl.Workflow + | cwl.CommandLineTool + | cwl.ExpressionTool + | cwl.ProcessGenerator + | cwl.Operation + ] = [workflow] if extra_process: processes.append(extra_process) final_tool: cwl.ExpressionTool | cwl.CommandLineTool = etool_to_cltool( @@ -481,14 +745,16 @@ def replace_expr_with_etool( inps = [] if source: inps.append(cwl.WorkflowStepInput(id="self", source=source)) - workflow.steps.append( + new_steps: list[cwl.WorkflowStep] = [ cwl.WorkflowStep( id=name, in_=inps, out=[cwl.WorkflowStepOutput("result")], run=final_tool, ) - ) + ] + new_steps.extend(workflow.steps) + workflow.steps = new_steps def replace_wf_input_ref_with_step_output( @@ -519,26 +785,34 @@ def replace_wf_input_ref_with_step_output( def empty_inputs( process_or_step: ( - cwl.CommandLineTool | cwl.WorkflowStep | cwl.ExpressionTool | cwl.Workflow + cwl.CommandLineTool + | cwl.WorkflowStep + | cwl.ExpressionTool + | cwl.Workflow + | cwl.ProcessGenerator + | cwl.Operation ), parent: cwl.Workflow | None = None, ) -> dict[str, Any]: """Produce a mock input object for the given 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_) + for param1 in process_or_step.inputs: + result[param1.id.split("#")[-1]] = example_input(param1.type_) else: - for param in process_or_step.in_: - param_id = param.id.split("/")[-1] - if param.source is None and param.valueFrom: - result[param_id] = example_input("string") - elif param.source is None and param.default: - result[param_id] = param.default - else: + for param2 in process_or_step.in_: + param2_id = param2.id.split("/")[-1] + if param2.source is None and param2.valueFrom: + result[param2_id] = example_input("string") + elif param2.source is None and param2.default: + result[param2_id] = param2.default + elif param2.source is not None: with suppress(WorkflowException): - result[param_id] = example_input( - utils.type_for_source(process_or_step.run, param.source, parent) + assert not isinstance(process_or_step.run, str) + result[param2_id] = example_input( + utils.type_for_source( + process_or_step.run, param2.source, parent + ) ) return result @@ -659,18 +933,17 @@ def process_workflow_inputs_and_outputs( ) -> bool: """Do any needed conversions on the given Workflow's inputs and outputs.""" modified = False - inputs = empty_inputs(workflow) for index, param in enumerate(workflow.inputs): with SourceLine(workflow.inputs, index, WorkflowException): - if param.format and get_expression(param.format, inputs, None): + if param.format is not None and has_expression(param.format): raise SourceLine( param.loadingOptions.original_doc, "format", raise_type=WorkflowException, ).makeError(TOPLEVEL_FORMAT_EXPR_ERROR.format(param.id.split("#")[-1])) if param.secondaryFiles: - if hasattr(param.secondaryFiles, "pattern") and get_expression( - param.secondaryFiles.pattern, inputs, EMPTY_FILE + if hasattr(param.secondaryFiles, "pattern") and has_expression( + param.secondaryFiles.pattern ): raise SourceLine( param.loadingOptions.original_doc, @@ -679,7 +952,7 @@ def process_workflow_inputs_and_outputs( ).makeError(TOPLEVEL_SF_EXPR_ERROR.format(param.id.split("#")[-1])) elif isinstance(param.secondaryFiles, MutableSequence): for index2, entry in enumerate(param.secondaryFiles): - if get_expression(entry.pattern, inputs, EMPTY_FILE): + if has_expression(entry.pattern): raise SourceLine( param.loadingOptions.original_doc, index2, @@ -708,26 +981,36 @@ def process_workflow_inputs_and_outputs( target_type = copy.deepcopy(param2.type_) if isinstance(target_type, cwl.OutputArraySchema): target_type.name = "" - target = cwl.WorkflowInputParameter(id=None, type_=target_type) - if not isinstance(param2.outputSource, list): + target = cwl.WorkflowInputParameter( + id="", type_=plain_output_schema_to_plain_input_schema(target_type) + ) + assert param2.outputSource is not None + if not is_sequence(param2.outputSource): sources = param2.outputSource.split("#")[-1] else: sources = [s.split("#")[-1] for s in param2.outputSource] source_type_items = utils.type_for_source(workflow, sources) if isinstance(source_type_items, cwl.ArraySchema): - if isinstance(source_type_items.items, list): + if is_sequence(source_type_items.items): if "null" not in source_type_items.items: - source_type_items.items.append("null") + new_source_type_items_items = list(source_type_items.items) + new_source_type_items_items.append("null") + source_type_items.items = new_source_type_items_items elif source_type_items.items != "null": source_type_items.items = ["null", source_type_items.items] - elif isinstance(source_type_items, list): + source_type_items = cwl.CommandInputArraySchema.fromDoc( + source_type_items.save(), + source_type_items.loadingOptions.baseuri, + source_type_items.loadingOptions, + ) + elif is_sequence(source_type_items): if "null" not in source_type_items: - source_type_items.append("null") + new_source_type_items = list(source_type_items) + new_source_type_items.append("null") + source_type_items = new_source_type_items elif source_type_items != "null": source_type_items = ["null", source_type_items] - source_type = cwl.CommandInputParameter( - id=None, type_=source_type_items - ) + source_type = cwl.CommandInputParameter(id="", type_=source_type_items) replace_expr_with_etool( expression, etool_id, @@ -785,7 +1068,7 @@ def process_workflow_reqs_and_hints( if expression: modified = True target = cwl.WorkflowInputParameter( - id=None, + id="", type_="string", ) etool_id = ( @@ -806,7 +1089,9 @@ def process_workflow_reqs_and_hints( prop_reqs += (cwl.EnvVarRequirement,) newEnvDef = copy.deepcopy(envDef) newEnvDef.envValue = f"$(inputs._envDef{index})" - envVarReq.envDef[index] = newEnvDef + new_envDef = list(envVarReq.envDef) + new_envDef[index] = newEnvDef + envVarReq.envDef = new_envDef generated_envVar_reqs.append((etool_id, index)) case cwl.ResourceRequirement(): for attr in cwl.ResourceRequirement.attrs: @@ -815,9 +1100,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="", type_="long") etool_id = "_expression_workflow_ResourceRequirement_{}".format( attr ) @@ -842,7 +1125,7 @@ def process_workflow_reqs_and_hints( if expression: modified = True target = cwl.WorkflowInputParameter( - id=None, + id="", type_=cwl.InputArraySchema( ["File", "Directory"], "array", None, None ), @@ -863,18 +1146,18 @@ def process_workflow_reqs_and_hints( prop_reqs += (cwl.InitialWorkDirRequirement,) else: iwdr = copy.deepcopy(req) - for index, entry in enumerate(req.listing): - expression = get_expression(entry, inputs, None) + for index1, entry1 in enumerate(req.listing): + expression = get_expression(entry1, inputs, None) if expression: modified = True target = cwl.WorkflowInputParameter( - id=None, + id="", type_=cwl.InputArraySchema( ["File", "Directory"], "array", None, None ), ) etool_id = "_expression_workflow_InitialWorkDirRequirement_{}".format( - index + index1 ) replace_expr_with_etool( expression, @@ -884,17 +1167,19 @@ def process_workflow_reqs_and_hints( None, replace_etool, ) - iwdr.listing[index] = f"$(inputs._iwdr_listing_{index}" - generated_iwdr_reqs.append((etool_id, index)) - elif isinstance(entry, cwl.Dirent): - if entry.entry: + new_listing = list(iwdr.listing) + new_listing[index1] = f"$(inputs._iwdr_listing_{index1}" + iwdr.listing = new_listing + generated_iwdr_reqs.append((etool_id, index1)) + elif isinstance(entry1, cwl.Dirent): + if entry1.entry: expression = get_expression( - entry.entry, inputs, None + entry1.entry, inputs, None ) if expression: expr: str = expression expr_result = do_eval( - ex=entry.entry, + ex=entry1.entry, jobinput=inputs, requirements=[], outdir="", @@ -902,16 +1187,9 @@ def process_workflow_reqs_and_hints( resources={}, ) modified = True - if ( - isinstance(expr_result, Mapping) - and "class" in expr_result - and ( - expr_result["class"] - in ("File", "Directory") - ) - ): + if is_file_or_directory(expr_result): target = cwl.WorkflowInputParameter( - id=None, + id="", type_=expr_result["class"], ) replace_expr_with_etool( @@ -922,38 +1200,38 @@ def process_workflow_reqs_and_hints( None, replace_etool, ) - iwdr.listing[index] = ( - "$(inputs._iwdr_listing_{}".format( - index - ) + new_listing = list(iwdr.listing) + new_listing[index1] = ( + f"$(inputs._iwdr_listing_{index1}" ) + iwdr.listing = new_listing generated_iwdr_reqs.append( - (etool_id, index) + (etool_id, index1) ) elif isinstance(expr_result, str): target = cwl.WorkflowInputParameter( - id=None, + id="", type_=["File"], ) - if entry.entryname is None: + if entry1.entryname is None: raise SourceLine( - entry.loadingOptions.original_doc, - index, + entry1.loadingOptions.original_doc, + index1, raise_type=WorkflowException, ).makeError( - f"Entry {index}," + f"Entry {index1}," + "Invalid CWL, if 'entry' " "is a string, then entryName must be specified." ) expr = ( '${return {"class": "File", "basename": "' - + entry.entryname + + entry1.entryname + '", "contents": (function(){' + expr[2:-1] + "})() }; }" ) etool_id = "_expression_workflow_InitialWorkDirRequirement_{}".format( - index + index1 ) replace_expr_with_etool( expr, @@ -963,24 +1241,24 @@ def process_workflow_reqs_and_hints( None, replace_etool, ) - iwdr.listing[index] = ( - f"$(inputs._iwdr_listing_{index}" + new_listing = list(iwdr.listing) + new_listing[index1] = ( + f"$(inputs._iwdr_listing_{index1}" ) - generated_iwdr_reqs.append((etool_id, index)) + iwdr.listing = new_listing + generated_iwdr_reqs.append((etool_id, index1)) - elif entry.entryname: + elif entry1.entryname: expression = get_expression( - entry.entryname, inputs, None + entry1.entryname, inputs, None ) if expression: modified = True target = cwl.WorkflowInputParameter( - id=None, + id="", type_="string", ) - etool_id = "_expression_workflow_InitialWorkDirRequirement_{}".format( - index - ) + etool_id = f"_expression_workflow_InitialWorkDirRequirement_{index1}" replace_expr_with_etool( expression, etool_id, @@ -989,10 +1267,12 @@ def process_workflow_reqs_and_hints( None, replace_etool, ) - iwdr.listing[index] = ( - f"$(inputs._iwdr_listing_{index}" + new_listing = list(iwdr.listing) + new_listing[index1] = ( + f"$(inputs._iwdr_listing_{index1}" ) - generated_iwdr_reqs.append((etool_id, index)) + iwdr.listing = new_listing + generated_iwdr_reqs.append((etool_id, index1)) if generated_iwdr_reqs: prop_reqs += (cwl.InitialWorkDirRequirement,) else: @@ -1007,14 +1287,18 @@ def process_workflow_reqs_and_hints( continue else: step.requirements = yaml.comments.CommentedSeq() - step.requirements.append(envVarReq) - for entry in generated_envVar_reqs: - step.in_.append( + new_requirements = list(step.requirements) + new_requirements.append(envVarReq) + step.requirements = new_requirements + new_ins = list(step.in_) + for entry2 in generated_envVar_reqs: + new_ins.append( cwl.WorkflowStepInput( - id=f"_envDef{entry[1]}", - source=f"{entry[0]}/result", + id=f"_envDef{entry2[1]}", + source=f"{entry2[0]}/result", ) ) + step.in_ = new_ins if resourceReq and workflow.steps: for step in workflow.steps: @@ -1025,15 +1309,19 @@ def process_workflow_reqs_and_hints( if isinstance(req, cwl.ResourceRequirement): continue else: - step.requirements = yaml.comments.CommentedSeq() - step.requirements.append(resourceReq) - for entry in generated_res_reqs: - step.in_.append( + step.requirements = [] + new_requirements = list(step.requirements) + new_requirements.append(resourceReq) + step.requirements = new_requirements + new_ins = list(step.in_) + for entry3 in generated_res_reqs: + new_ins.append( cwl.WorkflowStepInput( - id=f"_{entry[1]}", - source=f"{entry[0]}/result", + id=f"_{entry3[1]}", + source=f"{entry3[0]}/result", ) ) + step.in_ = new_ins if iwdr and workflow.steps: for step in workflow.steps: @@ -1045,32 +1333,43 @@ def process_workflow_reqs_and_hints( continue else: step.requirements = yaml.comments.CommentedSeq() - step.requirements.append(iwdr) + new_requirements = list(step.requirements) + new_requirements.append(resourceReq) + new_requirements.append(iwdr) + step.requirements = new_requirements + new_ins = list(step.in_) if generated_iwdr_reqs: - for entry in generated_iwdr_reqs: - step.in_.append( + for entry4 in generated_iwdr_reqs: + new_ins.append( cwl.WorkflowStepInput( id=f"_iwdr_listing_{index}", - source=f"{entry[0]}/result", + source=f"{entry4[0]}/result", ) ) else: - step.in_.append( + new_ins.append( cwl.WorkflowStepInput( id="_iwdr_listing", source="_expression_workflow_InitialWorkDirRequirement/result", ) ) + step.in_ = new_ins if workflow.requirements: - workflow.requirements[:] = [ + workflow.requirements = [ x for x in workflow.requirements if not isinstance(x, prop_reqs) ] return modified def process_level_reqs( - process: cwl.CommandLineTool, + process: ( + cwl.CommandLineTool + | cwl.ExpressionTool + | cwl.ProcessGenerator + | cwl.Workflow + | cwl.Operation + ), step: cwl.WorkflowStep, parent: cwl.Workflow, replace_etool: bool, @@ -1090,6 +1389,7 @@ def process_level_reqs( if not process.requirements: return False modified = False + assert not isinstance(step.run, str) target_process = step.run inputs = empty_inputs(process) generated_res_reqs: list[tuple[str, str]] = [] @@ -1099,6 +1399,7 @@ def process_level_reqs( return False step_name = step.id.split("#", 1)[-1] for req_index, req in enumerate(process.requirements): + assert target_process.requirements is not None match req: case cwl.EnvVarRequirement() if req.envDef: for env_index, envDef in enumerate(req.envDef): @@ -1106,7 +1407,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="", type_="string") etool_id = "_expression_{}_EnvVarRequirement_{}".format( step_name, env_index ) @@ -1119,7 +1420,10 @@ def process_level_reqs( replace_etool, process, ) - target_process.requirements[req_index][ + cast( + cwl.EnvVarRequirement, + target_process.requirements[req_index], + ).envDef[ env_index ].envValue = f"$(inputs._envDef{env_index})" generated_envVar_reqs.append((etool_id, env_index)) @@ -1130,11 +1434,11 @@ 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="", type_="long") etool_id = "_expression_{}_ResourceRequirement_{}".format( step_name, attr ) - replace_clt_hintreq_expr_with_etool( + replace_step_process_hintreq_expr_with_etool( expression, etool_id, parent, @@ -1159,7 +1463,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="", type_=target_type) etool_id = "_expression_{}_InitialWorkDirRequirement".format( step_name ) @@ -1172,15 +1476,18 @@ def process_level_reqs( replace_etool, process, ) - target_process.requirements[req_index].listing = ( - "$(inputs._iwdr_listing)", - ) - step.in_.append( + cast( + cwl.InitialWorkDirRequirement, + target_process.requirements[req_index], + ).listing = ("$(inputs._iwdr_listing)",) + new_step_ins = list(step.in_) + new_step_ins.append( cwl.WorkflowStepInput( id="_iwdr_listing", source=f"{etool_id}/result", ) ) + step.in_ = new_step_ins add_input_to_process( target_process, "_iwdr_listing", @@ -1188,15 +1495,15 @@ def process_level_reqs( process.loadingOptions, ) else: - for listing_index, entry in enumerate(req.listing): - expression = get_expression(entry, inputs, None) + for listing_index, entry5 in enumerate(req.listing): + expression = get_expression(entry5, inputs, None) if expression: modified = True target_type = cwl.InputArraySchema( ["File", "Directory"], "array", None, None ) target = cwl.WorkflowInputParameter( - id=None, + id="", type_=target_type, ) etool_id = ( @@ -1213,31 +1520,41 @@ def process_level_reqs( replace_etool, process, ) - target_process.requirements[req_index].listing[ - listing_index - ] = f"$(inputs._iwdr_listing_{listing_index}" + new_iwdr_listing = list( + cast( + cwl.InitialWorkDirRequirement, + target_process.requirements[req_index], + ).listing + ) + new_iwdr_listing[listing_index] = ( + f"$(inputs._iwdr_listing_{listing_index}" + ) + cast( + cwl.InitialWorkDirRequirement, + target_process.requirements[req_index], + ).listing = new_iwdr_listing generated_iwdr_reqs.append( (etool_id, listing_index, target_type) ) - elif isinstance(entry, cwl.Dirent): - if entry.entry: - expression = get_expression(entry.entry, inputs, None) + elif isinstance(entry5, cwl.Dirent): + if entry5.entry: + expression = get_expression(entry5.entry, inputs, None) if expression: modified = True - if entry.entryname is not None: + if entry5.entryname is not None: entryname_expr = get_expression( - entry.entryname, inputs, None + entry5.entryname, inputs, None ) entryname = ( - entry.entryname + entry5.entryname if entryname_expr - else f'"{entry.entryname}"' # noqa: B907 + else f'"{entry5.entryname}"' # noqa: B907 ) new_expression = ( "${var result; var entryname = " + entryname + "; var entry = " - + entry.entry[2:-1] + + entry5.entry[2:-1] + """; if (typeof entry === 'string' || entry instanceof String) { result = {"class": "File", "basename": entryname, "contents": entry} ; @@ -1253,14 +1570,14 @@ def process_level_reqs( new_expression = expression d_target_type = ["File", "Directory"] target = cwl.WorkflowInputParameter( - id=None, + id="", type_=d_target_type, ) etool_id = "_expression_{}_InitialWorkDirRequirement_{}".format( step_name, listing_index ) - replace_clt_hintreq_expr_with_etool( + replace_step_process_hintreq_expr_with_etool( new_expression, etool_id, parent, @@ -1268,22 +1585,26 @@ def process_level_reqs( step, replace_etool, ) - target_process.requirements[req_index].listing[ - listing_index - ].entry = "$(inputs._iwdr_listing_{})".format( + cast( + cwl.Dirent, + cast( + cwl.InitialWorkDirRequirement, + target_process.requirements[req_index], + ).listing[listing_index], + ).entry = "$(inputs._iwdr_listing_{})".format( listing_index ) generated_iwdr_reqs.append( (etool_id, listing_index, d_target_type) ) - elif entry.entryname: + elif entry5.entryname: expression = get_expression( - entry.entryname, inputs, None + entry5.entryname, inputs, None ) if expression: modified = True target = cwl.WorkflowInputParameter( - id=None, + id="", type_="string", ) etool_id = "_expression_{}_InitialWorkDirRequirement_{}".format( @@ -1298,26 +1619,40 @@ def process_level_reqs( replace_etool, process, ) - target_process.requirements[req_index].listing[ - listing_index - ].entryname = "$(inputs._iwdr_listing_{})".format( + cast( + cwl.Dirent, + cast( + cwl.InitialWorkDirRequirement, + target_process.requirements[req_index], + ).listing[listing_index], + ).entryname = "$(inputs._iwdr_listing_{})".format( listing_index ) generated_iwdr_reqs.append( (etool_id, listing_index, "string") ) - for entry in generated_envVar_reqs: - name = f"_envDef{entry[1]}" - step.in_.append(cwl.WorkflowStepInput(id=name, source=f"{entry[0]}/result")) + new_step_ins = list(step.in_) + for env_entry in generated_envVar_reqs: + name = f"_envDef{env_entry[1]}" + new_step_ins.append( + cwl.WorkflowStepInput(id=name, source=f"{env_entry[0]}/result") + ) add_input_to_process(target_process, name, "string", process.loadingOptions) - for entry in generated_res_reqs: - name = f"_{entry[1]}" - step.in_.append(cwl.WorkflowStepInput(id=name, source=f"{entry[0]}/result")) + for res_entry in generated_res_reqs: + name = f"_{res_entry[1]}" + new_step_ins.append( + cwl.WorkflowStepInput(id=name, source=f"{res_entry[0]}/result") + ) add_input_to_process(target_process, name, "long", process.loadingOptions) - for entry in generated_iwdr_reqs: - name = f"_iwdr_listing_{entry[1]}" - step.in_.append(cwl.WorkflowStepInput(id=name, source=f"{entry[0]}/result")) - add_input_to_process(target_process, name, entry[2], process.loadingOptions) + for iwdr_entry in generated_iwdr_reqs: + name = f"_iwdr_listing_{iwdr_entry[1]}" + new_step_ins.append( + cwl.WorkflowStepInput(id=name, source=f"{iwdr_entry[0]}/result") + ) + add_input_to_process( + target_process, name, iwdr_entry[2], process.loadingOptions + ) + step.in_ = new_step_ins return modified @@ -1326,13 +1661,15 @@ def add_input_to_process( ) -> None: """Add a new InputParameter to the given CommandLineTool.""" if isinstance(process, cwl.CommandLineTool): - process.inputs.append( + new_process_inputs = list(process.inputs) + new_process_inputs.append( cwl.CommandInputParameter( id=name, type_=inptype, loadingOptions=loadingOptions, ) ) + process.inputs = new_process_inputs def traverse_CommandLineTool( @@ -1346,7 +1683,7 @@ def traverse_CommandLineTool( """Extract any CWL Expressions within the given CommandLineTool into sibling steps.""" modified = False # don't modify clt, modify step.run - target_clt = step.run + target_clt = cast(cwl.CommandLineTool, step.run) inputs = empty_inputs(clt) if not step.id: return False @@ -1360,24 +1697,28 @@ 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="", type_=target_type) replace_step_clt_expr_with_etool( expression, etool_id, parent, target, step, replace_etool ) - target_clt.arguments[index] = cwl.CommandLineBinding( + new_target_clt_arguments = list(target_clt.arguments or []) + new_target_clt_arguments[index] = cwl.CommandLineBinding( valueFrom=f"$(inputs.{inp_id})" ) - target_clt.inputs.append( + target_clt.arguments = new_target_clt_arguments + new_target_clt_inputs = list(target_clt.inputs) + new_target_clt_inputs.append( cwl.CommandInputParameter( id=inp_id, type_=target_type, ) ) - step.in_.append( - cwl.WorkflowStepInput( - f"{etool_id}/result", None, inp_id, None, None - ) + target_clt.inputs = new_target_clt_inputs + new_step_ins = list(step.in_) + new_step_ins.append( + cwl.WorkflowStepInput(id=f"{etool_id}/result", source=inp_id) ) + step.in_ = new_step_ins remove_JSReq(target_clt, skip_command_line1) elif isinstance(arg, cwl.CommandLineBinding) and arg.valueFrom: expression = get_expression(arg.valueFrom, inputs, None) @@ -1386,22 +1727,28 @@ 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="", type_=target_type) replace_step_clt_expr_with_etool( expression, etool_id, parent, target, step, replace_etool ) - target_clt.arguments[index].valueFrom = "$(inputs.{})".format( - inp_id + new_target_clt_arguments = list(target_clt.arguments or []) + new_target_clt_arguments[index] = cwl.CommandLineBinding( + valueFrom="$(inputs.{})".format(inp_id) ) - target_clt.inputs.append( + target_clt.arguments = new_target_clt_arguments + new_target_clt_inputs = list(target_clt.inputs) + new_target_clt_inputs.append( cwl.CommandInputParameter( id=inp_id, type_=target_type, ) ) - step.in_.append( + target_clt.inputs = new_target_clt_inputs + new_step_ins = list(step.in_) + new_step_ins.append( cwl.WorkflowStepInput(id=inp_id, source=f"{etool_id}/result") ) + step.in_ = new_step_ins remove_JSReq(target_clt, skip_command_line1) for streamtype in "stdout", "stderr": # add 'stdin' for v1.1 version stream_value = getattr(clt, streamtype) @@ -1412,17 +1759,21 @@ 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="", 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( + new_target_clt_inputs = list(target_clt.inputs) + new_target_clt_inputs.append( cwl.CommandInputParameter(id=inp_id, type_=target_type) ) - step.in_.append( + target_clt.inputs = new_target_clt_inputs + new_step_ins = list(step.in_) + new_step_ins.append( cwl.WorkflowStepInput(id=inp_id, source=f"{etool_id}/result") ) + step.in_ = new_step_ins for inp in clt.inputs: if not skip_command_line1 and inp.inputBinding and inp.inputBinding.valueFrom: expression = get_expression( @@ -1437,12 +1788,19 @@ def traverse_CommandLineTool( expression, etool_id, parent, inp, step, replace_etool, self_id ) inp.inputBinding.valueFrom = f"$(inputs.{inp_id})" - target_clt.inputs.append( - cwl.CommandInputParameter(id=inp_id, type_=inp.type_) + new_target_clt_inputs = list(target_clt.inputs) + new_target_clt_inputs.append( + cwl.CommandInputParameter( + id=inp_id, + type_=plain_input_schema_to_clt_input_schema(inp.type_), + ) ) - step.in_.append( + target_clt.inputs = new_target_clt_inputs + new_step_ins = list(step.in_) + new_step_ins.append( cwl.WorkflowStepInput(id=inp_id, source=f"{etool_id}/result") ) + step.in_ = new_step_ins for outp in clt.outputs: if outp.outputBinding: if outp.outputBinding.glob: @@ -1451,21 +1809,28 @@ def traverse_CommandLineTool( modified = True 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) + glob_target_type: CommandInputTypeSchemas = [ + "string", + cwl.CommandInputArraySchema("string", "array"), + ] + target = cwl.WorkflowInputParameter(id="", type_=glob_target_type) replace_step_clt_expr_with_etool( expression, etool_id, parent, target, step, replace_etool ) outp.outputBinding.glob = f"$(inputs.{inp_id})" - target_clt.inputs.append( + new_target_clt_inputs = list(target_clt.inputs) + new_target_clt_inputs.append( cwl.CommandInputParameter( id=inp_id, type_=glob_target_type, ) ) - step.in_.append( + target_clt.inputs = new_target_clt_inputs + new_step_ins = list(step.in_) + new_step_ins.append( cwl.WorkflowStepInput(id=inp_id, source=f"{etool_id}/result") ) + step.in_ = new_step_ins if outp.outputBinding.outputEval and not skip_command_line2: self: CWLOutputType = [ { @@ -1489,34 +1854,45 @@ def traverse_CommandLineTool( step, etool_id, outp_id ) self_type = cwl.WorkflowInputParameter( - id=None, + id="", type_=cwl.InputArraySchema("File", "array", None, None), ) + if isinstance(outp, cwl.CommandOutputParameter): + target = parameter_to_workflow_input_paramater(outp) + else: + target = outp etool = generate_etool_from_expr( - expression, outp, False, self_type, [clt, step, parent] + expression, target, False, self_type, [clt, step, parent] ) if outp.outputBinding.loadContents: - etool.inputs[0].type_.inputBinding = cwl.CommandLineBinding( + etool.inputs[0].inputBinding = cwl.CommandLineBinding( loadContents=True ) - etool.inputs.extend(cltool_inputs_to_etool_inputs(clt)) - sub_wf_inputs = cltool_inputs_to_etool_inputs(clt) + etool.inputs = list(etool.inputs) + process_inputs_to_etool_inputs( + clt + ) + sub_wf_inputs = process_inputs_to_etool_inputs(clt) orig_step_inputs = copy.deepcopy(step.in_) for orig_step_input in orig_step_inputs: - orig_step_input.id = orig_step_input.id.split("/")[-1] - if isinstance(orig_step_input.source, MutableSequence): + if is_sequence(orig_step_input.source): + new_orig_step_input_source = list(orig_step_input.source) for index, source in enumerate(orig_step_input.source): - orig_step_input.source[index] = source.split("#")[-1] + new_orig_step_input_source[index] = source.split("#")[ + -1 + ] + orig_step_input.source = new_orig_step_input_source + elif orig_step_input.source is None: + continue else: orig_step_input.source = orig_step_input.source.split("#")[ -1 ] - orig_step_inputs[:] = [ + orig_step_inputs = [ x for x in orig_step_inputs if not x.id.startswith("_") ] - for inp in orig_step_inputs: - inp.source = inp.id - inp.linkMerge = None + for wsi in orig_step_inputs: + wsi.source = wsi.id + wsi.linkMerge = None if replace_etool: processes = [parent] final_etool: cwl.CommandLineTool | cwl.ExpressionTool = ( @@ -1535,8 +1911,8 @@ def traverse_CommandLineTool( step ) # a deepcopy would be convenient, but params2.cwl gives it problems new_clt_step.id = new_clt_step.id.split("#")[-1] - new_clt_step.run = copy.copy(step.run) - new_clt_step.run.id = None + new_clt_step.run = copy.copy(target_clt) + new_clt_step.run.id = "" remove_JSReq(new_clt_step.run, skip_command_line1) for new_outp in new_clt_step.run.outputs: if new_outp.id.split("#")[-1] == outp_id: @@ -1564,12 +1940,17 @@ def traverse_CommandLineTool( type(new_outp), ) new_clt_step.in_ = copy.deepcopy(step.in_) - for inp in new_clt_step.in_: - inp.id = inp.id.split("/")[-1] - inp.source = inp.id - inp.linkMerge = None - for index, out in enumerate(new_clt_step.out): - new_clt_step.out[index] = out.split("/")[-1] + for wsi2 in new_clt_step.in_: + wsi2.id = wsi2.id.split("/")[-1] + wsi2.source = wsi2.id + wsi2.linkMerge = None + new_clt_step_out = list(new_clt_step.out) + for index, out in enumerate(new_clt_step_out): + if isinstance(out, str): + new_clt_step_out[index] = out.split("/")[-1] + else: + out.id = out.id.split("/")[-1] + new_clt_step.out = new_clt_step_out for tool_inp in new_clt_step.run.inputs: tool_inp.id = tool_inp.id.split("#")[-1] for tool_out in new_clt_step.run.outputs: @@ -1600,24 +1981,33 @@ def traverse_CommandLineTool( if isinstance(req, cwl.SubworkflowFeatureRequirement): has_sub_wf_req = True if not has_sub_wf_req: - parent.requirements.append( - cwl.SubworkflowFeatureRequirement() - ) + new_parent_reqs = list(parent.requirements) + new_parent_reqs.append(cwl.SubworkflowFeatureRequirement()) + parent.requirements = new_parent_reqs return modified def rename_step_source(workflow: cwl.Workflow, old: str, new: str) -> None: """Update step source names to the new name.""" - def simplify_wf_id(uri: str) -> str: - return uri.split("#")[-1].split("/", 1)[1] + def simplify_wf_ids(uris: Sequence[str] | str | None) -> set[str]: + if isinstance(uris, str): + uri_seq: Sequence[str] = [uris] + elif uris is None: + return set() + else: + uri_seq = uris + return {uri.split("#")[-1].split("/", 1)[1] for uri in uri_seq} def simplify_step_id(uri: str) -> str: return uri.split("#")[-1] for wf_outp in workflow.outputs: - if wf_outp.outputSource and simplify_wf_id(wf_outp.outputSource) == old: - wf_outp.outputSource = new + simplified_wf_ids = simplify_wf_ids(wf_outp.outputSource) + if wf_outp.outputSource and old in simplified_wf_ids: + simplified_wf_ids.remove(old) + simplified_wf_ids.add(new) + wf_outp.outputSource = list(simplified_wf_ids) for step in workflow.steps: if step.in_: for inp in step.in_: @@ -1633,7 +2023,9 @@ def simplify_step_id(uri: str) -> str: else: for index, source in enumerate(inp.source): if simplify_step_id(source) == old: - inp.source[index] = new + new_inp_source = list(inp.source) + new_inp_source[index] = new + inp.source = new_inp_source def remove_JSReq( @@ -1644,7 +2036,7 @@ def remove_JSReq( if skip_command_line1 and isinstance(process, cwl.CommandLineTool): return if process.hints: - process.hints[:] = [ + process.hints = [ hint for hint in process.hints if not isinstance(hint, cwl.InlineJavascriptRequirement) @@ -1652,7 +2044,7 @@ def remove_JSReq( if not process.hints: process.hints = None if process.requirements: - process.requirements[:] = [ + process.requirements = [ req for req in process.requirements if not isinstance(req, cwl.InlineJavascriptRequirement) @@ -1665,13 +2057,14 @@ def replace_step_clt_expr_with_etool( expr: str, name: str, workflow: cwl.Workflow, - target: cwl.WorkflowInputParameter, + target: cwl.CommandInputParameter | cwl.WorkflowInputParameter, step: cwl.WorkflowStep, replace_etool: bool, self_name: str | None = None, ) -> None: """Convert a step level CWL Expression to a sibling expression step.""" - etool_inputs = cltool_inputs_to_etool_inputs(step.run) + assert not isinstance(step.run, str) + etool_inputs = process_inputs_to_etool_inputs(step.run) temp_etool = generate_etool_from_expr2( expr, target, etool_inputs, self_name, step.run, [workflow] ) @@ -1685,8 +2078,9 @@ def replace_step_clt_expr_with_etool( wf_step_inputs = copy.deepcopy(step.in_) for wf_step_input in wf_step_inputs: wf_step_input.id = wf_step_input.id.split("/")[-1] - wf_step_inputs[:] = [x for x in wf_step_inputs if not x.id.startswith("_")] - workflow.steps.append( + wf_step_inputs = [x for x in wf_step_inputs if not x.id.startswith("_")] + new_steps = list(workflow.steps) + new_steps.append( cwl.WorkflowStep( id=name, in_=wf_step_inputs, @@ -1694,9 +2088,10 @@ def replace_step_clt_expr_with_etool( run=etool, ) ) + workflow.steps = new_steps -def replace_clt_hintreq_expr_with_etool( +def replace_step_process_hintreq_expr_with_etool( expr: str, name: str, workflow: cwl.Workflow, @@ -1707,7 +2102,8 @@ def replace_clt_hintreq_expr_with_etool( ) -> cwl.CommandLineTool | cwl.ExpressionTool: """Factor out an expression inside a CommandLineTool req or hint into a sibling step.""" # Same as replace_step_clt_expr_with_etool or different? - etool_inputs = cltool_inputs_to_etool_inputs(step.run) + assert not isinstance(step.run, str) + etool_inputs = process_inputs_to_etool_inputs(step.run) temp_etool = generate_etool_from_expr2( expr, target, etool_inputs, self_name, step.run, [workflow] ) @@ -1721,8 +2117,9 @@ def replace_clt_hintreq_expr_with_etool( wf_step_inputs = copy.deepcopy(step.in_) for wf_step_input in wf_step_inputs: wf_step_input.id = wf_step_input.id.split("/")[-1] - wf_step_inputs[:] = [x for x in wf_step_inputs if not x.id.startswith("_")] - workflow.steps.append( + wf_step_inputs = [x for x in wf_step_inputs if not x.id.startswith("_")] + new_steps = list(workflow.steps) + new_steps.append( cwl.WorkflowStep( id=name, in_=wf_step_inputs, @@ -1730,30 +2127,37 @@ def replace_clt_hintreq_expr_with_etool( run=etool, ) ) + workflow.steps = new_steps return etool -def cltool_inputs_to_etool_inputs( - tool: cwl.CommandLineTool, +def process_inputs_to_etool_inputs( + tool: ( + cwl.CommandLineTool + | cwl.ExpressionTool + | cwl.ProcessGenerator + | cwl.Workflow + | cwl.Operation + ), ) -> list[cwl.WorkflowInputParameter]: - """Copy CommandLineTool input objects into the equivalent ExpressionTool input objects.""" - inputs = yaml.comments.CommentedSeq() + """Copy Process input parameters to matching ExpressionTool versions.""" + inputs = [] if tool.inputs: - for clt_inp in tool.inputs: - clt_inp_id = clt_inp.id.split("#")[-1].split("/")[-1] - if not clt_inp_id.startswith("_"): + for process_inp in tool.inputs: + process_inp_id = process_inp.id.split("#")[-1].split("/")[-1] + if not process_inp_id.startswith("_"): inputs.append( cwl.WorkflowInputParameter( - id=clt_inp_id, - label=clt_inp.label, - secondaryFiles=clt_inp.secondaryFiles, - streamable=clt_inp.streamable, - doc=clt_inp.doc, - format=clt_inp.format, - default=clt_inp.default, - type_=clt_inp.type_, - extension_fields=clt_inp.extension_fields, - loadingOptions=clt_inp.loadingOptions, + id=process_inp_id, + label=process_inp.label, + secondaryFiles=process_inp.secondaryFiles, + streamable=process_inp.streamable, + doc=process_inp.doc, + format=process_inp.format, + default=process_inp.default, + type_=process_inp.type_, + extension_fields=process_inp.extension_fields, + loadingOptions=process_inp.loadingOptions, ) ) return inputs @@ -1761,17 +2165,18 @@ def cltool_inputs_to_etool_inputs( def cltool_step_outputs_to_workflow_outputs( cltool_step: cwl.WorkflowStep, etool_step_id: str, etool_out_id: str -) -> list[cwl.OutputParameter]: +) -> list[cwl.WorkflowOutputParameter]: """ Copy CommandLineTool outputs into the equivalent Workflow output parameters. Connects the outputSources for each of the new output parameters to the step they came from. """ - outputs = yaml.comments.CommentedSeq() + outputs: list[cwl.WorkflowOutputParameter] = [] if not cltool_step.id: raise WorkflowException(f"Missing step id from {cltool_step}.") default_step_id = cltool_step.id.split("#")[-1] + assert not isinstance(cltool_step.run, str) if cltool_step.run.outputs: for clt_out in cltool_step.run.outputs: clt_out_id = clt_out.id.split("#")[-1].split("/")[-1] @@ -1799,14 +2204,21 @@ def cltool_step_outputs_to_workflow_outputs( def generate_etool_from_expr2( expr: str, - target: cwl.CommandInputParameter | cwl.WorkflowInputParameter, + target: cwl.WorkflowInputParameter | cwl.CommandInputParameter, inputs: Sequence[ cwl.WorkflowInputParameter | cwl.CommandInputParameter | cwl.CommandOutputParameter ], self_name: str | None = None, - process: cwl.CommandLineTool | cwl.ExpressionTool | None = None, + process: ( + cwl.CommandLineTool + | cwl.ExpressionTool + | cwl.Workflow + | cwl.ProcessGenerator + | cwl.Operation + | None + ) = None, extra_processes: None | ( Sequence[cwl.Workflow | cwl.WorkflowStep | cwl.CommandLineTool] ) = None, @@ -1820,8 +2232,8 @@ def generate_etool_from_expr2( secondaryFiles=target.secondaryFiles, streamable=target.streamable, doc=target.doc, - format=target.format, - type_=target.type_, + format=target.format[0] if target.format else None, + type_=plain_input_schema_to_plain_output_schema(target.type_), ) ) expression = "${" @@ -1836,19 +2248,49 @@ def generate_etool_from_expr2( ) hints = None procs: list[ - cwl.CommandLineTool | cwl.ExpressionTool | cwl.Workflow | cwl.WorkflowStep + cwl.CommandLineTool + | cwl.ExpressionTool + | cwl.Workflow + | cwl.WorkflowStep + | cwl.ProcessGenerator + | cwl.Operation ] = [] if process: procs.append(process) if extra_processes: procs.extend(extra_processes) inlineJSReq = cwl.InlineJavascriptRequirement(find_expressionLib(procs)) - reqs = [inlineJSReq] + reqs: MutableSequence[ + cwl.CUDARequirement + | cwl.DockerRequirement + | cwl.EnvVarRequirement + | cwl.InitialWorkDirRequirement + | cwl.InlineJavascriptRequirement + | cwl.InplaceUpdateRequirement + | cwl.LoadListingRequirement + | cwl.Loop + | cwl.MPIRequirement + | cwl.MultipleInputFeatureRequirement + | cwl.NetworkAccess + | cwl.ResourceRequirement + | cwl.ScatterFeatureRequirement + | cwl.SchemaDefRequirement + | cwl.Secrets + | cwl.ShellCommandRequirement + | cwl.ShmSize + | cwl.SoftwareRequirement + | cwl.StepInputExpressionRequirement + | cwl.SubworkflowFeatureRequirement + | cwl.ToolTimeLimit + | cwl.WorkReuse + ] = [inlineJSReq] if process: if process.hints: hints = copy.deepcopy(process.hints) - hints[:] = [ - x for x in hints if not isinstance(x, cwl.InitialWorkDirRequirement) + hints = [ + x + for x in copy.deepcopy(hints) + if not isinstance(x, cwl.InitialWorkDirRequirement) ] if process.requirements: reqs.extend(copy.deepcopy(process.requirements)) @@ -1857,7 +2299,7 @@ def generate_etool_from_expr2( ] return cwl.ExpressionTool( id="_:" + str(uuid.uuid4()), - inputs=inputs, + inputs=parameters_to_workflow_input_paramaters(inputs), outputs=outputs, expression=expression, requirements=reqs, @@ -1879,43 +2321,29 @@ def traverse_step( return False step_id = step.id.split("#")[-1] original_process = copy.deepcopy(step.run) + assert not isinstance(original_process, str) + assert not isinstance(step.run, str) original_step_ins = copy.deepcopy(step.in_) for inp in step.in_: if inp.valueFrom: if not inp.source: self = None else: - if isinstance(inp.source, MutableSequence): - self = [] - for source in inp.source: - if not step.scatter: - self.append( - example_input( - utils.type_for_source(parent, source.split("#")[-1]) - ) - ) - else: - scattered_source_type = utils.type_for_source( - parent, source - ) - if isinstance(scattered_source_type, list): - for stype in scattered_source_type: - self.append(example_input(stype.type_)) - else: - self.append(example_input(scattered_source_type.type_)) - else: + self = [] + for source in inp.source: if not step.scatter: - self = example_input( - utils.type_for_source(parent, inp.source.split("#")[-1]) + self.append( + example_input( + utils.type_for_source(parent, source.split("#")[-1]) + ) ) else: - scattered_source_type2 = utils.type_for_source( - parent, inp.source - ) - if isinstance(scattered_source_type2, list): - self = example_input(scattered_source_type2[0].type_) + scattered_source_type = utils.type_for_source(parent, source) + if is_sequence(scattered_source_type): + for stype in scattered_source_type: + self.append(example_input(stype.type_)) else: - self = example_input(scattered_source_type2.type_) + self.append(example_input(scattered_source_type.type_)) expression = get_expression(inp.valueFrom, inputs, self) if expression: modified = True @@ -1924,42 +2352,32 @@ def traverse_step( if not target: raise WorkflowException("target not found") input_source_id = None - source_type: None | ( - MutableSequence[ - cwl.CommandInputParameter - | cwl.CommandOutputParameter - | cwl.WorkflowInputParameter + source_type: ( + None + | MutableSequence[ + cwl.WorkflowInputParameter | cwl.CommandOutputParameter ] - | cwl.CommandInputParameter - | cwl.CommandOutputParameter | cwl.WorkflowInputParameter + | cwl.CommandOutputParameter ) = None if inp.source: - if isinstance(inp.source, MutableSequence): - input_source_id = [] - source_types: list[cwl.WorkflowInputParameter] = [] - for source in inp.source: - source_id = source.split("#")[-1] - input_source_id.append(source_id) - temp_type = utils.type_for_source( - step.run, source_id, parent - ) - if isinstance(temp_type, list): - for ttype in temp_type: - if ttype not in source_types: - source_types.append(ttype) - else: - if temp_type not in source_types: - source_types.append(temp_type) - source_type = cwl.WorkflowInputParameter( - id=None, - type_=cwl.ArraySchema(source_types, "array"), - ) - else: - input_source_id = inp.source.split("#")[-1] - source_type = utils.param_for_source_id( - step.run, input_source_id, parent - ) + input_source_id = [] + source_types: list[BasicInputTypeSchemas] = [] + for source in inp.source: + source_id = source.split("#")[-1] + input_source_id.append(source_id) + temp_type = utils.type_for_source(step.run, source_id, parent) + if is_sequence(temp_type): + for ttype in temp_type: + if ttype not in source_types: + source_types.append(ttype) + else: + if temp_type not in source_types: + source_types.append(temp_type) + source_type = cwl.WorkflowInputParameter( + id="", + type_=cwl.InputArraySchema(source_types, "array"), + ) # target.id = target.id.split('#')[-1] if isinstance(original_process, cwl.ExpressionTool): found_JSReq = False @@ -1975,9 +2393,11 @@ def traverse_step( if not step.run.requirements: step.run.requirements = [] expr_lib = find_expressionLib([parent]) - step.run.requirements.append( + new_step_run_requirements = list(step.run.requirements) + new_step_run_requirements.append( cwl.InlineJavascriptRequirement(expr_lib) ) + step.run.requirements = new_step_run_requirements replace_step_valueFrom_expr_with_etool( expression, etool_id, @@ -1993,15 +2413,8 @@ def traverse_step( ) inp.valueFrom = None inp.source = f"{etool_id}/result" - if step.when: - expression = get_expression(string=step.when, inputs=inputs, self=None) - if expression: - modified = True - replace_step_when_expr_with_etool( - expression, parent, step, original_step_ins, replace_etool - ) - # TODO: skip or special process for sub workflows? + assert not isinstance(original_process, str) process_modified = process_level_reqs( original_process, step, @@ -2027,29 +2440,35 @@ def traverse_step( def workflow_step_to_WorkflowInputParameters( - step_ins: list[cwl.WorkflowStepInput], parent: cwl.Workflow, except_in_id: str -) -> MutableSequence[ - cwl.CommandInputParameter | cwl.CommandOutputParameter | cwl.WorkflowInputParameter -]: + step_ins: Sequence[cwl.WorkflowStepInput], parent: cwl.Workflow, except_in_id: str +) -> list[cwl.WorkflowInputParameter]: """Create WorkflowInputParameters to match the given WorkflowStep inputs.""" - params = [] + params: list[cwl.WorkflowInputParameter] = [] for inp in step_ins: - if not inp.id: - continue inp_id = inp.id.split("#")[-1].split("/")[-1] if inp.source and inp_id != except_in_id: param = copy.deepcopy( utils.param_for_source_id(parent, sourcenames=inp.source) ) - if isinstance(param, MutableSequence): + if is_sequence(param): for p in param: - p.id = inp_id - p.type_ = clean_type_ids(p.type_) - params.append(p) + if not p.type_: + raise WorkflowException( + f"Don't know how to get type id for {p!r}." + ) + new_param = parameter_to_workflow_input_paramater(p) + new_param.id = inp_id + new_param.type_ = clean_type_ids(new_param.type_) + params.append(new_param) else: - param.id = inp_id - param.type_ = clean_type_ids(param.type_) - params.append(param) + if not param.type_: + raise WorkflowException( + f"Don't know how to get type id for {param!r}." + ) + new_param = parameter_to_workflow_input_paramater(param) + new_param.id = inp_id + new_param.type_ = clean_type_ids(new_param.type_) + params.append(new_param) return params @@ -2060,15 +2479,21 @@ def replace_step_valueFrom_expr_with_etool( target: cwl.CommandInputParameter | cwl.WorkflowInputParameter, step: cwl.WorkflowStep, step_inp: cwl.WorkflowStepInput, - original_process: cwl.CommandLineTool | cwl.ExpressionTool, - original_step_ins: list[cwl.WorkflowStepInput], + original_process: ( + cwl.CommandLineTool + | cwl.ExpressionTool + | cwl.ProcessGenerator + | cwl.Workflow + | cwl.Operation + ), + original_step_ins: Sequence[cwl.WorkflowStepInput], source: str | list[str] | None, replace_etool: bool, source_type: None | ( cwl.CommandInputParameter | cwl.CommandOutputParameter | cwl.WorkflowInputParameter - | MutableSequence[ + | Sequence[ cwl.CommandInputParameter | cwl.CommandOutputParameter | cwl.WorkflowInputParameter @@ -2105,22 +2530,19 @@ def replace_step_valueFrom_expr_with_etool( etool: cwl.ExpressionTool | cwl.CommandLineTool = cltool else: etool = temp_etool - wf_step_inputs = copy.deepcopy(original_step_ins) + wf_step_inputs = list(original_step_ins) if source: wf_step_inputs.append(cwl.WorkflowStepInput(id="self", source=step_inp.source)) for wf_step_input in wf_step_inputs: - if not wf_step_input.id: - continue wf_step_input.id = wf_step_input.id.split("/")[-1] if wf_step_input.valueFrom: wf_step_input.valueFrom = None if wf_step_input.source: - if isinstance(wf_step_input.source, MutableSequence): - for index, inp_source in enumerate(wf_step_input.source): - wf_step_input.source[index] = inp_source.split("#")[-1] - else: - wf_step_input.source = wf_step_input.source.split("#")[-1] - wf_step_inputs[:] = [ + new_source = list(wf_step_input.source) + for index, inp_source in enumerate(wf_step_input.source): + new_source[index] = inp_source.split("#")[-1] + wf_step_input.source = new_source + wf_step_inputs = [ x for x in wf_step_inputs if x.id and not (x.id.startswith("_") or x.id.endswith(step_inp_id)) @@ -2136,7 +2558,8 @@ def replace_step_valueFrom_expr_with_etool( # do we still need to scatter? else: scatter = None - workflow.steps.append( + new_steps = list(workflow.steps) + new_steps.append( cwl.WorkflowStep( id=name, in_=wf_step_inputs, @@ -2146,72 +2569,7 @@ def replace_step_valueFrom_expr_with_etool( scatterMethod=step.scatterMethod, ) ) - - -def replace_step_when_expr_with_etool( - expr: str, - workflow: cwl.Workflow, - step: cwl.WorkflowStep, - original_step_ins: list[cwl.WorkflowStepInput], - replace_etool: bool, -) -> None: - """Replace a WorkflowStep level 'when' expression with a sibling ExpressionTool step.""" - if not step.id: - raise WorkflowException(f"Missing id from {step}.") - etool_id = "_when_expression_{}".format(step.id.split("#")[-1]) - etool_inputs = workflow_step_to_WorkflowInputParameters( - original_step_ins, workflow, "" - ) - temp_etool = generate_etool_from_expr2( - expr, - cwl.WorkflowInputParameter(id=None, type_="boolean"), - etool_inputs, - None, - None, - [workflow, step], - ) - if replace_etool: - processes: list[ - (cwl.Workflow | cwl.CommandLineTool | cwl.ExpressionTool | cwl.WorkflowStep) - ] = [ - workflow, - step, - ] - cltool = etool_to_cltool(temp_etool, find_expressionLib(processes)) - etool: cwl.ExpressionTool | cwl.CommandLineTool = cltool - else: - etool = temp_etool - wf_step_inputs = copy.deepcopy(original_step_ins) - for wf_step_input in wf_step_inputs: - if not wf_step_input.id: - continue - wf_step_input.id = wf_step_input.id.split("/")[-1] - if wf_step_input.source: - if isinstance(wf_step_input.source, MutableSequence): - for index, inp_source in enumerate(wf_step_input.source): - wf_step_input.source[index] = inp_source.split("#")[-1] - else: - wf_step_input.source = wf_step_input.source.split("#")[-1] - wf_step_inputs[:] = [x for x in wf_step_inputs if x.id and not x.id.startswith("_")] - scatter = copy.deepcopy(step.scatter) - if isinstance(scatter, str): - scatter = [scatter] - if isinstance(scatter, MutableSequence): - for index, entry in enumerate(scatter): - scatter[index] = entry.split("/")[-1] - scatter = step.scatter - workflow.steps.append( - cwl.WorkflowStep( - id=etool_id, - in_=wf_step_inputs, - out=[cwl.WorkflowStepOutput("result")], - run=etool, - scatter=scatter, - scatterMethod=step.scatterMethod, - ) - ) - step.when = "$(inputs._when)" - step.in_.append(cwl.WorkflowStepInput(id="_when", source=f"{etool_id}/result")) + workflow.steps = new_steps def traverse_workflow( @@ -2244,7 +2602,7 @@ def traverse_workflow( if process_workflow_reqs_and_hints(workflow, replace_etool): modified = True if workflow.requirements: - workflow.requirements[:] = [ + workflow.requirements = [ x for x in workflow.requirements if not isinstance( diff --git a/cwl_utils/docker_extract.py b/cwl_utils/docker_extract.py index f67163d0..6fa7528d 100755 --- a/cwl_utils/docker_extract.py +++ b/cwl_utils/docker_extract.py @@ -102,7 +102,9 @@ def extract_docker_requirements( yield req -def extract_docker_reqs(process: cwl.Process) -> Iterator[cwl.DockerRequirement]: +def extract_docker_reqs( + process: cwl.Process | cwl.WorkflowStep, +) -> Iterator[cwl.DockerRequirement]: """For the given process, extract the DockerRequirement(s).""" if process.requirements: for req in process.requirements: diff --git a/cwl_utils/inputs_schema_gen.py b/cwl_utils/inputs_schema_gen.py index d78228f8..a982a2fc 100644 --- a/cwl_utils/inputs_schema_gen.py +++ b/cwl_utils/inputs_schema_gen.py @@ -5,17 +5,20 @@ """Generate JSON Schema from CWL inputs object.""" import argparse +import hashlib import json import logging import sys +from collections.abc import Sequence from contextlib import suppress from copy import deepcopy from importlib.resources import files from pathlib import Path -from typing import Any, TypeGuard +from typing import Any, TypeGuard, cast from urllib.parse import urlparse import requests +from schema_salad.utils import json_dumps from cwl_utils.loghandler import _logger as _cwlutilslogger from cwl_utils.parser import ( @@ -26,6 +29,7 @@ InputEnumSchema, InputRecordSchema, InputRecordSchemaTypes, + SchemaDefRequirement, Workflow, WorkflowInputParameter, cwl_v1_0, @@ -33,6 +37,7 @@ cwl_v1_2, load_document_by_uri, ) +from cwl_utils.types import is_sequence from cwl_utils.utils import ( get_value_from_uri, is_local_uri, @@ -251,7 +256,11 @@ def generate_json_schema_property_from_input_parameter( """ # Get the input name and documentation for description input_name = get_value_from_uri(str(input_parameter.id)) - doc = input_parameter.doc + doc = ( + "\n".join(input_parameter.doc) + if is_sequence(input_parameter.doc) + else input_parameter.doc + ) required = get_is_required_from_input_parameter(input_parameter) return JSONSchemaProperty( @@ -262,27 +271,27 @@ def generate_json_schema_property_from_input_parameter( ) -def generate_definition_from_schema(schema: InputRecordSchema) -> dict[str, Any]: - """ - Given a schema, generate a JSON schema definition. +def generate_definition_from_schema( + schema: InputRecordSchema | InputArraySchema | InputEnumSchema, +) -> dict[str, Any]: + """Given a schema, generate a JSON schema definition.""" + # TODO: handle InputArraySchema & InputEnumSchema (from SchemaDefRequirement.types) - :param schema: - :return: - """ # Sanitise each field of the schema sanitised_fields = {} - if schema.fields is None: - return {} + if isinstance(schema, InputRecordSchema): + if schema.fields is None: + return {} - for field in schema.fields: - sanitised_fields.update( - { - get_value_from_uri(field.name): sanitise_schema_field( - {"type": field.type_} - ) - } - ) + for field in schema.fields: + sanitised_fields.update( + { + get_value_from_uri(field.name): sanitise_schema_field( + {"type": field.type_} + ) + } + ) # Generate JSON properties property_list = [] @@ -315,8 +324,17 @@ def generate_definition_from_schema(schema: InputRecordSchema) -> dict[str, Any] ) property_list.append(prop) + if not isinstance(schema, cwl_v1_0.InputArraySchema) or hasattr(schema, "name"): + schema_name = to_pascal_case(get_value_from_uri(str(schema.name))) + else: + schema_name = ( + "AnonymousInputArraySchema" + + hashlib.sha1( # nosec + json_dumps(schema.save()).encode("utf-8") + ).hexdigest() + ) return { - to_pascal_case(get_value_from_uri(str(schema.name))): { + schema_name: { "type": "object", "properties": {prop.name: prop.type_dict for prop in property_list}, "required": [prop.name for prop in property_list if prop.required], @@ -324,7 +342,7 @@ def generate_definition_from_schema(schema: InputRecordSchema) -> dict[str, Any] } -def cwl_to_jsonschema(cwl_obj: Workflow | CommandLineTool) -> Any: +def cwl_to_jsonschema(cwl_obj: Workflow | CommandLineTool) -> dict[str, object]: """ cwl_obj: A CWL Object. @@ -385,11 +403,9 @@ def get_complex_schema_values(idx_iter: str) -> InputRecordSchema: return input_record_schema - complex_schema_values: list[InputRecordSchema] = list( - map( - get_complex_schema_values, - complex_schema_keys, - ) + complex_schema_values: map[InputRecordSchema] = map( + get_complex_schema_values, + complex_schema_keys, ) # Load in all $imports to be referred by complex input types @@ -402,20 +418,21 @@ def get_complex_schema_values(idx_iter: str) -> InputRecordSchema: if cwl_obj.requirements is not None: with suppress(StopIteration): - schema_def_requirement = next( - filter( - lambda requirement_iter: requirement_iter.class_ - == "SchemaDefRequirement", - cwl_obj.requirements, - ) + schema_def_requirement = cast( + SchemaDefRequirement, + next( + filter( + lambda requirement_iter: requirement_iter.class_ + == "SchemaDefRequirement", + cwl_obj.requirements, + ) + ), ) workflow_schema_definitions_list.extend( - list( - map( - generate_definition_from_schema, - schema_def_requirement.types, - ) + map( + generate_definition_from_schema, + schema_def_requirement.types, ) ) @@ -428,7 +445,7 @@ def get_complex_schema_values(idx_iter: str) -> InputRecordSchema: properties = list( map( generate_json_schema_property_from_input_parameter, - cwl_obj.inputs, + cast(Sequence[WorkflowInputParameter], cwl_obj.inputs), ) ) diff --git a/cwl_utils/parser/__init__.py b/cwl_utils/parser/__init__.py index 6e105072..be8c41ef 100644 --- a/cwl_utils/parser/__init__.py +++ b/cwl_utils/parser/__init__.py @@ -44,10 +44,20 @@ class NoType(ABC): cwl_v1_0.OutputArraySchema | cwl_v1_1.OutputArraySchema | cwl_v1_2.OutputArraySchema ) """Type union for a CWL v1.x OutputArraySchema object.""" +OutputArraySchemaTypes = ( + cwl_v1_0.OutputArraySchema, + cwl_v1_1.OutputArraySchema, + cwl_v1_2.OutputArraySchema, +) OutputEnumSchema: TypeAlias = ( cwl_v1_0.OutputEnumSchema | cwl_v1_1.OutputEnumSchema | cwl_v1_2.OutputEnumSchema ) """Type union for a CWL v1.x OutputEnumSchema object.""" +OutputEnumSchemaTypes = ( + cwl_v1_0.OutputEnumSchema, + cwl_v1_1.OutputEnumSchema, + cwl_v1_2.OutputEnumSchema, +) OutputRecordField: TypeAlias = ( cwl_v1_0.OutputRecordField | cwl_v1_1.OutputRecordField | cwl_v1_2.OutputRecordField ) @@ -58,6 +68,11 @@ class NoType(ABC): | cwl_v1_2.OutputRecordSchema ) """Type union for a CWL v1.x OutputRecordSchema object.""" +OutputRecordSchemaTypes = ( + cwl_v1_0.OutputRecordSchema, + cwl_v1_1.OutputRecordSchema, + cwl_v1_2.OutputRecordSchema, +) OutputSchema: TypeAlias = ( cwl_v1_0.OutputSchema | cwl_v1_1.OutputSchema | cwl_v1_2.OutputSchema ) @@ -97,6 +112,12 @@ class NoType(ABC): | cwl_v1_2.WorkflowStepOutput ) """Type union for a CWL v1.x WorkflowStepOutput object.""" +Operation: TypeAlias = cwl_v1_2.Operation +"""Type union for a CWL v1.x Operation object.""" +OperationInputParameter: TypeAlias = cwl_v1_2.OperationInputParameter +"""Type union for a CWL v1.x OperationInputParameter object.""" +OperationOutputParameter: TypeAlias = cwl_v1_2.OperationOutputParameter +"""Type union for a CWL v1.x OperationOutputParameter object.""" CommandLineTool: TypeAlias = ( cwl_v1_0.CommandLineTool | cwl_v1_1.CommandLineTool | cwl_v1_2.CommandLineTool ) @@ -215,6 +236,7 @@ class NoType(ABC): cwl_v1_2.InputRecordSchema, ) """Type Union for a CWL v1.x RecordSchema object.""" + File: TypeAlias = cwl_v1_0.File | cwl_v1_1.File | cwl_v1_2.File """Type Union for a CWL v1.x File object.""" SecondaryFileSchema: TypeAlias = ( @@ -225,19 +247,14 @@ class NoType(ABC): """Type Union for a CWL v1.x Directory object.""" Dirent: TypeAlias = cwl_v1_0.Dirent | cwl_v1_1.Dirent | cwl_v1_2.Dirent """Type Union for a CWL v1.x Dirent object.""" -LoadContents: TypeAlias = ( - cwl_v1_1.CommandInputParameter - | cwl_v1_2.CommandInputParameter - | cwl_v1_1.CommandOutputBinding - | cwl_v1_2.CommandOutputBinding - | cwl_v1_1.InputRecordField - | cwl_v1_2.InputRecordField - | cwl_v1_1.WorkflowInputParameter - | cwl_v1_2.WorkflowInputParameter - | cwl_v1_1.WorkflowStepInput - | cwl_v1_2.WorkflowStepInput -) +LoadContents: TypeAlias = cwl_v1_1.LoadContents | cwl_v1_2.LoadContents """Type Union for a CWL v1.x LoadContents object.""" +SchemaDefRequirement: TypeAlias = ( + cwl_v1_0.SchemaDefRequirement + | cwl_v1_1.SchemaDefRequirement + | cwl_v1_2.SchemaDefRequirement +) +"""Type Union for a CWL v1.x SchemaDefRequirement object.""" _Loader: TypeAlias = cwl_v1_0._Loader | cwl_v1_1._Loader | cwl_v1_2._Loader """Type union for a CWL v1.x _Loader.""" diff --git a/cwl_utils/parser/cwl_v1_0.py b/cwl_utils/parser/cwl_v1_0.py index 7f3110dd..6a6e814b 100644 --- a/cwl_utils/parser/cwl_v1_0.py +++ b/cwl_utils/parser/cwl_v1_0.py @@ -3,18 +3,24 @@ # The code itself is released under the Apache 2.0 license and the help text is # subject to the license of the original schema. +from __future__ import annotations + import copy import logging import os import pathlib +import sys import tempfile import uuid as _uuid__ # pylint: disable=unused-import # noqa: F401 import xml.sax # nosec -from abc import ABC, abstractmethod +from abc import ABCMeta, abstractmethod from collections.abc import MutableMapping, MutableSequence, Sequence +from collections.abc import Collection # pylint: disable=unused-import # noqa: F401 from io import StringIO from itertools import chain -from typing import Any, Final, Optional, Union, cast +from mypy_extensions import i32, i64, trait +from typing import Any, Final, Generic, TypeAlias, TypeVar, cast +from typing import ClassVar, Literal, Mapping # pylint: disable=unused-import # noqa: F401 from urllib.parse import quote, urldefrag, urlparse, urlsplit, urlunsplit from urllib.request import pathname2url @@ -27,22 +33,28 @@ from schema_salad.sourceline import SourceLine, add_lc_filename from schema_salad.utils import CacheType, yaml_no_ts # requires schema-salad v8.2+ -_vocab: dict[str, str] = {} -_rvocab: dict[str, str] = {} +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + +_vocab: Final[dict[str, str]] = {} +_rvocab: Final[dict[str, str]] = {} _logger: Final = logging.getLogger("salad") -IdxType = MutableMapping[str, tuple[Any, "LoadingOptions"]] +IdxType: TypeAlias = MutableMapping[str, tuple[Any, "LoadingOptions"]] +S = TypeVar("S", bound="Saveable") class LoadingOptions: idx: Final[IdxType] - fileuri: Final[Optional[str]] + fileuri: Final[str | None] baseuri: Final[str] namespaces: Final[MutableMapping[str, str]] schemas: Final[MutableSequence[str]] - original_doc: Final[Optional[Any]] + original_doc: Final[Any | None] addl_metadata: Final[MutableMapping[str, Any]] fetcher: Final[Fetcher] vocab: Final[dict[str, str]] @@ -50,24 +62,24 @@ class LoadingOptions: cache: Final[CacheType] imports: Final[list[str]] includes: Final[list[str]] - no_link_check: Final[Optional[bool]] - container: Final[Optional[str]] + no_link_check: Final[bool | None] + container: Final[str | None] def __init__( self, - fetcher: Optional[Fetcher] = None, - namespaces: Optional[dict[str, str]] = None, - schemas: Optional[list[str]] = None, - fileuri: Optional[str] = None, - copyfrom: Optional["LoadingOptions"] = None, - original_doc: Optional[Any] = None, - addl_metadata: Optional[dict[str, str]] = None, - baseuri: Optional[str] = None, - idx: Optional[IdxType] = None, - imports: Optional[list[str]] = None, - includes: Optional[list[str]] = None, - no_link_check: Optional[bool] = None, - container: Optional[str] = None, + fetcher: Fetcher | None = None, + namespaces: dict[str, str] | None = None, + schemas: list[str] | None = None, + fileuri: str | None = None, + copyfrom: LoadingOptions | None = None, + original_doc: Any | None = None, + addl_metadata: dict[str, str] | None = None, + baseuri: str | None = None, + idx: IdxType | None = None, + imports: list[str] | None = None, + includes: list[str] | None = None, + no_link_check: bool | None = None, + container: str | None = None, ) -> None: """Create a LoadingOptions object.""" self.original_doc = original_doc @@ -79,7 +91,7 @@ def __init__( self.idx = temp_idx if fileuri is not None: - temp_fileuri: Optional[str] = fileuri + temp_fileuri: str | None = fileuri else: temp_fileuri = copyfrom.fileuri if copyfrom is not None else None self.fileuri = temp_fileuri @@ -121,13 +133,13 @@ def __init__( self.includes = temp_includes if no_link_check is not None: - temp_no_link_check: Optional[bool] = no_link_check + temp_no_link_check: bool | None = no_link_check else: temp_no_link_check = copyfrom.no_link_check if copyfrom is not None else False self.no_link_check = temp_no_link_check if container is not None: - temp_container: Optional[str] = container + temp_container: str | None = container else: temp_container = copyfrom.container if copyfrom is not None else None self.container = temp_container @@ -201,7 +213,8 @@ def graph(self) -> Graph: return graph -class Saveable(ABC): +@trait +class Saveable(metaclass=ABCMeta): """Mark classes than have a save() and fromDoc() function.""" @classmethod @@ -211,8 +224,8 @@ def fromDoc( _doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - ) -> "Saveable": + docRoot: str | None = None, + ) -> Self: """Construct this object from the result of yaml.load().""" @abstractmethod @@ -223,11 +236,11 @@ def save( def load_field( - val: Union[str, dict[str, str]], + val: Any | None, fieldtype: "_Loader", baseuri: str, loadingOptions: LoadingOptions, - lc: Optional[list[Any]] = None, + lc: Any | None = None, ) -> Any: """Load field.""" if isinstance(val, MutableMapping): @@ -251,7 +264,9 @@ def load_field( return fieldtype.load(val, baseuri, loadingOptions, lc=lc) -save_type = Optional[Union[MutableMapping[str, Any], MutableSequence[Any], int, float, bool, str]] +save_type: TypeAlias = ( + None | MutableMapping[str, Any] | MutableSequence[Any] | i32 | i64 | float | bool | str +) def extract_type(val_type: type[Any]) -> str: @@ -328,7 +343,7 @@ def save( for key in val: newdict[key] = save(val[key], top=False, base_url=base_url, relative_uris=relative_uris) return newdict - if val is None or isinstance(val, (int, float, bool, str)): + if val is None or isinstance(val, (i32, i64, float, bool, str)): return val raise Exception("Not Saveable: %s" % type(val)) @@ -367,7 +382,7 @@ def expand_url( loadingOptions: LoadingOptions, scoped_id: bool = False, vocab_term: bool = False, - scoped_ref: Optional[int] = None, + scoped_ref: int | None = None, ) -> str: if url in ("@id", "@type"): return url @@ -434,9 +449,9 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, - ) -> Any: + docRoot: str | None = None, + lc: Any | None = None, + ) -> Any | None: pass @@ -446,8 +461,8 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, + docRoot: str | None = None, + lc: Any | None = None, ) -> Any: if doc is not None: return doc @@ -455,7 +470,7 @@ def load( class _PrimitiveLoader(_Loader): - def __init__(self, tp: Union[type, tuple[type[str], type[str]]]) -> None: + def __init__(self, tp: type | tuple[type[str], type[str]]) -> None: self.tp: Final = tp def load( @@ -463,8 +478,8 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, + docRoot: str | None = None, + lc: Any | None = None, ) -> Any: if not isinstance(doc, self.tp): raise ValidationException(f"Expected a {self.tp} but got {doc.__class__.__name__}") @@ -483,9 +498,9 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, - ) -> Any: + docRoot: str | None = None, + lc: Any | None = None, + ) -> list[Any]: if not isinstance(doc, MutableSequence): raise ValidationException( f"Value is a {convert_typing(extract_type(type(doc)))}, " @@ -535,9 +550,9 @@ class _MapLoader(_Loader): def __init__( self, values: _Loader, - name: Optional[str] = None, - container: Optional[str] = None, - no_link_check: Optional[bool] = None, + name: str | None = None, + container: str | None = None, + no_link_check: bool | None = None, ) -> None: self.values: Final = values self.name: Final = name @@ -549,9 +564,9 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, - ) -> Any: + docRoot: str | None = None, + lc: Any | None = None, + ) -> dict[str, 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: @@ -584,11 +599,11 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, - ) -> Any: + docRoot: str | None = None, + lc: Any | None = None, + ) -> str: if doc in self.symbols: - return doc + return cast(str, doc) raise ValidationException(f"Expected one of {self.symbols}") def __repr__(self) -> str: @@ -604,75 +619,76 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, + docRoot: str | None = None, + lc: Any | None = None, ) -> Any: r: Final[list[dict[str, Any]]] = [] - if isinstance(doc, MutableSequence): - for d in doc: - if isinstance(d, str): - if d.endswith("?"): - r.append({"pattern": d[:-1], "required": False}) - else: - r.append({"pattern": d}) - elif isinstance(d, dict): - new_dict1: dict[str, Any] = {} - dict_copy = copy.deepcopy(d) - if "pattern" in dict_copy: - new_dict1["pattern"] = dict_copy.pop("pattern") - else: - raise ValidationException( - f"Missing pattern in secondaryFiles specification entry: {d}" + match doc: + case MutableSequence() as dlist: + for d in dlist: + if isinstance(d, str): + if d.endswith("?"): + r.append({"pattern": d[:-1], "required": False}) + else: + r.append({"pattern": d}) + elif isinstance(d, dict): + new_dict1: dict[str, Any] = {} + dict_copy = copy.deepcopy(d) + if "pattern" in dict_copy: + new_dict1["pattern"] = dict_copy.pop("pattern") + else: + raise ValidationException( + f"Missing pattern in secondaryFiles specification entry: {d}" + ) + new_dict1["required"] = ( + dict_copy.pop("required") if "required" in dict_copy else None ) - new_dict1["required"] = ( - dict_copy.pop("required") if "required" in dict_copy else None - ) - if len(dict_copy): - raise ValidationException( - "Unallowed values in secondaryFiles specification entry: {}".format( - dict_copy + if len(dict_copy): + raise ValidationException( + "Unallowed values in secondaryFiles specification entry: {}".format( + dict_copy + ) ) - ) - r.append(new_dict1) + r.append(new_dict1) + else: + raise ValidationException( + "Expected a string or sequence of (strings or mappings)." + ) + case MutableMapping() as decl: + new_dict2 = {} + doc_copy = copy.deepcopy(decl) + if "pattern" in doc_copy: + new_dict2["pattern"] = doc_copy.pop("pattern") else: raise ValidationException( - "Expected a string or sequence of (strings or mappings)." + f"Missing pattern in secondaryFiles specification entry: {decl}" ) - elif isinstance(doc, MutableMapping): - new_dict2: Final = {} - doc_copy: Final = copy.deepcopy(doc) - if "pattern" in doc_copy: - new_dict2["pattern"] = doc_copy.pop("pattern") - else: - raise ValidationException( - f"Missing pattern in secondaryFiles specification entry: {doc}" - ) - new_dict2["required"] = doc_copy.pop("required") if "required" in doc_copy else None + new_dict2["required"] = doc_copy.pop("required") if "required" in doc_copy else None - if len(doc_copy): - raise ValidationException( - f"Unallowed values in secondaryFiles specification entry: {doc_copy}" - ) - r.append(new_dict2) + if len(doc_copy): + raise ValidationException( + f"Unallowed values in secondaryFiles specification entry: {doc_copy}" + ) + r.append(new_dict2) - elif isinstance(doc, str): - if doc.endswith("?"): - r.append({"pattern": doc[:-1], "required": False}) - else: - r.append({"pattern": doc}) - else: - raise ValidationException("Expected str or sequence of str") + case str(decl): + if decl.endswith("?"): + r.append({"pattern": decl[:-1], "required": False}) + else: + r.append({"pattern": decl}) + case _: + raise ValidationException("Expected str or sequence of str") return self.inner.load(r, baseuri, loadingOptions, docRoot, lc=lc) -class _RecordLoader(_Loader): +class _RecordLoader(_Loader, Generic[S]): def __init__( self, - classtype: type[Saveable], - container: Optional[str] = None, - no_link_check: Optional[bool] = None, + classtype: type[S], + container: str | None = None, + no_link_check: bool | None = None, ) -> None: self.classtype: Final = classtype self.container: Final = container @@ -683,9 +699,9 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, - ) -> Any: + docRoot: str | None = None, + lc: Any | None = None, + ) -> S: if not isinstance(doc, MutableMapping): raise ValidationException( f"Value is a {convert_typing(extract_type(type(doc)))}, " @@ -710,19 +726,20 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, - ) -> Any: + docRoot: str | None = None, + lc: Any | None = None, + ) -> str: if not isinstance(doc, str): raise ValidationException( f"Value is a {convert_typing(extract_type(type(doc)))}, " f"but valid type for this field is a str." ) - return doc + else: + return doc class _UnionLoader(_Loader): - def __init__(self, alternates: Sequence[_Loader], name: Optional[str] = None) -> None: + def __init__(self, alternates: Sequence[_Loader], name: str | None = None) -> None: self.alternates = alternates self.name: Final = name @@ -734,8 +751,8 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, + docRoot: str | None = None, + lc: Any | None = None, ) -> Any: errors: Final = [] @@ -817,8 +834,8 @@ def __init__( inner: _Loader, scoped_id: bool, vocab_term: bool, - scoped_ref: Optional[int], - no_link_check: Optional[bool], + scoped_ref: int | None, + no_link_check: bool | None, ) -> None: self.inner: Final = inner self.scoped_id: Final = scoped_id @@ -831,39 +848,40 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, + docRoot: str | None = None, + lc: Any | None = None, ) -> Any: if self.no_link_check is not None: loadingOptions = LoadingOptions( copyfrom=loadingOptions, no_link_check=self.no_link_check ) - if isinstance(doc, MutableSequence): - newdoc: Final = [] - for i in doc: - if isinstance(i, str): - newdoc.append( - expand_url( - i, - baseuri, - loadingOptions, - self.scoped_id, - self.vocab_term, - self.scoped_ref, - ) - ) - else: - newdoc.append(i) - doc = newdoc - elif isinstance(doc, str): - doc = expand_url( - doc, - baseuri, - loadingOptions, - self.scoped_id, - self.vocab_term, - self.scoped_ref, - ) + match doc: + case MutableSequence() as decl: + newdoc: Final = [] + for i in decl: + if isinstance(i, str): + newdoc.append( + expand_url( + i, + baseuri, + loadingOptions, + self.scoped_id, + self.vocab_term, + self.scoped_ref, + ) + ) + else: + newdoc.append(i) + doc = newdoc + case str(decl): + doc = expand_url( + decl, + baseuri, + loadingOptions, + self.scoped_id, + self.vocab_term, + self.scoped_ref, + ) if isinstance(doc, str): if not loadingOptions.no_link_check: errors: Final = [] @@ -880,7 +898,7 @@ def load( class _TypeDSLLoader(_Loader): - def __init__(self, inner: _Loader, refScope: Optional[int], salad_version: str) -> None: + def __init__(self, inner: _Loader, refScope: int | None, salad_version: str) -> None: self.inner: Final = inner self.refScope: Final = refScope self.salad_version: Final = salad_version @@ -890,7 +908,7 @@ def resolve( doc: str, baseuri: str, loadingOptions: LoadingOptions, - ) -> Union[list[Union[dict[str, Any], str]], dict[str, Any], str]: + ) -> list[dict[str, Any] | str] | dict[str, Any] | str: doc_ = doc optional = False if doc_.endswith("?"): @@ -899,7 +917,7 @@ def resolve( if doc_.endswith("[]"): salad_versions: Final = [int(v) for v in self.salad_version[1:].split(".")] - items: Union[list[Union[dict[str, Any], str]], dict[str, Any], str] = "" + items: list[dict[str, Any] | str] | dict[str, Any] | str = "" rest: Final = doc_[0:-2] if salad_versions < [1, 3]: if rest.endswith("[]"): @@ -911,7 +929,7 @@ def resolve( items = self.resolve(rest, baseuri, loadingOptions) if isinstance(items, str): items = expand_url(items, baseuri, loadingOptions, False, True, self.refScope) - expanded: Union[dict[str, Any], str] = {"type": "array", "items": items} + expanded: dict[str, Any] | str = {"type": "array", "items": items} else: expanded = expand_url(doc_, baseuri, loadingOptions, False, True, self.refScope) @@ -925,8 +943,8 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, + docRoot: str | None = None, + lc: Any | None = None, ) -> Any: if isinstance(doc, MutableSequence): r: Final[list[Any]] = [] @@ -950,7 +968,7 @@ def load( class _IdMapLoader(_Loader): - def __init__(self, inner: _Loader, mapSubject: str, mapPredicate: Optional[str]) -> None: + def __init__(self, inner: _Loader, mapSubject: str, mapPredicate: str | None) -> None: self.inner: Final = inner self.mapSubject: Final = mapSubject self.mapPredicate: Final = mapPredicate @@ -960,8 +978,8 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, + docRoot: str | None = None, + lc: Any | None = None, ) -> Any: if isinstance(doc, MutableMapping): r: Final[list[Any]] = [] @@ -990,10 +1008,10 @@ def load( def _document_load( loader: _Loader, - doc: Union[str, MutableMapping[str, Any], MutableSequence[Any]], + doc: str | MutableMapping[str, Any] | MutableSequence[Any], baseuri: str, loadingOptions: LoadingOptions, - addl_metadata_fields: Optional[MutableSequence[str]] = None, + addl_metadata_fields: MutableSequence[str] | None = None, ) -> tuple[Any, LoadingOptions]: if isinstance(doc, str): return _document_load_by_url( @@ -1062,7 +1080,7 @@ def _document_load_by_url( loader: _Loader, url: str, loadingOptions: LoadingOptions, - addl_metadata_fields: Optional[MutableSequence[str]] = None, + addl_metadata_fields: MutableSequence[str] | None = None, ) -> tuple[Any, LoadingOptions]: if url in loadingOptions.idx: return loadingOptions.idx[url] @@ -1117,7 +1135,7 @@ def save_relative_uri( uri: Any, base_url: str, scoped_id: bool, - ref_scope: Optional[int], + ref_scope: int | None, relative_uris: bool, ) -> Any: """Convert any URI to a relative one, obeying the scoping rules.""" @@ -1168,8 +1186,9 @@ def parser_info() -> str: return "org.w3id.cwl.v1_0" -class Documented(Saveable): - pass +@trait +class Documented(Saveable, metaclass=ABCMeta): + doc: None | Sequence[str] | str class RecordField(Documented): @@ -1179,26 +1198,6 @@ class RecordField(Documented): name: str - def __init__( - self, - name: Any, - type_: Any, - doc: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.type_ = type_ - def __eq__(self, other: Any) -> bool: if isinstance(other, RecordField): return bool( @@ -1217,8 +1216,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "RecordField": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -1376,7 +1375,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -1401,8 +1400,8 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), doc=doc, - name=name, type_=type_, extension_fields=extension_fields, loadingOptions=loadingOptions, @@ -1441,16 +1440,13 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["doc", "name", "type"]) - - -class RecordSchema(Saveable): def __init__( self, - type_: Any, - fields: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + name: str, + type_: ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | Sequence[ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | UnionSchema | str] | UnionSchema | str, + doc: None | Sequence[str] | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -1460,9 +1456,14 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields = fields - self.type_ = type_ + self.doc: None | Sequence[str] | str = doc + self.name: str = name + self.type_: ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | Sequence[ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | UnionSchema | str] | UnionSchema | str = type_ + + attrs: ClassVar[Collection[str]] = frozenset(["doc", "name", "type"]) + +class RecordSchema(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, RecordSchema): return bool(self.fields == other.fields and self.type_ == other.type_) @@ -1477,8 +1478,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "RecordSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -1580,7 +1581,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -1640,24 +1641,12 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["fields", "type"]) - - -class EnumSchema(Saveable): - """ - Define an enumerated type. - - """ - - name: str - def __init__( self, - symbols: Any, - type_: Any, - name: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + type_: Literal["record"], + fields: None | Sequence[RecordField] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -1667,9 +1656,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.symbols = symbols - self.type_ = type_ + self.fields: None | Sequence[RecordField] = fields + self.type_: Literal["record"] = type_ + + attrs: ClassVar[Collection[str]] = frozenset(["fields", "type"]) + + +class EnumSchema(Saveable): + """ + Define an enumerated type. + + """ + + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, EnumSchema): @@ -1689,8 +1688,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "EnumSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -1849,7 +1848,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -1874,7 +1873,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=name, + name=cast(str, name), symbols=symbols, type_=type_, extension_fields=extension_fields, @@ -1913,16 +1912,13 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["name", "symbols", "type"]) - - -class ArraySchema(Saveable): def __init__( self, - items: Any, - type_: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + symbols: Sequence[str], + type_: Literal["enum"], + name: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -1932,9 +1928,14 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items - self.type_ = type_ + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols: Sequence[str] = symbols + self.type_: Literal["enum"] = type_ + attrs: ClassVar[Collection[str]] = frozenset(["name", "symbols", "type"]) + + +class ArraySchema(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, ArraySchema): return bool(self.items == other.items and self.type_ == other.type_) @@ -1949,8 +1950,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "ArraySchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -2053,7 +2054,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -2112,16 +2113,12 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["items", "type"]) - - -class MapSchema(Saveable): def __init__( self, - type_: Any, - values: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + items: ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | Sequence[ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | UnionSchema | str] | UnionSchema | str, + type_: Literal["array"], + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -2131,9 +2128,13 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.type_ = type_ - self.values = values + self.items: ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | Sequence[ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | UnionSchema | str] | UnionSchema | str = items + self.type_: Literal["array"] = type_ + + attrs: ClassVar[Collection[str]] = frozenset(["items", "type"]) + +class MapSchema(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, MapSchema): return bool(self.type_ == other.type_ and self.values == other.values) @@ -2148,8 +2149,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "MapSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -2252,7 +2253,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -2311,16 +2312,12 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["type", "values"]) - - -class UnionSchema(Saveable): def __init__( self, - names: Any, - type_: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + type_: Literal["map"], + values: ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | Sequence[ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | UnionSchema | str] | UnionSchema | str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -2330,9 +2327,13 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.names = names - self.type_ = type_ + self.type_: Literal["map"] = type_ + self.values: ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | Sequence[ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | UnionSchema | str] | UnionSchema | str = values + attrs: ClassVar[Collection[str]] = frozenset(["type", "values"]) + + +class UnionSchema(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, UnionSchema): return bool(self.names == other.names and self.type_ == other.type_) @@ -2347,8 +2348,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "UnionSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -2451,7 +2452,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -2510,16 +2511,12 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["names", "type"]) - - -class CWLArraySchema(ArraySchema): def __init__( self, - items: Any, - type_: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + names: ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | Sequence[ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | UnionSchema | str] | UnionSchema | str, + type_: Literal["union"], + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -2529,9 +2526,13 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items - self.type_ = type_ + self.names: ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | Sequence[ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | UnionSchema | str] | UnionSchema | str = names + self.type_: Literal["union"] = type_ + + attrs: ClassVar[Collection[str]] = frozenset(["names", "type"]) + +class CWLArraySchema(ArraySchema): def __eq__(self, other: Any) -> bool: if isinstance(other, CWLArraySchema): return bool(self.items == other.items and self.type_ == other.type_) @@ -2546,8 +2547,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CWLArraySchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -2650,7 +2651,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -2709,19 +2710,12 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["items", "type"]) - - -class CWLRecordField(RecordField): - name: str - def __init__( self, - name: Any, - type_: Any, - doc: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + items: CWLArraySchema | CWLRecordSchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | Sequence[CWLArraySchema | CWLRecordSchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | str] | str, + type_: Literal["array"], + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -2731,9 +2725,14 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.type_ = type_ + self.items: CWLArraySchema | CWLRecordSchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | Sequence[CWLArraySchema | CWLRecordSchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | str] | str = items + self.type_: Literal["array"] = type_ + + attrs: ClassVar[Collection[str]] = frozenset(["items", "type"]) + + +class CWLRecordField(RecordField): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, CWLRecordField): @@ -2753,8 +2752,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CWLRecordField": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -2912,7 +2911,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -2937,8 +2936,8 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), doc=doc, - name=name, type_=type_, extension_fields=extension_fields, loadingOptions=loadingOptions, @@ -2977,16 +2976,13 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["doc", "name", "type"]) - - -class CWLRecordSchema(RecordSchema): def __init__( self, - type_: Any, - fields: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + name: str, + type_: CWLArraySchema | CWLRecordSchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | Sequence[CWLArraySchema | CWLRecordSchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | str] | str, + doc: None | Sequence[str] | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -2996,9 +2992,14 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields = fields - self.type_ = type_ + self.doc: None | Sequence[str] | str = doc + self.name: str = name + self.type_: CWLArraySchema | CWLRecordSchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | Sequence[CWLArraySchema | CWLRecordSchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | str] | str = type_ + + attrs: ClassVar[Collection[str]] = frozenset(["doc", "name", "type"]) + +class CWLRecordSchema(RecordSchema): def __eq__(self, other: Any) -> bool: if isinstance(other, CWLRecordSchema): return bool(self.fields == other.fields and self.type_ == other.type_) @@ -3013,8 +3014,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CWLRecordSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -3116,7 +3117,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -3176,7 +3177,25 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["fields", "type"]) + def __init__( + self, + type_: Literal["record"], + fields: None | Sequence[CWLRecordField] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.fields: None | Sequence[CWLRecordField] = fields + self.type_: Literal["record"] = type_ + + attrs: ClassVar[Collection[str]] = frozenset(["fields", "type"]) class File(Saveable): @@ -3250,43 +3269,6 @@ class File(Saveable): """ - def __init__( - self, - location: Optional[Any] = None, - path: Optional[Any] = None, - basename: Optional[Any] = None, - dirname: Optional[Any] = None, - nameroot: Optional[Any] = None, - nameext: Optional[Any] = None, - checksum: Optional[Any] = None, - size: Optional[Any] = None, - secondaryFiles: Optional[Any] = None, - format: Optional[Any] = None, - contents: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "File" - self.location = location - self.path = path - self.basename = basename - self.dirname = dirname - self.nameroot = nameroot - self.nameext = nameext - self.checksum = checksum - self.size = size - self.secondaryFiles = secondaryFiles - self.format = format - self.contents = contents - def __eq__(self, other: Any) -> bool: if isinstance(other, File): return bool( @@ -3329,8 +3311,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "File": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -3687,7 +3669,7 @@ def fromDoc( try: size = load_field( _doc.get("size"), - union_of_None_type_or_inttype, + union_of_None_type_or_inttype_or_inttype, baseuri, loadingOptions, lc=_doc.get("size") @@ -3870,7 +3852,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -3983,7 +3965,44 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + location: None | str = None, + path: None | str = None, + basename: None | str = None, + dirname: None | str = None, + nameroot: None | str = None, + nameext: None | str = None, + checksum: None | str = None, + size: None | i32 = None, + secondaryFiles: None | Sequence[Directory | File] = None, + format: None | str = None, + contents: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "File" + self.location: None | str = location + self.path: None | str = path + self.basename: None | str = basename + self.dirname: None | str = dirname + self.nameroot: None | str = nameroot + self.nameext: None | str = nameext + self.checksum: None | str = checksum + self.size: None | i32 = size + self.secondaryFiles: None | Sequence[Directory | File] = secondaryFiles + self.format: None | str = format + self.contents: None | str = contents + + attrs: ClassVar[Collection[str]] = frozenset( [ "class", "location", @@ -4049,29 +4068,6 @@ class Directory(Saveable): """ - def __init__( - self, - location: Optional[Any] = None, - path: Optional[Any] = None, - basename: Optional[Any] = None, - listing: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "Directory" - self.location = location - self.path = path - self.basename = basename - self.listing = listing - def __eq__(self, other: Any) -> bool: if isinstance(other, Directory): return bool( @@ -4094,8 +4090,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "Directory": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -4306,7 +4302,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -4382,65 +4378,75 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "location", "path", "basename", "listing"]) + def __init__( + self, + location: None | str = None, + path: None | str = None, + basename: None | str = None, + listing: None | Sequence[Directory | File] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "Directory" + self.location: None | str = location + self.path: None | str = path + self.basename: None | str = basename + self.listing: None | Sequence[Directory | File] = listing + + attrs: ClassVar[Collection[str]] = frozenset( + ["class", "location", "path", "basename", "listing"] + ) -class SchemaBase(Saveable): - pass +@trait +class SchemaBase(Saveable, metaclass=ABCMeta): + label: None | str -class Parameter(SchemaBase): +@trait +class Parameter(SchemaBase, metaclass=ABCMeta): """ Define an input or output parameter to a process. """ - pass + label: None | str + secondaryFiles: None | Sequence[str] | str + streamable: None | bool + doc: None | Sequence[str] | str -class InputBinding(Saveable): - pass +@trait +class InputBinding(Saveable, metaclass=ABCMeta): + loadContents: None | bool -class OutputBinding(Saveable): +@trait +class OutputBinding(Saveable, metaclass=ABCMeta): pass -class InputSchema(SchemaBase): - pass +@trait +class InputSchema(SchemaBase, metaclass=ABCMeta): + label: None | str -class OutputSchema(SchemaBase): - pass +@trait +class OutputSchema(SchemaBase, metaclass=ABCMeta): + label: None | str class InputRecordField(CWLRecordField): name: str - def __init__( - self, - name: Any, - type_: Any, - doc: Optional[Any] = None, - inputBinding: Optional[Any] = None, - label: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.type_ = type_ - self.inputBinding = inputBinding - self.label = label - def __eq__(self, other: Any) -> bool: if isinstance(other, InputRecordField): return bool( @@ -4461,8 +4467,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "InputRecordField": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -4714,7 +4720,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -4739,8 +4745,8 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), doc=doc, - name=name, type_=type_, inputBinding=inputBinding, label=label, @@ -4792,20 +4798,15 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["doc", "name", "type", "inputBinding", "label"]) - - -class InputRecordSchema(CWLRecordSchema, InputSchema): - name: str - def __init__( self, - type_: Any, - fields: Optional[Any] = None, - label: Optional[Any] = None, - name: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + name: str, + type_: InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str, + doc: None | Sequence[str] | str = None, + inputBinding: CommandLineBinding | None = None, + label: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -4815,10 +4816,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields = fields - self.type_ = type_ - self.label = label - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.doc: None | Sequence[str] | str = doc + self.name: str = name + self.type_: InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str = type_ + self.inputBinding: CommandLineBinding | None = inputBinding + self.label: None | str = label + + attrs: ClassVar[Collection[str]] = frozenset( + ["doc", "name", "type", "inputBinding", "label"] + ) + + +class InputRecordSchema(CWLRecordSchema, InputSchema): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, InputRecordSchema): @@ -4839,8 +4849,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "InputRecordSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -5045,7 +5055,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -5070,10 +5080,10 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), fields=fields, type_=type_, label=label, - name=name, extension_fields=extension_fields, loadingOptions=loadingOptions, ) @@ -5115,21 +5125,14 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["fields", "type", "label", "name"]) - - -class InputEnumSchema(EnumSchema, InputSchema): - name: str - def __init__( self, - symbols: Any, - type_: Any, - name: Optional[Any] = None, - label: Optional[Any] = None, - inputBinding: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + type_: Literal["record"], + fields: None | Sequence[InputRecordField] = None, + label: None | str = None, + name: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -5139,11 +5142,16 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.symbols = symbols - self.type_ = type_ - self.label = label - self.inputBinding = inputBinding + self.fields: None | Sequence[InputRecordField] = fields + self.type_: Literal["record"] = type_ + self.label: None | str = label + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + + attrs: ClassVar[Collection[str]] = frozenset(["fields", "type", "label", "name"]) + + +class InputEnumSchema(EnumSchema, InputSchema): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, InputEnumSchema): @@ -5167,8 +5175,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "InputEnumSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -5421,7 +5429,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -5446,7 +5454,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=name, + name=cast(str, name), symbols=symbols, type_=type_, label=label, @@ -5498,18 +5506,15 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["name", "symbols", "type", "label", "inputBinding"]) - - -class InputArraySchema(CWLArraySchema, InputSchema): def __init__( self, - items: Any, - type_: Any, - label: Optional[Any] = None, - inputBinding: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + symbols: Sequence[str], + type_: Literal["enum"], + name: None | str = None, + label: None | str = None, + inputBinding: CommandLineBinding | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -5519,11 +5524,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items - self.type_ = type_ - self.label = label - self.inputBinding = inputBinding + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols: Sequence[str] = symbols + self.type_: Literal["enum"] = type_ + self.label: None | str = label + self.inputBinding: CommandLineBinding | None = inputBinding + + attrs: ClassVar[Collection[str]] = frozenset( + ["name", "symbols", "type", "label", "inputBinding"] + ) + +class InputArraySchema(CWLArraySchema, InputSchema): def __eq__(self, other: Any) -> bool: if isinstance(other, InputArraySchema): return bool( @@ -5543,8 +5555,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "InputArraySchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -5741,7 +5753,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -5813,20 +5825,14 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["items", "type", "label", "inputBinding"]) - - -class OutputRecordField(CWLRecordField): - name: str - def __init__( self, - name: Any, - type_: Any, - doc: Optional[Any] = None, - outputBinding: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + items: InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str, + type_: Literal["array"], + label: None | str = None, + inputBinding: CommandLineBinding | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -5836,10 +5842,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.type_ = type_ - self.outputBinding = outputBinding + self.items: InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str = items + self.type_: Literal["array"] = type_ + self.label: None | str = label + self.inputBinding: CommandLineBinding | None = inputBinding + + attrs: ClassVar[Collection[str]] = frozenset( + ["items", "type", "label", "inputBinding"] + ) + + +class OutputRecordField(CWLRecordField): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, OutputRecordField): @@ -5860,8 +5874,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "OutputRecordField": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -6066,7 +6080,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -6091,8 +6105,8 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), doc=doc, - name=name, type_=type_, outputBinding=outputBinding, extension_fields=extension_fields, @@ -6139,17 +6153,14 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["doc", "name", "type", "outputBinding"]) - - -class OutputRecordSchema(CWLRecordSchema, OutputSchema): def __init__( self, - type_: Any, - fields: Optional[Any] = None, - label: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + name: str, + type_: Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str, + doc: None | Sequence[str] | str = None, + outputBinding: CommandOutputBinding | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -6159,10 +6170,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields = fields - self.type_ = type_ - self.label = label + self.doc: None | Sequence[str] | str = doc + self.name: str = name + self.type_: Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str = type_ + self.outputBinding: CommandOutputBinding | None = outputBinding + + attrs: ClassVar[Collection[str]] = frozenset( + ["doc", "name", "type", "outputBinding"] + ) + +class OutputRecordSchema(CWLRecordSchema, OutputSchema): def __eq__(self, other: Any) -> bool: if isinstance(other, OutputRecordSchema): return bool( @@ -6181,8 +6199,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "OutputRecordSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -6331,7 +6349,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -6396,21 +6414,13 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["fields", "type", "label"]) - - -class OutputEnumSchema(EnumSchema, OutputSchema): - name: str - def __init__( self, - symbols: Any, - type_: Any, - name: Optional[Any] = None, - label: Optional[Any] = None, - outputBinding: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + type_: Literal["record"], + fields: None | Sequence[OutputRecordField] = None, + label: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -6420,13 +6430,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.symbols = symbols - self.type_ = type_ - self.label = label - self.outputBinding = outputBinding + self.fields: None | Sequence[OutputRecordField] = fields + self.type_: Literal["record"] = type_ + self.label: None | str = label - def __eq__(self, other: Any) -> bool: + attrs: ClassVar[Collection[str]] = frozenset(["fields", "type", "label"]) + + +class OutputEnumSchema(EnumSchema, OutputSchema): + name: str + + def __eq__(self, other: Any) -> bool: if isinstance(other, OutputEnumSchema): return bool( self.name == other.name @@ -6448,8 +6462,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "OutputEnumSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -6702,7 +6716,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -6727,7 +6741,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=name, + name=cast(str, name), symbols=symbols, type_=type_, label=label, @@ -6779,18 +6793,15 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["name", "symbols", "type", "label", "outputBinding"]) - - -class OutputArraySchema(CWLArraySchema, OutputSchema): def __init__( self, - items: Any, - type_: Any, - label: Optional[Any] = None, - outputBinding: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + symbols: Sequence[str], + type_: Literal["enum"], + name: None | str = None, + label: None | str = None, + outputBinding: CommandOutputBinding | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -6800,11 +6811,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items - self.type_ = type_ - self.label = label - self.outputBinding = outputBinding + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols: Sequence[str] = symbols + self.type_: Literal["enum"] = type_ + self.label: None | str = label + self.outputBinding: CommandOutputBinding | None = outputBinding + + attrs: ClassVar[Collection[str]] = frozenset( + ["name", "symbols", "type", "label", "outputBinding"] + ) + +class OutputArraySchema(CWLArraySchema, OutputSchema): def __eq__(self, other: Any) -> bool: if isinstance(other, OutputArraySchema): return bool( @@ -6824,8 +6842,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "OutputArraySchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -7022,7 +7040,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -7094,25 +7112,14 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["items", "type", "label", "outputBinding"]) - - -class InputParameter(Parameter): - id: str - def __init__( self, - id: Any, - label: Optional[Any] = None, - secondaryFiles: Optional[Any] = None, - streamable: Optional[Any] = None, - doc: Optional[Any] = None, - format: Optional[Any] = None, - inputBinding: Optional[Any] = None, - default: Optional[Any] = None, - type_: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + items: Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str, + type_: Literal["array"], + label: None | str = None, + outputBinding: CommandOutputBinding | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -7122,15 +7129,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.format = format - self.inputBinding = inputBinding - self.default = default - self.type_ = type_ + self.items: Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str = items + self.type_: Literal["array"] = type_ + self.label: None | str = label + self.outputBinding: CommandOutputBinding | None = outputBinding + + attrs: ClassVar[Collection[str]] = frozenset( + ["items", "type", "label", "outputBinding"] + ) + + +class InputParameter(Parameter): + id: str def __eq__(self, other: Any) -> bool: if isinstance(other, InputParameter): @@ -7168,8 +7178,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "InputParameter": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -7608,7 +7618,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -7633,11 +7643,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + id=cast(str, id), label=label, secondaryFiles=secondaryFiles, streamable=streamable, doc=doc, - id=id, format=format, inputBinding=inputBinding, default=default, @@ -7711,7 +7721,39 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + id: str, + label: None | str = None, + secondaryFiles: None | Sequence[str] | str = None, + streamable: None | bool = None, + doc: None | Sequence[str] | str = None, + format: None | Sequence[str] | str = None, + inputBinding: CommandLineBinding | None = None, + default: CWLObjectType | None = None, + type_: InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | None | Sequence[InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.label: None | str = label + self.secondaryFiles: None | Sequence[str] | str = secondaryFiles + self.streamable: None | bool = streamable + self.doc: None | Sequence[str] | str = doc + self.id: str = id + self.format: None | Sequence[str] | str = format + self.inputBinding: CommandLineBinding | None = inputBinding + self.default: CWLObjectType | None = default + self.type_: InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | None | Sequence[InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str = type_ + + attrs: ClassVar[Collection[str]] = frozenset( [ "label", "secondaryFiles", @@ -7729,34 +7771,6 @@ def save( class OutputParameter(Parameter): id: str - def __init__( - self, - id: Any, - label: Optional[Any] = None, - secondaryFiles: Optional[Any] = None, - streamable: Optional[Any] = None, - doc: Optional[Any] = None, - outputBinding: Optional[Any] = None, - format: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.outputBinding = outputBinding - self.format = format - def __eq__(self, other: Any) -> bool: if isinstance(other, OutputParameter): return bool( @@ -7789,8 +7803,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "OutputParameter": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -8135,7 +8149,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -8160,11 +8174,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + id=cast(str, id), label=label, secondaryFiles=secondaryFiles, streamable=streamable, doc=doc, - id=id, outputBinding=outputBinding, format=format, extension_fields=extension_fields, @@ -8228,7 +8242,35 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + id: str, + label: None | str = None, + secondaryFiles: None | Sequence[str] | str = None, + streamable: None | bool = None, + doc: None | Sequence[str] | str = None, + outputBinding: CommandOutputBinding | None = None, + format: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.label: None | str = label + self.secondaryFiles: None | Sequence[str] | str = secondaryFiles + self.streamable: None | bool = streamable + self.doc: None | Sequence[str] | str = doc + self.id: str = id + self.outputBinding: CommandOutputBinding | None = outputBinding + self.format: None | str = format + + attrs: ClassVar[Collection[str]] = frozenset( [ "label", "secondaryFiles", @@ -8241,7 +8283,8 @@ def save( ) -class ProcessRequirement(Saveable): +@trait +class ProcessRequirement(Saveable, metaclass=ABCMeta): """ A process requirement declares a prerequisite that may or must be fulfilled before executing a process. See [`Process.hints`](#process) and @@ -8255,7 +8298,8 @@ class ProcessRequirement(Saveable): pass -class Process(Saveable): +@trait +class Process(Saveable, metaclass=ABCMeta): """ The base executable type in CWL is the `Process` object defined by the @@ -8264,7 +8308,14 @@ class Process(Saveable): """ - pass + id: None | str + inputs: Sequence[InputParameter] + outputs: Sequence[OutputParameter] + requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | TimeLimit | WorkReuse] + hints: None | Sequence[Any | CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | TimeLimit | WorkReuse] + label: None | str + doc: None | str + cwlVersion: Literal["v1.0"] | None class InlineJavascriptRequirement(ProcessRequirement): @@ -8275,23 +8326,6 @@ class InlineJavascriptRequirement(ProcessRequirement): """ - def __init__( - self, - expressionLib: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "InlineJavascriptRequirement" - self.expressionLib = expressionLib - def __eq__(self, other: Any) -> bool: if isinstance(other, InlineJavascriptRequirement): return bool( @@ -8309,8 +8343,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "InlineJavascriptRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -8380,7 +8414,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -8446,7 +8480,24 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "expressionLib"]) + def __init__( + self, + expressionLib: None | Sequence[str] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "InlineJavascriptRequirement" + self.expressionLib: None | Sequence[str] = expressionLib + + attrs: ClassVar[Collection[str]] = frozenset(["class", "expressionLib"]) class SchemaDefRequirement(ProcessRequirement): @@ -8461,23 +8512,6 @@ class SchemaDefRequirement(ProcessRequirement): """ - def __init__( - self, - types: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "SchemaDefRequirement" - self.types = types - def __eq__(self, other: Any) -> bool: if isinstance(other, SchemaDefRequirement): return bool(self.class_ == other.class_ and self.types == other.types) @@ -8492,8 +8526,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "SchemaDefRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -8564,7 +8598,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -8627,23 +8661,11 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "types"]) - - -class EnvironmentDef(Saveable): - """ - Define an environment variable that will be set in the runtime environment - by the workflow platform when executing the command line tool. May be the - result of executing an expression, such as getting a parameter from input. - - """ - def __init__( self, - envName: Any, - envValue: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + types: Sequence[InputArraySchema | InputEnumSchema | InputRecordSchema], + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -8653,8 +8675,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.envName = envName - self.envValue = envValue + self.class_: Final[str] = "SchemaDefRequirement" + self.types: Sequence[InputArraySchema | InputEnumSchema | InputRecordSchema] = types + + attrs: ClassVar[Collection[str]] = frozenset(["class", "types"]) + + +class EnvironmentDef(Saveable): + """ + Define an environment variable that will be set in the runtime environment + by the workflow platform when executing the command line tool. May be the + result of executing an expression, such as getting a parameter from input. + + """ def __eq__(self, other: Any) -> bool: if isinstance(other, EnvironmentDef): @@ -8672,8 +8705,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "EnvironmentDef": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -8776,7 +8809,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -8836,7 +8869,25 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["envName", "envValue"]) + def __init__( + self, + envName: str, + envValue: str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.envName: str = envName + self.envValue: str = envValue + + attrs: ClassVar[Collection[str]] = frozenset(["envName", "envValue"]) class CommandLineBinding(InputBinding): @@ -8879,34 +8930,6 @@ class CommandLineBinding(InputBinding): """ - def __init__( - self, - loadContents: Optional[Any] = None, - position: Optional[Any] = None, - prefix: Optional[Any] = None, - separate: Optional[Any] = None, - itemSeparator: Optional[Any] = None, - valueFrom: Optional[Any] = None, - shellQuote: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.loadContents = loadContents - self.position = position - self.prefix = prefix - self.separate = separate - self.itemSeparator = itemSeparator - self.valueFrom = valueFrom - self.shellQuote = shellQuote - def __eq__(self, other: Any) -> bool: if isinstance(other, CommandLineBinding): return bool( @@ -8939,8 +8962,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandLineBinding": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -9276,7 +9299,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -9373,7 +9396,35 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + loadContents: None | bool = None, + position: None | i32 = None, + prefix: None | str = None, + separate: None | bool = None, + itemSeparator: None | str = None, + valueFrom: None | str = None, + shellQuote: None | bool = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.loadContents: None | bool = loadContents + self.position: None | i32 = position + self.prefix: None | str = prefix + self.separate: None | bool = separate + self.itemSeparator: None | str = itemSeparator + self.valueFrom: None | str = valueFrom + self.shellQuote: None | bool = shellQuote + + attrs: ClassVar[Collection[str]] = frozenset( [ "loadContents", "position", @@ -9401,26 +9452,6 @@ class CommandOutputBinding(OutputBinding): """ - def __init__( - self, - glob: Optional[Any] = None, - loadContents: Optional[Any] = None, - outputEval: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.glob = glob - self.loadContents = loadContents - self.outputEval = outputEval - def __eq__(self, other: Any) -> bool: if isinstance(other, CommandOutputBinding): return bool( @@ -9439,8 +9470,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandOutputBinding": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -9588,7 +9619,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -9659,21 +9690,13 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["glob", "loadContents", "outputEval"]) - - -class CommandInputRecordField(InputRecordField): - name: str - def __init__( self, - name: Any, - type_: Any, - doc: Optional[Any] = None, - inputBinding: Optional[Any] = None, - label: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + glob: None | Sequence[str] | str = None, + loadContents: None | bool = None, + outputEval: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -9683,11 +9706,15 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.type_ = type_ - self.inputBinding = inputBinding - self.label = label + self.glob: None | Sequence[str] | str = glob + self.loadContents: None | bool = loadContents + self.outputEval: None | str = outputEval + + attrs: ClassVar[Collection[str]] = frozenset(["glob", "loadContents", "outputEval"]) + + +class CommandInputRecordField(InputRecordField): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, CommandInputRecordField): @@ -9709,8 +9736,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandInputRecordField": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -9962,7 +9989,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -9987,8 +10014,8 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), doc=doc, - name=name, type_=type_, inputBinding=inputBinding, label=label, @@ -10040,20 +10067,15 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["doc", "name", "type", "inputBinding", "label"]) - - -class CommandInputRecordSchema(InputRecordSchema): - name: str - def __init__( self, - type_: Any, - fields: Optional[Any] = None, - label: Optional[Any] = None, - name: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + name: str, + type_: CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str, + doc: None | Sequence[str] | str = None, + inputBinding: CommandLineBinding | None = None, + label: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -10063,10 +10085,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields = fields - self.type_ = type_ - self.label = label - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.doc: None | Sequence[str] | str = doc + self.name: str = name + self.type_: CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str = type_ + self.inputBinding: CommandLineBinding | None = inputBinding + self.label: None | str = label + + attrs: ClassVar[Collection[str]] = frozenset( + ["doc", "name", "type", "inputBinding", "label"] + ) + + +class CommandInputRecordSchema(InputRecordSchema): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, CommandInputRecordSchema): @@ -10087,8 +10118,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandInputRecordSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -10293,7 +10324,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -10318,10 +10349,10 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), fields=fields, type_=type_, label=label, - name=name, extension_fields=extension_fields, loadingOptions=loadingOptions, ) @@ -10363,21 +10394,14 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["fields", "type", "label", "name"]) - - -class CommandInputEnumSchema(InputEnumSchema): - name: str - def __init__( self, - symbols: Any, - type_: Any, - name: Optional[Any] = None, - label: Optional[Any] = None, - inputBinding: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + type_: Literal["record"], + fields: None | Sequence[CommandInputRecordField] = None, + label: None | str = None, + name: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -10387,11 +10411,16 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.symbols = symbols - self.type_ = type_ - self.label = label - self.inputBinding = inputBinding + self.fields: None | Sequence[CommandInputRecordField] = fields + self.type_: Literal["record"] = type_ + self.label: None | str = label + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + + attrs: ClassVar[Collection[str]] = frozenset(["fields", "type", "label", "name"]) + + +class CommandInputEnumSchema(InputEnumSchema): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, CommandInputEnumSchema): @@ -10415,8 +10444,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandInputEnumSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -10669,7 +10698,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -10694,7 +10723,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=name, + name=cast(str, name), symbols=symbols, type_=type_, label=label, @@ -10746,18 +10775,15 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["name", "symbols", "type", "label", "inputBinding"]) - - -class CommandInputArraySchema(InputArraySchema): def __init__( self, - items: Any, - type_: Any, - label: Optional[Any] = None, - inputBinding: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + symbols: Sequence[str], + type_: Literal["enum"], + name: None | str = None, + label: None | str = None, + inputBinding: CommandLineBinding | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -10767,11 +10793,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items - self.type_ = type_ - self.label = label - self.inputBinding = inputBinding + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols: Sequence[str] = symbols + self.type_: Literal["enum"] = type_ + self.label: None | str = label + self.inputBinding: CommandLineBinding | None = inputBinding + + attrs: ClassVar[Collection[str]] = frozenset( + ["name", "symbols", "type", "label", "inputBinding"] + ) + +class CommandInputArraySchema(InputArraySchema): def __eq__(self, other: Any) -> bool: if isinstance(other, CommandInputArraySchema): return bool( @@ -10791,8 +10824,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandInputArraySchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -10989,7 +11022,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -11061,20 +11094,14 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["items", "type", "label", "inputBinding"]) - - -class CommandOutputRecordField(OutputRecordField): - name: str - def __init__( self, - name: Any, - type_: Any, - doc: Optional[Any] = None, - outputBinding: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + items: CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str, + type_: Literal["array"], + label: None | str = None, + inputBinding: CommandLineBinding | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -11084,10 +11111,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.type_ = type_ - self.outputBinding = outputBinding + self.items: CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str = items + self.type_: Literal["array"] = type_ + self.label: None | str = label + self.inputBinding: CommandLineBinding | None = inputBinding + + attrs: ClassVar[Collection[str]] = frozenset( + ["items", "type", "label", "inputBinding"] + ) + + +class CommandOutputRecordField(OutputRecordField): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, CommandOutputRecordField): @@ -11108,8 +11143,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandOutputRecordField": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -11314,7 +11349,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -11339,8 +11374,8 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), doc=doc, - name=name, type_=type_, outputBinding=outputBinding, extension_fields=extension_fields, @@ -11387,20 +11422,14 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["doc", "name", "type", "outputBinding"]) - - -class CommandOutputRecordSchema(OutputRecordSchema): - name: str - def __init__( self, - type_: Any, - fields: Optional[Any] = None, - label: Optional[Any] = None, - name: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + name: str, + type_: CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str, + doc: None | Sequence[str] | str = None, + outputBinding: CommandOutputBinding | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -11410,10 +11439,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields = fields - self.type_ = type_ - self.label = label - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.doc: None | Sequence[str] | str = doc + self.name: str = name + self.type_: CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str = type_ + self.outputBinding: CommandOutputBinding | None = outputBinding + + attrs: ClassVar[Collection[str]] = frozenset( + ["doc", "name", "type", "outputBinding"] + ) + + +class CommandOutputRecordSchema(OutputRecordSchema): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, CommandOutputRecordSchema): @@ -11434,8 +11471,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandOutputRecordSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -11640,7 +11677,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -11665,10 +11702,10 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), fields=fields, type_=type_, label=label, - name=name, extension_fields=extension_fields, loadingOptions=loadingOptions, ) @@ -11710,21 +11747,14 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["fields", "type", "label", "name"]) - - -class CommandOutputEnumSchema(OutputEnumSchema): - name: str - def __init__( self, - symbols: Any, - type_: Any, - name: Optional[Any] = None, - label: Optional[Any] = None, - outputBinding: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + type_: Literal["record"], + fields: None | Sequence[CommandOutputRecordField] = None, + label: None | str = None, + name: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -11734,11 +11764,16 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.symbols = symbols - self.type_ = type_ - self.label = label - self.outputBinding = outputBinding + self.fields: None | Sequence[CommandOutputRecordField] = fields + self.type_: Literal["record"] = type_ + self.label: None | str = label + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + + attrs: ClassVar[Collection[str]] = frozenset(["fields", "type", "label", "name"]) + + +class CommandOutputEnumSchema(OutputEnumSchema): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, CommandOutputEnumSchema): @@ -11762,8 +11797,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandOutputEnumSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -12016,7 +12051,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -12041,7 +12076,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=name, + name=cast(str, name), symbols=symbols, type_=type_, label=label, @@ -12093,18 +12128,15 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["name", "symbols", "type", "label", "outputBinding"]) - - -class CommandOutputArraySchema(OutputArraySchema): def __init__( self, - items: Any, - type_: Any, - label: Optional[Any] = None, - outputBinding: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + symbols: Sequence[str], + type_: Literal["enum"], + name: None | str = None, + label: None | str = None, + outputBinding: CommandOutputBinding | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -12114,11 +12146,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items - self.type_ = type_ - self.label = label - self.outputBinding = outputBinding + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols: Sequence[str] = symbols + self.type_: Literal["enum"] = type_ + self.label: None | str = label + self.outputBinding: CommandOutputBinding | None = outputBinding + + attrs: ClassVar[Collection[str]] = frozenset( + ["name", "symbols", "type", "label", "outputBinding"] + ) + +class CommandOutputArraySchema(OutputArraySchema): def __eq__(self, other: Any) -> bool: if isinstance(other, CommandOutputArraySchema): return bool( @@ -12138,8 +12177,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandOutputArraySchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -12336,7 +12375,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -12408,29 +12447,14 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["items", "type", "label", "outputBinding"]) - - -class CommandInputParameter(InputParameter): - """ - An input parameter for a CommandLineTool. - """ - - id: str - def __init__( self, - id: Any, - label: Optional[Any] = None, - secondaryFiles: Optional[Any] = None, - streamable: Optional[Any] = None, - doc: Optional[Any] = None, - format: Optional[Any] = None, - inputBinding: Optional[Any] = None, - default: Optional[Any] = None, - type_: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + items: CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str, + type_: Literal["array"], + label: None | str = None, + outputBinding: CommandOutputBinding | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -12440,15 +12464,22 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.format = format - self.inputBinding = inputBinding - self.default = default - self.type_ = type_ + self.items: CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str = items + self.type_: Literal["array"] = type_ + self.label: None | str = label + self.outputBinding: CommandOutputBinding | None = outputBinding + + attrs: ClassVar[Collection[str]] = frozenset( + ["items", "type", "label", "outputBinding"] + ) + + +class CommandInputParameter(InputParameter): + """ + An input parameter for a CommandLineTool. + """ + + id: str def __eq__(self, other: Any) -> bool: if isinstance(other, CommandInputParameter): @@ -12486,8 +12517,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandInputParameter": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -12926,7 +12957,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -12951,11 +12982,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + id=cast(str, id), label=label, secondaryFiles=secondaryFiles, streamable=streamable, doc=doc, - id=id, format=format, inputBinding=inputBinding, default=default, @@ -13029,9 +13060,41 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( - [ - "label", + def __init__( + self, + id: str, + label: None | str = None, + secondaryFiles: None | Sequence[str] | str = None, + streamable: None | bool = None, + doc: None | Sequence[str] | str = None, + format: None | Sequence[str] | str = None, + inputBinding: CommandLineBinding | None = None, + default: CWLObjectType | None = None, + type_: CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | None | Sequence[CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.label: None | str = label + self.secondaryFiles: None | Sequence[str] | str = secondaryFiles + self.streamable: None | bool = streamable + self.doc: None | Sequence[str] | str = doc + self.id: str = id + self.format: None | Sequence[str] | str = format + self.inputBinding: CommandLineBinding | None = inputBinding + self.default: CWLObjectType | None = default + self.type_: CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | None | Sequence[CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str = type_ + + attrs: ClassVar[Collection[str]] = frozenset( + [ + "label", "secondaryFiles", "streamable", "doc", @@ -13051,36 +13114,6 @@ class CommandOutputParameter(OutputParameter): id: str - def __init__( - self, - id: Any, - label: Optional[Any] = None, - secondaryFiles: Optional[Any] = None, - streamable: Optional[Any] = None, - doc: Optional[Any] = None, - outputBinding: Optional[Any] = None, - format: Optional[Any] = None, - type_: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.outputBinding = outputBinding - self.format = format - self.type_ = type_ - def __eq__(self, other: Any) -> bool: if isinstance(other, CommandOutputParameter): return bool( @@ -13115,8 +13148,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandOutputParameter": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -13508,7 +13541,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -13533,11 +13566,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + id=cast(str, id), label=label, secondaryFiles=secondaryFiles, streamable=streamable, doc=doc, - id=id, outputBinding=outputBinding, format=format, type_=type_, @@ -13606,7 +13639,37 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + id: str, + label: None | str = None, + secondaryFiles: None | Sequence[str] | str = None, + streamable: None | bool = None, + doc: None | Sequence[str] | str = None, + outputBinding: CommandOutputBinding | None = None, + format: None | str = None, + type_: CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Literal["stderr"] | Literal["stdout"] | None | Sequence[CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.label: None | str = label + self.secondaryFiles: None | Sequence[str] | str = secondaryFiles + self.streamable: None | bool = streamable + self.doc: None | Sequence[str] | str = doc + self.id: str = id + self.outputBinding: CommandOutputBinding | None = outputBinding + self.format: None | str = format + self.type_: CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Literal["stderr"] | Literal["stdout"] | None | Sequence[CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str = type_ + + attrs: ClassVar[Collection[str]] = frozenset( [ "label", "secondaryFiles", @@ -13628,53 +13691,6 @@ class CommandLineTool(Process): id: str - def __init__( - self, - inputs: Any, - outputs: Any, - id: Optional[Any] = None, - requirements: Optional[Any] = None, - hints: Optional[Any] = None, - label: Optional[Any] = None, - doc: Optional[Any] = None, - cwlVersion: Optional[Any] = None, - baseCommand: Optional[Any] = None, - arguments: Optional[Any] = None, - stdin: Optional[Any] = None, - stderr: Optional[Any] = None, - stdout: Optional[Any] = None, - successCodes: Optional[Any] = None, - temporaryFailCodes: Optional[Any] = None, - permanentFailCodes: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.inputs = inputs - self.outputs = outputs - self.requirements = requirements - self.hints = hints - self.label = label - self.doc = doc - self.cwlVersion = cwlVersion - self.class_ = "CommandLineTool" - self.baseCommand = baseCommand - self.arguments = arguments - self.stdin = stdin - self.stderr = stderr - self.stdout = stdout - self.successCodes = successCodes - self.temporaryFailCodes = temporaryFailCodes - self.permanentFailCodes = permanentFailCodes - def __eq__(self, other: Any) -> bool: if isinstance(other, CommandLineTool): return bool( @@ -13727,8 +13743,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandLineTool": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -14514,7 +14530,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -14539,7 +14555,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=id, + id=cast(str, id), inputs=inputs, outputs=outputs, requirements=requirements, @@ -14666,7 +14682,54 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + inputs: Sequence[CommandInputParameter], + outputs: Sequence[CommandOutputParameter], + id: None | str = None, + requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | TimeLimit | WorkReuse] = None, + hints: None | Sequence[Any | CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | TimeLimit | WorkReuse] = None, + label: None | str = None, + doc: None | str = None, + cwlVersion: Literal["v1.0"] | None = None, + baseCommand: None | Sequence[str] | str = None, + arguments: None | Sequence[CommandLineBinding | str] = None, + stdin: None | str = None, + stderr: None | str = None, + stdout: None | str = None, + successCodes: None | Sequence[i32] = None, + temporaryFailCodes: None | Sequence[i32] = None, + permanentFailCodes: None | Sequence[i32] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.id: str = id if id is not None else "_:" + str(_uuid__.uuid4()) + self.inputs: Sequence[CommandInputParameter] = inputs + self.outputs: Sequence[CommandOutputParameter] = outputs + self.requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | TimeLimit | WorkReuse] = requirements + self.hints: None | Sequence[Any | CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | TimeLimit | WorkReuse] = hints + self.label: None | str = label + self.doc: None | str = doc + self.cwlVersion: Literal["v1.0"] | None = cwlVersion + self.class_: Final[str] = "CommandLineTool" + self.baseCommand: None | Sequence[str] | str = baseCommand + self.arguments: None | Sequence[CommandLineBinding | str] = arguments + self.stdin: None | str = stdin + self.stderr: None | str = stderr + self.stdout: None | str = stdout + self.successCodes: None | Sequence[i32] = successCodes + self.temporaryFailCodes: None | Sequence[i32] = temporaryFailCodes + self.permanentFailCodes: None | Sequence[i32] = permanentFailCodes + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "inputs", @@ -14727,33 +14790,6 @@ class DockerRequirement(ProcessRequirement): """ - def __init__( - self, - dockerPull: Optional[Any] = None, - dockerLoad: Optional[Any] = None, - dockerFile: Optional[Any] = None, - dockerImport: Optional[Any] = None, - dockerImageId: Optional[Any] = None, - dockerOutputDirectory: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "DockerRequirement" - self.dockerPull = dockerPull - self.dockerLoad = dockerLoad - self.dockerFile = dockerFile - self.dockerImport = dockerImport - self.dockerImageId = dockerImageId - self.dockerOutputDirectory = dockerOutputDirectory - def __eq__(self, other: Any) -> bool: if isinstance(other, DockerRequirement): return bool( @@ -14786,8 +14822,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "DockerRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -15092,7 +15128,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -15198,7 +15234,34 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + dockerPull: None | str = None, + dockerLoad: None | str = None, + dockerFile: None | str = None, + dockerImport: None | str = None, + dockerImageId: None | str = None, + dockerOutputDirectory: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "DockerRequirement" + self.dockerPull: None | str = dockerPull + self.dockerLoad: None | str = dockerLoad + self.dockerFile: None | str = dockerFile + self.dockerImport: None | str = dockerImport + self.dockerImageId: None | str = dockerImageId + self.dockerOutputDirectory: None | str = dockerOutputDirectory + + attrs: ClassVar[Collection[str]] = frozenset( [ "class", "dockerPull", @@ -15218,23 +15281,6 @@ class SoftwareRequirement(ProcessRequirement): """ - def __init__( - self, - packages: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "SoftwareRequirement" - self.packages = packages - def __eq__(self, other: Any) -> bool: if isinstance(other, SoftwareRequirement): return bool(self.class_ == other.class_ and self.packages == other.packages) @@ -15249,8 +15295,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "SoftwareRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -15321,7 +15367,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -15384,17 +15430,11 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "packages"]) - - -class SoftwarePackage(Saveable): def __init__( self, - package: Any, - version: Optional[Any] = None, - specs: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + packages: Sequence[SoftwarePackage], + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -15404,10 +15444,13 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.package = package - self.version = version - self.specs = specs + self.class_: Final[str] = "SoftwareRequirement" + self.packages: Sequence[SoftwarePackage] = packages + + attrs: ClassVar[Collection[str]] = frozenset(["class", "packages"]) + +class SoftwarePackage(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, SoftwarePackage): return bool( @@ -15426,8 +15469,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "SoftwarePackage": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -15576,7 +15619,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -15640,25 +15683,13 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["package", "version", "specs"]) - - -class Dirent(Saveable): - """ - Define a file or subdirectory that must be placed in the designated output - directory prior to executing the command line tool. May be the result of - executing an expression, such as building a configuration file from a - template. - - """ - def __init__( self, - entry: Any, - entryname: Optional[Any] = None, - writable: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + package: str, + version: None | Sequence[str] = None, + specs: None | Sequence[str] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -15668,9 +15699,21 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.entryname = entryname - self.entry = entry - self.writable = writable + self.package: str = package + self.version: None | Sequence[str] = version + self.specs: None | Sequence[str] = specs + + attrs: ClassVar[Collection[str]] = frozenset(["package", "version", "specs"]) + + +class Dirent(Saveable): + """ + Define a file or subdirectory that must be placed in the designated output + directory prior to executing the command line tool. May be the result of + executing an expression, such as building a configuration file from a + template. + + """ def __eq__(self, other: Any) -> bool: if isinstance(other, Dirent): @@ -15690,8 +15733,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "Dirent": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -15840,7 +15883,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -15908,19 +15951,13 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["entryname", "entry", "writable"]) - - -class InitialWorkDirRequirement(ProcessRequirement): - """ - Define a list of files and subdirectories that must be created by the workflow platform in the designated output directory prior to executing the command line tool. - """ - def __init__( self, - listing: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + entry: str, + entryname: None | str = None, + writable: None | bool = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -15930,8 +15967,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "InitialWorkDirRequirement" - self.listing = listing + self.entryname: None | str = entryname + self.entry: str = entry + self.writable: None | bool = writable + + attrs: ClassVar[Collection[str]] = frozenset(["entryname", "entry", "writable"]) + + +class InitialWorkDirRequirement(ProcessRequirement): + """ + Define a list of files and subdirectories that must be created by the workflow platform in the designated output directory prior to executing the command line tool. + """ def __eq__(self, other: Any) -> bool: if isinstance(other, InitialWorkDirRequirement): @@ -15947,8 +15993,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "InitialWorkDirRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -16019,7 +16065,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -16082,21 +16128,11 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "listing"]) - - -class EnvVarRequirement(ProcessRequirement): - """ - Define a list of environment variables which will be set in the - execution environment of the tool. See `EnvironmentDef` for details. - - """ - def __init__( self, - envDef: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + listing: Sequence[Directory | Dirent | File | str] | str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -16106,8 +16142,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "EnvVarRequirement" - self.envDef = envDef + self.class_: Final[str] = "InitialWorkDirRequirement" + self.listing: Sequence[Directory | Dirent | File | str] | str = listing + + attrs: ClassVar[Collection[str]] = frozenset(["class", "listing"]) + + +class EnvVarRequirement(ProcessRequirement): + """ + Define a list of environment variables which will be set in the + execution environment of the tool. See `EnvironmentDef` for details. + + """ def __eq__(self, other: Any) -> bool: if isinstance(other, EnvVarRequirement): @@ -16123,8 +16169,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "EnvVarRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -16195,7 +16241,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -16258,7 +16304,24 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "envDef"]) + def __init__( + self, + envDef: Sequence[EnvironmentDef], + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "EnvVarRequirement" + self.envDef: Sequence[EnvironmentDef] = envDef + + attrs: ClassVar[Collection[str]] = frozenset(["class", "envDef"]) class ShellCommandRequirement(ProcessRequirement): @@ -16273,21 +16336,6 @@ class ShellCommandRequirement(ProcessRequirement): """ - def __init__( - self, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "ShellCommandRequirement" - def __eq__(self, other: Any) -> bool: if isinstance(other, ShellCommandRequirement): return bool(self.class_ == other.class_) @@ -16302,8 +16350,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "ShellCommandRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -16326,7 +16374,7 @@ def fromDoc( raise ValidationException(f"tried `{cls.__name__}` but") except ValidationException as e: raise e - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -16382,7 +16430,22 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class"]) + def __init__( + self, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "ShellCommandRequirement" + + attrs: ClassVar[Collection[str]] = frozenset(["class"]) class ResourceRequirement(ProcessRequirement): @@ -16410,37 +16473,6 @@ class ResourceRequirement(ProcessRequirement): """ - def __init__( - self, - coresMin: Optional[Any] = None, - coresMax: Optional[Any] = None, - ramMin: Optional[Any] = None, - ramMax: Optional[Any] = None, - tmpdirMin: Optional[Any] = None, - tmpdirMax: Optional[Any] = None, - outdirMin: Optional[Any] = None, - outdirMax: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "ResourceRequirement" - self.coresMin = coresMin - self.coresMax = coresMax - self.ramMin = ramMin - self.ramMax = ramMax - self.tmpdirMin = tmpdirMin - self.tmpdirMax = tmpdirMax - self.outdirMin = outdirMin - self.outdirMax = outdirMax - def __eq__(self, other: Any) -> bool: if isinstance(other, ResourceRequirement): return bool( @@ -16477,8 +16509,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "ResourceRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -16506,7 +16538,7 @@ def fromDoc( try: coresMin = load_field( _doc.get("coresMin"), - union_of_None_type_or_inttype_or_strtype_or_ExpressionLoader, + union_of_None_type_or_inttype_or_inttype_or_strtype_or_ExpressionLoader, baseuri, loadingOptions, lc=_doc.get("coresMin") @@ -16600,7 +16632,7 @@ def fromDoc( try: ramMin = load_field( _doc.get("ramMin"), - union_of_None_type_or_inttype_or_strtype_or_ExpressionLoader, + union_of_None_type_or_inttype_or_inttype_or_strtype_or_ExpressionLoader, baseuri, loadingOptions, lc=_doc.get("ramMin") @@ -16647,7 +16679,7 @@ def fromDoc( try: ramMax = load_field( _doc.get("ramMax"), - union_of_None_type_or_inttype_or_strtype_or_ExpressionLoader, + union_of_None_type_or_inttype_or_inttype_or_strtype_or_ExpressionLoader, baseuri, loadingOptions, lc=_doc.get("ramMax") @@ -16741,7 +16773,7 @@ def fromDoc( try: tmpdirMax = load_field( _doc.get("tmpdirMax"), - union_of_None_type_or_inttype_or_strtype_or_ExpressionLoader, + union_of_None_type_or_inttype_or_inttype_or_strtype_or_ExpressionLoader, baseuri, loadingOptions, lc=_doc.get("tmpdirMax") @@ -16788,7 +16820,7 @@ def fromDoc( try: outdirMin = load_field( _doc.get("outdirMin"), - union_of_None_type_or_inttype_or_strtype_or_ExpressionLoader, + union_of_None_type_or_inttype_or_inttype_or_strtype_or_ExpressionLoader, baseuri, loadingOptions, lc=_doc.get("outdirMin") @@ -16835,7 +16867,7 @@ def fromDoc( try: outdirMax = load_field( _doc.get("outdirMax"), - union_of_None_type_or_inttype_or_strtype_or_ExpressionLoader, + union_of_None_type_or_inttype_or_inttype_or_strtype_or_ExpressionLoader, baseuri, loadingOptions, lc=_doc.get("outdirMax") @@ -16877,7 +16909,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -16987,7 +17019,38 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + coresMin: None | i32 | str = None, + coresMax: None | i32 | str = None, + ramMin: None | i32 | str = None, + ramMax: None | i32 | str = None, + tmpdirMin: None | i32 | str = None, + tmpdirMax: None | i32 | str = None, + outdirMin: None | i32 | str = None, + outdirMax: None | i32 | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "ResourceRequirement" + self.coresMin: None | i32 | str = coresMin + self.coresMax: None | i32 | str = coresMax + self.ramMin: None | i32 | str = ramMin + self.ramMax: None | i32 | str = ramMax + self.tmpdirMin: None | i32 | str = tmpdirMin + self.tmpdirMax: None | i32 | str = tmpdirMax + self.outdirMin: None | i32 | str = outdirMin + self.outdirMax: None | i32 | str = outdirMax + + attrs: ClassVar[Collection[str]] = frozenset( [ "class", "coresMin", @@ -17005,36 +17068,6 @@ def save( class ExpressionToolOutputParameter(OutputParameter): id: str - def __init__( - self, - id: Any, - label: Optional[Any] = None, - secondaryFiles: Optional[Any] = None, - streamable: Optional[Any] = None, - doc: Optional[Any] = None, - outputBinding: Optional[Any] = None, - format: Optional[Any] = None, - type_: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.outputBinding = outputBinding - self.format = format - self.type_ = type_ - def __eq__(self, other: Any) -> bool: if isinstance(other, ExpressionToolOutputParameter): return bool( @@ -17069,8 +17102,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "ExpressionToolOutputParameter": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -17462,7 +17495,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -17487,11 +17520,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + id=cast(str, id), label=label, secondaryFiles=secondaryFiles, streamable=streamable, doc=doc, - id=id, outputBinding=outputBinding, format=format, type_=type_, @@ -17560,7 +17593,37 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + id: str, + label: None | str = None, + secondaryFiles: None | Sequence[str] | str = None, + streamable: None | bool = None, + doc: None | Sequence[str] | str = None, + outputBinding: CommandOutputBinding | None = None, + format: None | str = None, + type_: Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | None | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.label: None | str = label + self.secondaryFiles: None | Sequence[str] | str = secondaryFiles + self.streamable: None | bool = streamable + self.doc: None | Sequence[str] | str = doc + self.id: str = id + self.outputBinding: CommandOutputBinding | None = outputBinding + self.format: None | str = format + self.type_: Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | None | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str = type_ + + attrs: ClassVar[Collection[str]] = frozenset( [ "label", "secondaryFiles", @@ -17582,39 +17645,6 @@ class ExpressionTool(Process): id: str - def __init__( - self, - inputs: Any, - outputs: Any, - expression: Any, - id: Optional[Any] = None, - requirements: Optional[Any] = None, - hints: Optional[Any] = None, - label: Optional[Any] = None, - doc: Optional[Any] = None, - cwlVersion: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.inputs = inputs - self.outputs = outputs - self.requirements = requirements - self.hints = hints - self.label = label - self.doc = doc - self.cwlVersion = cwlVersion - self.class_ = "ExpressionTool" - self.expression = expression - def __eq__(self, other: Any) -> bool: if isinstance(other, ExpressionTool): return bool( @@ -17653,8 +17683,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "ExpressionTool": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -18112,7 +18142,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -18137,7 +18167,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=id, + id=cast(str, id), inputs=inputs, outputs=outputs, requirements=requirements, @@ -18220,9 +18250,42 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( - [ - "id", + def __init__( + self, + inputs: Sequence[InputParameter], + outputs: Sequence[ExpressionToolOutputParameter], + expression: str, + id: None | str = None, + requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | TimeLimit | WorkReuse] = None, + hints: None | Sequence[Any | CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | TimeLimit | WorkReuse] = None, + label: None | str = None, + doc: None | str = None, + cwlVersion: Literal["v1.0"] | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.id: str = id if id is not None else "_:" + str(_uuid__.uuid4()) + self.inputs: Sequence[InputParameter] = inputs + self.outputs: Sequence[ExpressionToolOutputParameter] = outputs + self.requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | TimeLimit | WorkReuse] = requirements + self.hints: None | Sequence[Any | CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | TimeLimit | WorkReuse] = hints + self.label: None | str = label + self.doc: None | str = doc + self.cwlVersion: Literal["v1.0"] | None = cwlVersion + self.class_: Final[str] = "ExpressionTool" + self.expression: str = expression + + attrs: ClassVar[Collection[str]] = frozenset( + [ + "id", "inputs", "outputs", "requirements", @@ -18246,40 +18309,6 @@ class WorkflowOutputParameter(OutputParameter): id: str - def __init__( - self, - id: Any, - label: Optional[Any] = None, - secondaryFiles: Optional[Any] = None, - streamable: Optional[Any] = None, - doc: Optional[Any] = None, - outputBinding: Optional[Any] = None, - format: Optional[Any] = None, - outputSource: Optional[Any] = None, - linkMerge: Optional[Any] = None, - type_: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.outputBinding = outputBinding - self.format = format - self.outputSource = outputSource - self.linkMerge = linkMerge - self.type_ = type_ - def __eq__(self, other: Any) -> bool: if isinstance(other, WorkflowOutputParameter): return bool( @@ -18318,8 +18347,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "WorkflowOutputParameter": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -18805,7 +18834,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -18830,11 +18859,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + id=cast(str, id), label=label, secondaryFiles=secondaryFiles, streamable=streamable, doc=doc, - id=id, outputBinding=outputBinding, format=format, outputSource=outputSource, @@ -18912,7 +18941,41 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + id: str, + label: None | str = None, + secondaryFiles: None | Sequence[str] | str = None, + streamable: None | bool = None, + doc: None | Sequence[str] | str = None, + outputBinding: CommandOutputBinding | None = None, + format: None | str = None, + outputSource: None | Sequence[str] | str = None, + linkMerge: Literal["merge_nested", "merge_flattened"] | None = None, + type_: Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | None | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.label: None | str = label + self.secondaryFiles: None | Sequence[str] | str = secondaryFiles + self.streamable: None | bool = streamable + self.doc: None | Sequence[str] | str = doc + self.id: str = id + self.outputBinding: CommandOutputBinding | None = outputBinding + self.format: None | str = format + self.outputSource: None | Sequence[str] | str = outputSource + self.linkMerge: Literal["merge_nested", "merge_flattened"] | None = linkMerge + self.type_: Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | None | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str = type_ + + attrs: ClassVar[Collection[str]] = frozenset( [ "label", "secondaryFiles", @@ -18928,8 +18991,10 @@ def save( ) -class Sink(Saveable): - pass +@trait +class Sink(Saveable, metaclass=ABCMeta): + source: None | Sequence[str] | str + linkMerge: Literal["merge_nested", "merge_flattened"] | None class WorkflowStepInput(Sink): @@ -18978,30 +19043,6 @@ class WorkflowStepInput(Sink): id: str - def __init__( - self, - id: Any, - source: Optional[Any] = None, - linkMerge: Optional[Any] = None, - default: Optional[Any] = None, - valueFrom: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.source = source - self.linkMerge = linkMerge - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.default = default - self.valueFrom = valueFrom - def __eq__(self, other: Any) -> bool: if isinstance(other, WorkflowStepInput): return bool( @@ -19024,8 +19065,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "WorkflowStepInput": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -19276,7 +19317,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -19301,9 +19342,9 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + id=cast(str, id), source=source, linkMerge=linkMerge, - id=id, default=default, valueFrom=valueFrom, extension_fields=extension_fields, @@ -19350,7 +19391,33 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["source", "linkMerge", "id", "default", "valueFrom"]) + def __init__( + self, + id: str, + source: None | Sequence[str] | str = None, + linkMerge: Literal["merge_nested", "merge_flattened"] | None = None, + default: CWLObjectType | None = None, + valueFrom: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.source: None | Sequence[str] | str = source + self.linkMerge: Literal["merge_nested", "merge_flattened"] | None = linkMerge + self.id: str = id + self.default: CWLObjectType | None = default + self.valueFrom: None | str = valueFrom + + attrs: ClassVar[Collection[str]] = frozenset( + ["source", "linkMerge", "id", "default", "valueFrom"] + ) class WorkflowStepOutput(Saveable): @@ -19364,22 +19431,6 @@ class WorkflowStepOutput(Saveable): id: str - def __init__( - self, - id: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - def __eq__(self, other: Any) -> bool: if isinstance(other, WorkflowStepOutput): return bool(self.id == other.id) @@ -19394,8 +19445,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "WorkflowStepOutput": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -19458,7 +19509,7 @@ def fromDoc( _errors__.append(ValidationException("missing id")) if not __original_id_is_none: baseuri = cast(str, id) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -19481,7 +19532,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=id, + id=cast(str, id), extension_fields=extension_fields, loadingOptions=loadingOptions, ) @@ -19511,7 +19562,23 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["id"]) + def __init__( + self, + id: str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.id: str = id + + attrs: ClassVar[Collection[str]] = frozenset(["id"]) class WorkflowStep(Saveable): @@ -19576,40 +19643,6 @@ class WorkflowStep(Saveable): id: str - def __init__( - self, - id: Any, - in_: Any, - out: Any, - run: Any, - requirements: Optional[Any] = None, - hints: Optional[Any] = None, - label: Optional[Any] = None, - doc: Optional[Any] = None, - scatter: Optional[Any] = None, - scatterMethod: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.in_ = in_ - self.out = out - self.requirements = requirements - self.hints = hints - self.label = label - self.doc = doc - self.run = run - self.scatter = scatter - self.scatterMethod = scatterMethod - def __eq__(self, other: Any) -> bool: if isinstance(other, WorkflowStep): return bool( @@ -19648,8 +19681,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "WorkflowStep": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -20138,7 +20171,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -20163,7 +20196,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=id, + id=cast(str, id), in_=in_, out=out, requirements=requirements, @@ -20239,7 +20272,41 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + id: str, + in_: Sequence[WorkflowStepInput], + out: Sequence[WorkflowStepOutput | str], + run: CommandLineTool | ExpressionTool | ProcessGenerator | Workflow | str, + requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | TimeLimit | WorkReuse] = None, + hints: None | Sequence[Any] = None, + label: None | str = None, + doc: None | str = None, + scatter: None | Sequence[str] | str = None, + scatterMethod: Literal["dotproduct", "nested_crossproduct", "flat_crossproduct"] | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.id: str = id + self.in_: Sequence[WorkflowStepInput] = in_ + self.out: Sequence[WorkflowStepOutput | str] = out + self.requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | TimeLimit | WorkReuse] = requirements + self.hints: None | Sequence[Any] = hints + self.label: None | str = label + self.doc: None | str = doc + self.run: CommandLineTool | ExpressionTool | ProcessGenerator | Workflow | str = run + self.scatter: None | Sequence[str] | str = scatter + self.scatterMethod: Literal["dotproduct", "nested_crossproduct", "flat_crossproduct"] | None = scatterMethod + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "in", @@ -20307,39 +20374,6 @@ class Workflow(Process): id: str - def __init__( - self, - inputs: Any, - outputs: Any, - steps: Any, - id: Optional[Any] = None, - requirements: Optional[Any] = None, - hints: Optional[Any] = None, - label: Optional[Any] = None, - doc: Optional[Any] = None, - cwlVersion: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.inputs = inputs - self.outputs = outputs - self.requirements = requirements - self.hints = hints - self.label = label - self.doc = doc - self.cwlVersion = cwlVersion - self.class_ = "Workflow" - self.steps = steps - def __eq__(self, other: Any) -> bool: if isinstance(other, Workflow): return bool( @@ -20378,8 +20412,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "Workflow": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -20837,7 +20871,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -20862,7 +20896,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=id, + id=cast(str, id), inputs=inputs, outputs=outputs, requirements=requirements, @@ -20942,7 +20976,40 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + inputs: Sequence[InputParameter], + outputs: Sequence[WorkflowOutputParameter], + steps: Sequence[WorkflowStep], + id: None | str = None, + requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | TimeLimit | WorkReuse] = None, + hints: None | Sequence[Any | CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | TimeLimit | WorkReuse] = None, + label: None | str = None, + doc: None | str = None, + cwlVersion: Literal["v1.0"] | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.id: str = id if id is not None else "_:" + str(_uuid__.uuid4()) + self.inputs: Sequence[InputParameter] = inputs + self.outputs: Sequence[WorkflowOutputParameter] = outputs + self.requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | TimeLimit | WorkReuse] = requirements + self.hints: None | Sequence[Any | CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | TimeLimit | WorkReuse] = hints + self.label: None | str = label + self.doc: None | str = doc + self.cwlVersion: Literal["v1.0"] | None = cwlVersion + self.class_: Final[str] = "Workflow" + self.steps: Sequence[WorkflowStep] = steps + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "inputs", @@ -20965,21 +21032,6 @@ class SubworkflowFeatureRequirement(ProcessRequirement): """ - def __init__( - self, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "SubworkflowFeatureRequirement" - def __eq__(self, other: Any) -> bool: if isinstance(other, SubworkflowFeatureRequirement): return bool(self.class_ == other.class_) @@ -20994,8 +21046,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "SubworkflowFeatureRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -21018,7 +21070,7 @@ def fromDoc( raise ValidationException(f"tried `{cls.__name__}` but") except ValidationException as e: raise e - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -21074,20 +21126,10 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class"]) - - -class ScatterFeatureRequirement(ProcessRequirement): - """ - Indicates that the workflow platform must support the `scatter` and - `scatterMethod` fields of [WorkflowStep](#WorkflowStep). - - """ - def __init__( self, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -21097,7 +21139,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "ScatterFeatureRequirement" + self.class_: Final[str] = "SubworkflowFeatureRequirement" + + attrs: ClassVar[Collection[str]] = frozenset(["class"]) + + +class ScatterFeatureRequirement(ProcessRequirement): + """ + Indicates that the workflow platform must support the `scatter` and + `scatterMethod` fields of [WorkflowStep](#WorkflowStep). + + """ def __eq__(self, other: Any) -> bool: if isinstance(other, ScatterFeatureRequirement): @@ -21113,8 +21165,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "ScatterFeatureRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -21137,7 +21189,7 @@ def fromDoc( raise ValidationException(f"tried `{cls.__name__}` but") except ValidationException as e: raise e - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -21193,20 +21245,10 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class"]) - - -class MultipleInputFeatureRequirement(ProcessRequirement): - """ - Indicates that the workflow platform must support multiple inbound data links - listed in the `source` field of [WorkflowStepInput](#WorkflowStepInput). - - """ - def __init__( self, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -21216,7 +21258,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "MultipleInputFeatureRequirement" + self.class_: Final[str] = "ScatterFeatureRequirement" + + attrs: ClassVar[Collection[str]] = frozenset(["class"]) + + +class MultipleInputFeatureRequirement(ProcessRequirement): + """ + Indicates that the workflow platform must support multiple inbound data links + listed in the `source` field of [WorkflowStepInput](#WorkflowStepInput). + + """ def __eq__(self, other: Any) -> bool: if isinstance(other, MultipleInputFeatureRequirement): @@ -21232,8 +21284,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "MultipleInputFeatureRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -21256,7 +21308,7 @@ def fromDoc( raise ValidationException(f"tried `{cls.__name__}` but") except ValidationException as e: raise e - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -21312,20 +21364,10 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class"]) - - -class StepInputExpressionRequirement(ProcessRequirement): - """ - Indicate that the workflow platform must support the `valueFrom` field - of [WorkflowStepInput](#WorkflowStepInput). - - """ - def __init__( self, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -21335,7 +21377,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "StepInputExpressionRequirement" + self.class_: Final[str] = "MultipleInputFeatureRequirement" + + attrs: ClassVar[Collection[str]] = frozenset(["class"]) + + +class StepInputExpressionRequirement(ProcessRequirement): + """ + Indicate that the workflow platform must support the `valueFrom` field + of [WorkflowStepInput](#WorkflowStepInput). + + """ def __eq__(self, other: Any) -> bool: if isinstance(other, StepInputExpressionRequirement): @@ -21351,8 +21403,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "StepInputExpressionRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -21375,7 +21427,7 @@ def fromDoc( raise ValidationException(f"tried `{cls.__name__}` but") except ValidationException as e: raise e - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -21431,15 +21483,10 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class"]) - - -class LoadListingRequirement(ProcessRequirement): def __init__( self, - loadListing: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -21449,9 +21496,12 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "LoadListingRequirement" - self.loadListing = loadListing + self.class_: Final[str] = "StepInputExpressionRequirement" + + attrs: ClassVar[Collection[str]] = frozenset(["class"]) + +class LoadListingRequirement(ProcessRequirement): def __eq__(self, other: Any) -> bool: if isinstance(other, LoadListingRequirement): return bool( @@ -21468,8 +21518,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "LoadListingRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -21540,7 +21590,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -21606,15 +21656,11 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "loadListing"]) - - -class InplaceUpdateRequirement(ProcessRequirement): def __init__( self, - inplaceUpdate: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + loadListing: Literal["no_listing", "shallow_listing", "deep_listing"], + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -21624,9 +21670,13 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "InplaceUpdateRequirement" - self.inplaceUpdate = inplaceUpdate + self.class_: Final[str] = "LoadListingRequirement" + self.loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] = loadListing + + attrs: ClassVar[Collection[str]] = frozenset(["class", "loadListing"]) + +class InplaceUpdateRequirement(ProcessRequirement): def __eq__(self, other: Any) -> bool: if isinstance(other, InplaceUpdateRequirement): return bool( @@ -21644,8 +21694,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "InplaceUpdateRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -21716,7 +21766,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -21782,15 +21832,11 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "inplaceUpdate"]) - - -class Secrets(ProcessRequirement): def __init__( self, - secrets: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + inplaceUpdate: bool, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -21800,9 +21846,13 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "Secrets" - self.secrets = secrets + self.class_: Final[str] = "InplaceUpdateRequirement" + self.inplaceUpdate: bool = inplaceUpdate + + attrs: ClassVar[Collection[str]] = frozenset(["class", "inplaceUpdate"]) + +class Secrets(ProcessRequirement): def __eq__(self, other: Any) -> bool: if isinstance(other, Secrets): return bool(self.class_ == other.class_ and self.secrets == other.secrets) @@ -21817,8 +21867,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "Secrets": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -21889,7 +21939,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -21951,23 +22001,11 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "secrets"]) - - -class TimeLimit(ProcessRequirement): - """ - Set an upper limit on the execution time of a CommandLineTool or - ExpressionTool. A tool execution which exceeds the time limit may - be preemptively terminated and considered failed. May also be - used by batch systems to make scheduling decisions. - - """ - def __init__( self, - timelimit: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + secrets: Sequence[str], + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -21977,8 +22015,20 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "TimeLimit" - self.timelimit = timelimit + self.class_: Final[str] = "Secrets" + self.secrets: Sequence[str] = secrets + + attrs: ClassVar[Collection[str]] = frozenset(["class", "secrets"]) + + +class TimeLimit(ProcessRequirement): + """ + Set an upper limit on the execution time of a CommandLineTool or + ExpressionTool. A tool execution which exceeds the time limit may + be preemptively terminated and considered failed. May also be + used by batch systems to make scheduling decisions. + + """ def __eq__(self, other: Any) -> bool: if isinstance(other, TimeLimit): @@ -21996,8 +22046,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "TimeLimit": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -22068,7 +22118,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -22134,7 +22184,24 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "timelimit"]) + def __init__( + self, + timelimit: i32 | str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "TimeLimit" + self.timelimit: i32 | str = timelimit + + attrs: ClassVar[Collection[str]] = frozenset(["class", "timelimit"]) class WorkReuse(ProcessRequirement): @@ -22151,23 +22218,6 @@ class WorkReuse(ProcessRequirement): """ - def __init__( - self, - enableReuse: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "WorkReuse" - self.enableReuse = enableReuse - def __eq__(self, other: Any) -> bool: if isinstance(other, WorkReuse): return bool( @@ -22184,8 +22234,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "WorkReuse": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -22256,7 +22306,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -22322,7 +22372,24 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "enableReuse"]) + def __init__( + self, + enableReuse: bool | str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "WorkReuse" + self.enableReuse: bool | str = enableReuse + + attrs: ClassVar[Collection[str]] = frozenset(["class", "enableReuse"]) class NetworkAccess(ProcessRequirement): @@ -22345,23 +22412,6 @@ class NetworkAccess(ProcessRequirement): """ - def __init__( - self, - networkAccess: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "NetworkAccess" - self.networkAccess = networkAccess - def __eq__(self, other: Any) -> bool: if isinstance(other, NetworkAccess): return bool( @@ -22379,8 +22429,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "NetworkAccess": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -22451,7 +22501,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -22517,25 +22567,11 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "networkAccess"]) - - -class ProcessGenerator(Process): - id: str - def __init__( self, - inputs: Any, - outputs: Any, - run: Any, - id: Optional[Any] = None, - requirements: Optional[Any] = None, - hints: Optional[Any] = None, - label: Optional[Any] = None, - doc: Optional[Any] = None, - cwlVersion: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + networkAccess: bool | str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -22545,16 +22581,14 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.inputs = inputs - self.outputs = outputs - self.requirements = requirements - self.hints = hints - self.label = label - self.doc = doc - self.cwlVersion = cwlVersion - self.class_ = "ProcessGenerator" - self.run = run + self.class_: Final[str] = "NetworkAccess" + self.networkAccess: bool | str = networkAccess + + attrs: ClassVar[Collection[str]] = frozenset(["class", "networkAccess"]) + + +class ProcessGenerator(Process): + id: str def __eq__(self, other: Any) -> bool: if isinstance(other, ProcessGenerator): @@ -22594,8 +22628,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "ProcessGenerator": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -22728,7 +22762,7 @@ def fromDoc( outputs = load_field( _doc.get("outputs"), - idmap_outputs_array_of_OutputParameterLoader, + idmap_outputs_array_of_ExpressionToolOutputParameterLoader, baseuri, loadingOptions, lc=_doc.get("outputs") @@ -23053,7 +23087,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -23078,7 +23112,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=id, + id=cast(str, id), inputs=inputs, outputs=outputs, requirements=requirements, @@ -23157,7 +23191,40 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + inputs: Sequence[InputParameter], + outputs: Sequence[ExpressionToolOutputParameter], + run: CommandLineTool | ExpressionTool | ProcessGenerator | Workflow | str, + id: None | str = None, + requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | TimeLimit | WorkReuse] = None, + hints: None | Sequence[Any | CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | TimeLimit | WorkReuse] = None, + label: None | str = None, + doc: None | str = None, + cwlVersion: Literal["v1.0"] | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.id: str = id if id is not None else "_:" + str(_uuid__.uuid4()) + self.inputs: Sequence[InputParameter] = inputs + self.outputs: Sequence[ExpressionToolOutputParameter] = outputs + self.requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | TimeLimit | WorkReuse] = requirements + self.hints: None | Sequence[Any | CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | TimeLimit | WorkReuse] = hints + self.label: None | str = label + self.doc: None | str = doc + self.cwlVersion: Literal["v1.0"] | None = cwlVersion + self.class_: Final[str] = "ProcessGenerator" + self.run: CommandLineTool | ExpressionTool | ProcessGenerator | Workflow | str = run + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "inputs", @@ -23179,23 +23246,6 @@ class MPIRequirement(ProcessRequirement): """ - def __init__( - self, - processes: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "MPIRequirement" - self.processes = processes - def __eq__(self, other: Any) -> bool: if isinstance(other, MPIRequirement): return bool( @@ -23212,8 +23262,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "MPIRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -23284,7 +23334,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -23350,23 +23400,11 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "processes"]) - - -class CUDARequirement(ProcessRequirement): - """ - Require support for NVIDA CUDA (GPU hardware acceleration). - - """ - def __init__( self, - cudaComputeCapability: Any, - cudaVersionMin: Any, - cudaDeviceCountMax: Optional[Any] = None, - cudaDeviceCountMin: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + processes: i32 | str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -23376,11 +23414,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "CUDARequirement" - self.cudaComputeCapability = cudaComputeCapability - self.cudaDeviceCountMax = cudaDeviceCountMax - self.cudaDeviceCountMin = cudaDeviceCountMin - self.cudaVersionMin = cudaVersionMin + self.class_: Final[str] = "MPIRequirement" + self.processes: i32 | str = processes + + attrs: ClassVar[Collection[str]] = frozenset(["class", "processes"]) + + +class CUDARequirement(ProcessRequirement): + """ + Require support for NVIDA CUDA (GPU hardware acceleration). + + """ def __eq__(self, other: Any) -> bool: if isinstance(other, CUDARequirement): @@ -23410,8 +23454,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CUDARequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -23624,7 +23668,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -23714,23 +23758,14 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( - [ - "class", - "cudaComputeCapability", - "cudaDeviceCountMax", - "cudaDeviceCountMin", - "cudaVersionMin", - ] - ) - - -class ShmSize(ProcessRequirement): def __init__( self, - shmSize: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + cudaComputeCapability: Sequence[str] | str, + cudaVersionMin: str, + cudaDeviceCountMax: None | i32 | str = None, + cudaDeviceCountMin: None | i32 | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -23740,9 +23775,24 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "ShmSize" - self.shmSize = shmSize + self.class_: Final[str] = "CUDARequirement" + self.cudaComputeCapability: Sequence[str] | str = cudaComputeCapability + self.cudaDeviceCountMax: None | i32 | str = cudaDeviceCountMax + self.cudaDeviceCountMin: None | i32 | str = cudaDeviceCountMin + self.cudaVersionMin: str = cudaVersionMin + + attrs: ClassVar[Collection[str]] = frozenset( + [ + "class", + "cudaComputeCapability", + "cudaDeviceCountMax", + "cudaDeviceCountMin", + "cudaVersionMin", + ] + ) + +class ShmSize(ProcessRequirement): def __eq__(self, other: Any) -> bool: if isinstance(other, ShmSize): return bool(self.class_ == other.class_ and self.shmSize == other.shmSize) @@ -23757,8 +23807,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "ShmSize": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -23829,7 +23879,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -23892,10 +23942,27 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "shmSize"]) + def __init__( + self, + shmSize: str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "ShmSize" + self.shmSize: str = shmSize + + attrs: ClassVar[Collection[str]] = frozenset(["class", "shmSize"]) -_vocab = { +_vocab.update({ "Any": "https://w3id.org/cwl/salad#Any", "ArraySchema": "https://w3id.org/cwl/salad#ArraySchema", "CUDARequirement": "http://commonwl.org/cwltool#CUDARequirement", @@ -23987,16 +24054,6 @@ def save( "deep_listing": "http://commonwl.org/cwltool#LoadListingRequirement/loadListing/LoadListingEnum/deep_listing", "dotproduct": "https://w3id.org/cwl/cwl#ScatterMethod/dotproduct", "double": "http://www.w3.org/2001/XMLSchema#double", - "draft-2": "https://w3id.org/cwl/cwl#draft-2", - "draft-3": "https://w3id.org/cwl/cwl#draft-3", - "draft-3.dev1": "https://w3id.org/cwl/cwl#draft-3.dev1", - "draft-3.dev2": "https://w3id.org/cwl/cwl#draft-3.dev2", - "draft-3.dev3": "https://w3id.org/cwl/cwl#draft-3.dev3", - "draft-3.dev4": "https://w3id.org/cwl/cwl#draft-3.dev4", - "draft-3.dev5": "https://w3id.org/cwl/cwl#draft-3.dev5", - "draft-4.dev1": "https://w3id.org/cwl/cwl#draft-4.dev1", - "draft-4.dev2": "https://w3id.org/cwl/cwl#draft-4.dev2", - "draft-4.dev3": "https://w3id.org/cwl/cwl#draft-4.dev3", "enum": "https://w3id.org/cwl/salad#enum", "flat_crossproduct": "https://w3id.org/cwl/cwl#ScatterMethod/flat_crossproduct", "float": "http://www.w3.org/2001/XMLSchema#float", @@ -24015,9 +24072,8 @@ def save( "string": "http://www.w3.org/2001/XMLSchema#string", "union": "https://w3id.org/cwl/salad#union", "v1.0": "https://w3id.org/cwl/cwl#v1.0", - "v1.0.dev4": "https://w3id.org/cwl/cwl#v1.0.dev4", -} -_rvocab = { +}) +_rvocab.update({ "https://w3id.org/cwl/salad#Any": "Any", "https://w3id.org/cwl/salad#ArraySchema": "ArraySchema", "http://commonwl.org/cwltool#CUDARequirement": "CUDARequirement", @@ -24109,16 +24165,6 @@ def save( "http://commonwl.org/cwltool#LoadListingRequirement/loadListing/LoadListingEnum/deep_listing": "deep_listing", "https://w3id.org/cwl/cwl#ScatterMethod/dotproduct": "dotproduct", "http://www.w3.org/2001/XMLSchema#double": "double", - "https://w3id.org/cwl/cwl#draft-2": "draft-2", - "https://w3id.org/cwl/cwl#draft-3": "draft-3", - "https://w3id.org/cwl/cwl#draft-3.dev1": "draft-3.dev1", - "https://w3id.org/cwl/cwl#draft-3.dev2": "draft-3.dev2", - "https://w3id.org/cwl/cwl#draft-3.dev3": "draft-3.dev3", - "https://w3id.org/cwl/cwl#draft-3.dev4": "draft-3.dev4", - "https://w3id.org/cwl/cwl#draft-3.dev5": "draft-3.dev5", - "https://w3id.org/cwl/cwl#draft-4.dev1": "draft-4.dev1", - "https://w3id.org/cwl/cwl#draft-4.dev2": "draft-4.dev2", - "https://w3id.org/cwl/cwl#draft-4.dev3": "draft-4.dev3", "https://w3id.org/cwl/salad#enum": "enum", "https://w3id.org/cwl/cwl#ScatterMethod/flat_crossproduct": "flat_crossproduct", "http://www.w3.org/2001/XMLSchema#float": "float", @@ -24137,16 +24183,16 @@ def save( "http://www.w3.org/2001/XMLSchema#string": "string", "https://w3id.org/cwl/salad#union": "union", "https://w3id.org/cwl/cwl#v1.0": "v1.0", - "https://w3id.org/cwl/cwl#v1.0.dev4": "v1.0.dev4", -} - -strtype = _PrimitiveLoader(str) -inttype = _PrimitiveLoader(int) -floattype = _PrimitiveLoader(float) -booltype = _PrimitiveLoader(bool) -None_type = _PrimitiveLoader(type(None)) -Any_type = _AnyLoader() -PrimitiveTypeLoader = _EnumLoader( +}) + +strtype: Final = _PrimitiveLoader(str) +inttype: Final = _PrimitiveLoader(i32) +floattype: Final = _PrimitiveLoader(float) +booltype: Final = _PrimitiveLoader(bool) +None_type: Final = _PrimitiveLoader(type(None)) +Any_type: Final = _AnyLoader() +longtype: Final = _PrimitiveLoader(i64) +PrimitiveTypeLoader: Final = _EnumLoader( ( "null", "boolean", @@ -24172,17 +24218,17 @@ def save( double: double precision (64-bit) IEEE 754 floating-point number string: Unicode character sequence """ -AnyLoader = _EnumLoader(("Any",), "Any") +AnyLoader: Final = _EnumLoader(("Any",), "Any") """ The **Any** type validates for any non-null value. """ -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( +RecordFieldLoader: Final = _RecordLoader(RecordField, None, None) +RecordSchemaLoader: Final = _RecordLoader(RecordSchema, None, None) +EnumSchemaLoader: Final = _RecordLoader(EnumSchema, None, None) +ArraySchemaLoader: Final = _RecordLoader(ArraySchema, None, None) +MapSchemaLoader: Final = _RecordLoader(MapSchema, None, None) +UnionSchemaLoader: Final = _RecordLoader(UnionSchema, None, None) +CWLTypeLoader: Final = _EnumLoader( ( "null", "boolean", @@ -24201,74 +24247,72 @@ def save( File: A File object Directory: A Directory object """ -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( +CWLArraySchemaLoader: Final = _RecordLoader(CWLArraySchema, None, None) +CWLRecordFieldLoader: Final = _RecordLoader(CWLRecordField, None, None) +CWLRecordSchemaLoader: Final = _RecordLoader(CWLRecordSchema, None, None) +FileLoader: Final = _RecordLoader(File, None, None) +DirectoryLoader: Final = _RecordLoader(Directory, None, None) +CWLObjectTypeLoader: Final = _UnionLoader((), "CWLObjectTypeLoader") +union_of_None_type_or_CWLObjectTypeLoader: Final = _UnionLoader( ( None_type, CWLObjectTypeLoader, ) ) -array_of_union_of_None_type_or_CWLObjectTypeLoader = _ArrayLoader( +array_of_union_of_None_type_or_CWLObjectTypeLoader: Final = _ArrayLoader( union_of_None_type_or_CWLObjectTypeLoader ) -map_of_union_of_None_type_or_CWLObjectTypeLoader = _MapLoader( +map_of_union_of_None_type_or_CWLObjectTypeLoader: Final = _MapLoader( union_of_None_type_or_CWLObjectTypeLoader, "CWLInputFile", "@list", True ) -CWLInputFileLoader = map_of_union_of_None_type_or_CWLObjectTypeLoader -CWLVersionLoader = _EnumLoader( - ( - "draft-2", - "draft-3.dev1", - "draft-3.dev2", - "draft-3.dev3", - "draft-3.dev4", - "draft-3.dev5", - "draft-3", - "draft-4.dev1", - "draft-4.dev2", - "draft-4.dev3", - "v1.0.dev4", - "v1.0", - ), - "CWLVersion", -) +CWLInputFileLoader: Final = map_of_union_of_None_type_or_CWLObjectTypeLoader +CWLVersionLoader: Final = _EnumLoader(("v1.0",), "CWLVersion") """ -Version symbols for published CWL document versions. +Current version symbol for CWL documents. """ -ExpressionLoader = _ExpressionLoader(str) -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( +ExpressionLoader: Final = _ExpressionLoader(str) +InputRecordFieldLoader: Final = _RecordLoader(InputRecordField, None, None) +InputRecordSchemaLoader: Final = _RecordLoader(InputRecordSchema, None, None) +InputEnumSchemaLoader: Final = _RecordLoader(InputEnumSchema, None, None) +InputArraySchemaLoader: Final = _RecordLoader(InputArraySchema, None, None) +OutputRecordFieldLoader: Final = _RecordLoader(OutputRecordField, None, None) +OutputRecordSchemaLoader: Final = _RecordLoader(OutputRecordSchema, None, None) +OutputEnumSchemaLoader: Final = _RecordLoader(OutputEnumSchema, None, None) +OutputArraySchemaLoader: Final = _RecordLoader(OutputArraySchema, None, None) +InputParameterLoader: Final = _RecordLoader(InputParameter, None, None) +OutputParameterLoader: Final = _RecordLoader(OutputParameter, None, None) +InlineJavascriptRequirementLoader: Final = _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") +SchemaDefRequirementLoader: Final = _RecordLoader(SchemaDefRequirement, None, None) +EnvironmentDefLoader: Final = _RecordLoader(EnvironmentDef, None, None) +CommandLineBindingLoader: Final = _RecordLoader(CommandLineBinding, None, None) +CommandOutputBindingLoader: Final = _RecordLoader(CommandOutputBinding, None, None) +CommandInputRecordFieldLoader: Final = _RecordLoader( + CommandInputRecordField, None, None +) +CommandInputRecordSchemaLoader: Final = _RecordLoader( + CommandInputRecordSchema, None, None +) +CommandInputEnumSchemaLoader: Final = _RecordLoader(CommandInputEnumSchema, None, None) +CommandInputArraySchemaLoader: Final = _RecordLoader( + CommandInputArraySchema, None, None +) +CommandOutputRecordFieldLoader: Final = _RecordLoader( + CommandOutputRecordField, None, None +) +CommandOutputRecordSchemaLoader: Final = _RecordLoader( + CommandOutputRecordSchema, None, None +) +CommandOutputEnumSchemaLoader: Final = _RecordLoader( + CommandOutputEnumSchema, None, None +) +CommandOutputArraySchemaLoader: Final = _RecordLoader( + CommandOutputArraySchema, None, None +) +CommandInputParameterLoader: Final = _RecordLoader(CommandInputParameter, None, None) +CommandOutputParameterLoader: Final = _RecordLoader(CommandOutputParameter, None, None) +stdoutLoader: Final = _EnumLoader(("stdout",), "stdout") """ Only valid as a `type` for a `CommandLineTool` output with no `outputBinding` set. @@ -24312,7 +24356,7 @@ def save( stdout: random_stdout_filenameABCDEFG ``` """ -stderrLoader = _EnumLoader(("stderr",), "stderr") +stderrLoader: Final = _EnumLoader(("stderr",), "stderr") """ Only valid as a `type` for a `CommandLineTool` output with no `outputBinding` set. @@ -24356,20 +24400,24 @@ def save( stderr: random_stderr_filenameABCDEFG ``` """ -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( +CommandLineToolLoader: Final = _RecordLoader(CommandLineTool, None, None) +DockerRequirementLoader: Final = _RecordLoader(DockerRequirement, None, None) +SoftwareRequirementLoader: Final = _RecordLoader(SoftwareRequirement, None, None) +SoftwarePackageLoader: Final = _RecordLoader(SoftwarePackage, None, None) +DirentLoader: Final = _RecordLoader(Dirent, None, None) +InitialWorkDirRequirementLoader: Final = _RecordLoader( + InitialWorkDirRequirement, None, None +) +EnvVarRequirementLoader: Final = _RecordLoader(EnvVarRequirement, None, None) +ShellCommandRequirementLoader: Final = _RecordLoader( + ShellCommandRequirement, None, None +) +ResourceRequirementLoader: Final = _RecordLoader(ResourceRequirement, None, None) +ExpressionToolOutputParameterLoader: Final = _RecordLoader( ExpressionToolOutputParameter, None, None ) -ExpressionToolLoader = _RecordLoader(ExpressionTool, None, None) -LinkMergeMethodLoader = _EnumLoader( +ExpressionToolLoader: Final = _RecordLoader(ExpressionTool, None, None) +LinkMergeMethodLoader: Final = _EnumLoader( ( "merge_nested", "merge_flattened", @@ -24379,10 +24427,12 @@ def save( """ The input link merge method, described in [WorkflowStepInput](#WorkflowStepInput). """ -WorkflowOutputParameterLoader = _RecordLoader(WorkflowOutputParameter, None, None) -WorkflowStepInputLoader = _RecordLoader(WorkflowStepInput, None, None) -WorkflowStepOutputLoader = _RecordLoader(WorkflowStepOutput, None, None) -ScatterMethodLoader = _EnumLoader( +WorkflowOutputParameterLoader: Final = _RecordLoader( + WorkflowOutputParameter, None, None +) +WorkflowStepInputLoader: Final = _RecordLoader(WorkflowStepInput, None, None) +WorkflowStepOutputLoader: Final = _RecordLoader(WorkflowStepOutput, None, None) +ScatterMethodLoader: Final = _EnumLoader( ( "dotproduct", "nested_crossproduct", @@ -24393,38 +24443,44 @@ def save( """ The scatter method, as described in [workflow step scatter](#WorkflowStep). """ -WorkflowStepLoader = _RecordLoader(WorkflowStep, None, None) -WorkflowLoader = _RecordLoader(Workflow, None, None) -SubworkflowFeatureRequirementLoader = _RecordLoader( +WorkflowStepLoader: Final = _RecordLoader(WorkflowStep, None, None) +WorkflowLoader: Final = _RecordLoader(Workflow, None, None) +SubworkflowFeatureRequirementLoader: Final = _RecordLoader( SubworkflowFeatureRequirement, None, None ) -ScatterFeatureRequirementLoader = _RecordLoader(ScatterFeatureRequirement, None, None) -MultipleInputFeatureRequirementLoader = _RecordLoader( +ScatterFeatureRequirementLoader: Final = _RecordLoader( + ScatterFeatureRequirement, None, None +) +MultipleInputFeatureRequirementLoader: Final = _RecordLoader( MultipleInputFeatureRequirement, None, None ) -StepInputExpressionRequirementLoader = _RecordLoader( +StepInputExpressionRequirementLoader: Final = _RecordLoader( StepInputExpressionRequirement, None, None ) -LoadListingRequirementLoader = _RecordLoader(LoadListingRequirement, None, None) -InplaceUpdateRequirementLoader = _RecordLoader(InplaceUpdateRequirement, None, None) -SecretsLoader = _RecordLoader(Secrets, None, None) -TimeLimitLoader = _RecordLoader(TimeLimit, None, None) -WorkReuseLoader = _RecordLoader(WorkReuse, None, None) -NetworkAccessLoader = _RecordLoader(NetworkAccess, None, None) -ProcessGeneratorLoader = _RecordLoader(ProcessGenerator, None, None) -MPIRequirementLoader = _RecordLoader(MPIRequirement, None, None) -CUDARequirementLoader = _RecordLoader(CUDARequirement, None, None) -ShmSizeLoader = _RecordLoader(ShmSize, None, None) -array_of_strtype = _ArrayLoader(strtype) -union_of_None_type_or_strtype_or_array_of_strtype = _UnionLoader( +LoadListingRequirementLoader: Final = _RecordLoader(LoadListingRequirement, None, None) +InplaceUpdateRequirementLoader: Final = _RecordLoader( + InplaceUpdateRequirement, None, None +) +SecretsLoader: Final = _RecordLoader(Secrets, None, None) +TimeLimitLoader: Final = _RecordLoader(TimeLimit, None, None) +WorkReuseLoader: Final = _RecordLoader(WorkReuse, None, None) +NetworkAccessLoader: Final = _RecordLoader(NetworkAccess, None, None) +ProcessGeneratorLoader: Final = _RecordLoader(ProcessGenerator, None, None) +MPIRequirementLoader: Final = _RecordLoader(MPIRequirement, None, None) +CUDARequirementLoader: Final = _RecordLoader(CUDARequirement, None, None) +ShmSizeLoader: Final = _RecordLoader(ShmSize, None, None) +array_of_strtype: Final = _ArrayLoader(strtype) +union_of_None_type_or_strtype_or_array_of_strtype: Final = _UnionLoader( ( None_type, strtype, array_of_strtype, ) ) -uri_strtype_True_False_None_None = _URILoader(strtype, True, False, None, None) -union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype = _UnionLoader( +uri_strtype_True_False_None_None: Final = _URILoader(strtype, True, False, None, None) +union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype: ( + Final +) = _UnionLoader( ( PrimitiveTypeLoader, RecordSchemaLoader, @@ -24435,10 +24491,14 @@ def save( strtype, ) ) -array_of_union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype = _ArrayLoader( +array_of_union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype: ( + Final +) = _ArrayLoader( 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( +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: ( + Final +) = _UnionLoader( ( PrimitiveTypeLoader, RecordSchemaLoader, @@ -24450,51 +24510,57 @@ def save( array_of_union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype, ) ) -typedsl_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_2 = _TypeDSLLoader( +typedsl_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_2: ( + Final +) = _TypeDSLLoader( 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, 2, "v1.1", ) -array_of_RecordFieldLoader = _ArrayLoader(RecordFieldLoader) -union_of_None_type_or_array_of_RecordFieldLoader = _UnionLoader( +array_of_RecordFieldLoader: Final = _ArrayLoader(RecordFieldLoader) +union_of_None_type_or_array_of_RecordFieldLoader: Final = _UnionLoader( ( None_type, array_of_RecordFieldLoader, ) ) -idmap_fields_union_of_None_type_or_array_of_RecordFieldLoader = _IdMapLoader( +idmap_fields_union_of_None_type_or_array_of_RecordFieldLoader: Final = _IdMapLoader( union_of_None_type_or_array_of_RecordFieldLoader, "name", "type" ) -Record_nameLoader = _EnumLoader(("record",), "Record_name") -typedsl_Record_nameLoader_2 = _TypeDSLLoader(Record_nameLoader, 2, "v1.1") -union_of_None_type_or_strtype = _UnionLoader( +Record_nameLoader: Final = _EnumLoader(("record",), "Record_name") +typedsl_Record_nameLoader_2: Final = _TypeDSLLoader(Record_nameLoader, 2, "v1.1") +union_of_None_type_or_strtype: Final = _UnionLoader( ( None_type, strtype, ) ) -uri_union_of_None_type_or_strtype_True_False_None_None = _URILoader( +uri_union_of_None_type_or_strtype_True_False_None_None: Final = _URILoader( union_of_None_type_or_strtype, True, False, None, None ) -uri_array_of_strtype_True_False_None_None = _URILoader( +uri_array_of_strtype_True_False_None_None: Final = _URILoader( array_of_strtype, True, False, None, None ) -Enum_nameLoader = _EnumLoader(("enum",), "Enum_name") -typedsl_Enum_nameLoader_2 = _TypeDSLLoader(Enum_nameLoader, 2, "v1.1") -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( +Enum_nameLoader: Final = _EnumLoader(("enum",), "Enum_name") +typedsl_Enum_nameLoader_2: Final = _TypeDSLLoader(Enum_nameLoader, 2, "v1.1") +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: ( + Final +) = _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, True, 2, None, ) -Array_nameLoader = _EnumLoader(("array",), "Array_name") -typedsl_Array_nameLoader_2 = _TypeDSLLoader(Array_nameLoader, 2, "v1.1") -Map_nameLoader = _EnumLoader(("map",), "Map_name") -typedsl_Map_nameLoader_2 = _TypeDSLLoader(Map_nameLoader, 2, "v1.1") -Union_nameLoader = _EnumLoader(("union",), "Union_name") -typedsl_Union_nameLoader_2 = _TypeDSLLoader(Union_nameLoader, 2, "v1.1") -union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype = _UnionLoader( +Array_nameLoader: Final = _EnumLoader(("array",), "Array_name") +typedsl_Array_nameLoader_2: Final = _TypeDSLLoader(Array_nameLoader, 2, "v1.1") +Map_nameLoader: Final = _EnumLoader(("map",), "Map_name") +typedsl_Map_nameLoader_2: Final = _TypeDSLLoader(Map_nameLoader, 2, "v1.1") +Union_nameLoader: Final = _EnumLoader(("union",), "Union_name") +typedsl_Union_nameLoader_2: Final = _TypeDSLLoader(Union_nameLoader, 2, "v1.1") +union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype: ( + Final +) = _UnionLoader( ( PrimitiveTypeLoader, CWLRecordSchemaLoader, @@ -24503,10 +24569,14 @@ def save( strtype, ) ) -array_of_union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype = _ArrayLoader( +array_of_union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype: ( + Final +) = _ArrayLoader( 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( +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: ( + Final +) = _UnionLoader( ( PrimitiveTypeLoader, CWLRecordSchemaLoader, @@ -24516,73 +24586,82 @@ def save( array_of_union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype, ) ) -uri_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_False_True_2_None = _URILoader( +uri_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_False_True_2_None: ( + Final +) = _URILoader( 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, False, True, 2, None, ) -typedsl_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_2 = _TypeDSLLoader( +typedsl_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_2: ( + Final +) = _TypeDSLLoader( 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, 2, "v1.1", ) -array_of_CWLRecordFieldLoader = _ArrayLoader(CWLRecordFieldLoader) -union_of_None_type_or_array_of_CWLRecordFieldLoader = _UnionLoader( +array_of_CWLRecordFieldLoader: Final = _ArrayLoader(CWLRecordFieldLoader) +union_of_None_type_or_array_of_CWLRecordFieldLoader: Final = _UnionLoader( ( None_type, array_of_CWLRecordFieldLoader, ) ) -idmap_fields_union_of_None_type_or_array_of_CWLRecordFieldLoader = _IdMapLoader( +idmap_fields_union_of_None_type_or_array_of_CWLRecordFieldLoader: Final = _IdMapLoader( union_of_None_type_or_array_of_CWLRecordFieldLoader, "name", "type" ) -File_classLoader = _EnumLoader(("File",), "File_class") -uri_File_classLoader_False_True_None_None = _URILoader( +File_classLoader: Final = _EnumLoader(("File",), "File_class") +uri_File_classLoader_False_True_None_None: Final = _URILoader( File_classLoader, False, True, None, None ) -uri_union_of_None_type_or_strtype_False_False_None_None = _URILoader( +uri_union_of_None_type_or_strtype_False_False_None_None: Final = _URILoader( union_of_None_type_or_strtype, False, False, None, None ) -union_of_None_type_or_inttype = _UnionLoader( +union_of_None_type_or_inttype_or_inttype: Final = _UnionLoader( ( None_type, inttype, + inttype, ) ) -union_of_FileLoader_or_DirectoryLoader = _UnionLoader( +union_of_FileLoader_or_DirectoryLoader: Final = _UnionLoader( ( FileLoader, DirectoryLoader, ) ) -array_of_union_of_FileLoader_or_DirectoryLoader = _ArrayLoader( +array_of_union_of_FileLoader_or_DirectoryLoader: Final = _ArrayLoader( union_of_FileLoader_or_DirectoryLoader ) -union_of_None_type_or_array_of_union_of_FileLoader_or_DirectoryLoader = _UnionLoader( - ( - None_type, - array_of_union_of_FileLoader_or_DirectoryLoader, +union_of_None_type_or_array_of_union_of_FileLoader_or_DirectoryLoader: Final = ( + _UnionLoader( + ( + None_type, + array_of_union_of_FileLoader_or_DirectoryLoader, + ) ) ) -uri_union_of_None_type_or_strtype_True_False_None_True = _URILoader( +uri_union_of_None_type_or_strtype_True_False_None_True: Final = _URILoader( union_of_None_type_or_strtype, True, False, None, True ) -Directory_classLoader = _EnumLoader(("Directory",), "Directory_class") -uri_Directory_classLoader_False_True_None_None = _URILoader( +Directory_classLoader: Final = _EnumLoader(("Directory",), "Directory_class") +uri_Directory_classLoader_False_True_None_None: Final = _URILoader( Directory_classLoader, False, True, None, None ) -union_of_strtype_or_ExpressionLoader = _UnionLoader( +union_of_strtype_or_ExpressionLoader: Final = _UnionLoader( ( strtype, ExpressionLoader, ) ) -array_of_union_of_strtype_or_ExpressionLoader = _ArrayLoader( +array_of_union_of_strtype_or_ExpressionLoader: Final = _ArrayLoader( union_of_strtype_or_ExpressionLoader ) -union_of_None_type_or_strtype_or_ExpressionLoader_or_array_of_union_of_strtype_or_ExpressionLoader = _UnionLoader( +union_of_None_type_or_strtype_or_ExpressionLoader_or_array_of_union_of_strtype_or_ExpressionLoader: ( + Final +) = _UnionLoader( ( None_type, strtype, @@ -24590,13 +24669,15 @@ def save( array_of_union_of_strtype_or_ExpressionLoader, ) ) -union_of_None_type_or_booltype = _UnionLoader( +union_of_None_type_or_booltype: Final = _UnionLoader( ( None_type, booltype, ) ) -union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype = _UnionLoader( +union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype: ( + Final +) = _UnionLoader( ( CWLTypeLoader, InputRecordSchemaLoader, @@ -24605,10 +24686,14 @@ def save( strtype, ) ) -array_of_union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype = _ArrayLoader( +array_of_union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype: ( + Final +) = _ArrayLoader( 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( +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: ( + Final +) = _UnionLoader( ( CWLTypeLoader, InputRecordSchemaLoader, @@ -24618,35 +24703,41 @@ def save( array_of_union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype, ) ) -typedsl_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_2 = _TypeDSLLoader( +typedsl_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_2: ( + Final +) = _TypeDSLLoader( 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, 2, "v1.1", ) -union_of_None_type_or_CommandLineBindingLoader = _UnionLoader( +union_of_None_type_or_CommandLineBindingLoader: Final = _UnionLoader( ( None_type, CommandLineBindingLoader, ) ) -array_of_InputRecordFieldLoader = _ArrayLoader(InputRecordFieldLoader) -union_of_None_type_or_array_of_InputRecordFieldLoader = _UnionLoader( +array_of_InputRecordFieldLoader: Final = _ArrayLoader(InputRecordFieldLoader) +union_of_None_type_or_array_of_InputRecordFieldLoader: Final = _UnionLoader( ( None_type, array_of_InputRecordFieldLoader, ) ) -idmap_fields_union_of_None_type_or_array_of_InputRecordFieldLoader = _IdMapLoader( - union_of_None_type_or_array_of_InputRecordFieldLoader, "name", "type" +idmap_fields_union_of_None_type_or_array_of_InputRecordFieldLoader: Final = ( + _IdMapLoader(union_of_None_type_or_array_of_InputRecordFieldLoader, "name", "type") ) -uri_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_False_True_2_None = _URILoader( +uri_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_False_True_2_None: ( + Final +) = _URILoader( 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, False, True, 2, None, ) -union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype = _UnionLoader( +union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype: ( + Final +) = _UnionLoader( ( CWLTypeLoader, OutputRecordSchemaLoader, @@ -24655,10 +24746,14 @@ def save( strtype, ) ) -array_of_union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype = _ArrayLoader( +array_of_union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype: ( + Final +) = _ArrayLoader( 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( +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: ( + Final +) = _UnionLoader( ( CWLTypeLoader, OutputRecordSchemaLoader, @@ -24668,50 +24763,60 @@ def save( array_of_union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype, ) ) -typedsl_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_2 = _TypeDSLLoader( +typedsl_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_2: ( + Final +) = _TypeDSLLoader( 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, 2, "v1.1", ) -union_of_None_type_or_CommandOutputBindingLoader = _UnionLoader( +union_of_None_type_or_CommandOutputBindingLoader: Final = _UnionLoader( ( None_type, CommandOutputBindingLoader, ) ) -array_of_OutputRecordFieldLoader = _ArrayLoader(OutputRecordFieldLoader) -union_of_None_type_or_array_of_OutputRecordFieldLoader = _UnionLoader( +array_of_OutputRecordFieldLoader: Final = _ArrayLoader(OutputRecordFieldLoader) +union_of_None_type_or_array_of_OutputRecordFieldLoader: Final = _UnionLoader( ( None_type, array_of_OutputRecordFieldLoader, ) ) -idmap_fields_union_of_None_type_or_array_of_OutputRecordFieldLoader = _IdMapLoader( - union_of_None_type_or_array_of_OutputRecordFieldLoader, "name", "type" +idmap_fields_union_of_None_type_or_array_of_OutputRecordFieldLoader: Final = ( + _IdMapLoader(union_of_None_type_or_array_of_OutputRecordFieldLoader, "name", "type") ) -uri_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_False_True_2_None = _URILoader( +uri_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_False_True_2_None: ( + Final +) = _URILoader( 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, False, True, 2, None, ) -union_of_None_type_or_strtype_or_array_of_strtype_or_ExpressionLoader = _UnionLoader( - ( - None_type, - strtype, - array_of_strtype, - ExpressionLoader, +union_of_None_type_or_strtype_or_array_of_strtype_or_ExpressionLoader: Final = ( + _UnionLoader( + ( + None_type, + strtype, + array_of_strtype, + ExpressionLoader, + ) ) ) -uri_union_of_None_type_or_strtype_or_array_of_strtype_or_ExpressionLoader_True_False_None_True = _URILoader( +uri_union_of_None_type_or_strtype_or_array_of_strtype_or_ExpressionLoader_True_False_None_True: ( + Final +) = _URILoader( union_of_None_type_or_strtype_or_array_of_strtype_or_ExpressionLoader, True, False, None, True, ) -union_of_None_type_or_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype = _UnionLoader( +union_of_None_type_or_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype: ( + Final +) = _UnionLoader( ( None_type, CWLTypeLoader, @@ -24722,30 +24827,36 @@ def save( array_of_union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype, ) ) -typedsl_union_of_None_type_or_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype_2 = _TypeDSLLoader( +typedsl_union_of_None_type_or_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype_2: ( + Final +) = _TypeDSLLoader( union_of_None_type_or_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype, 2, "v1.1", ) -union_of_None_type_or_strtype_or_ExpressionLoader = _UnionLoader( +union_of_None_type_or_strtype_or_ExpressionLoader: Final = _UnionLoader( ( None_type, strtype, ExpressionLoader, ) ) -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 +uri_union_of_None_type_or_strtype_or_ExpressionLoader_True_False_None_True: Final = ( + _URILoader( + union_of_None_type_or_strtype_or_ExpressionLoader, True, False, None, True + ) ) -array_of_InputParameterLoader = _ArrayLoader(InputParameterLoader) -idmap_inputs_array_of_InputParameterLoader = _IdMapLoader( +array_of_InputParameterLoader: Final = _ArrayLoader(InputParameterLoader) +idmap_inputs_array_of_InputParameterLoader: Final = _IdMapLoader( array_of_InputParameterLoader, "id", "type" ) -array_of_OutputParameterLoader = _ArrayLoader(OutputParameterLoader) -idmap_outputs_array_of_OutputParameterLoader = _IdMapLoader( +array_of_OutputParameterLoader: Final = _ArrayLoader(OutputParameterLoader) +idmap_outputs_array_of_OutputParameterLoader: Final = _IdMapLoader( array_of_OutputParameterLoader, "id", "type" ) -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_LoadListingRequirementLoader_or_InplaceUpdateRequirementLoader_or_SecretsLoader_or_TimeLimitLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader = _UnionLoader( +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_LoadListingRequirementLoader_or_InplaceUpdateRequirementLoader_or_SecretsLoader_or_TimeLimitLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader: ( + Final +) = _UnionLoader( ( InlineJavascriptRequirementLoader, SchemaDefRequirementLoader, @@ -24770,21 +24881,29 @@ def save( ShmSizeLoader, ) ) -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_LoadListingRequirementLoader_or_InplaceUpdateRequirementLoader_or_SecretsLoader_or_TimeLimitLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader = _ArrayLoader( +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_LoadListingRequirementLoader_or_InplaceUpdateRequirementLoader_or_SecretsLoader_or_TimeLimitLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader: ( + Final +) = _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_LoadListingRequirementLoader_or_InplaceUpdateRequirementLoader_or_SecretsLoader_or_TimeLimitLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader ) -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_LoadListingRequirementLoader_or_InplaceUpdateRequirementLoader_or_SecretsLoader_or_TimeLimitLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader = _UnionLoader( +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_LoadListingRequirementLoader_or_InplaceUpdateRequirementLoader_or_SecretsLoader_or_TimeLimitLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader: ( + Final +) = _UnionLoader( ( None_type, 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_LoadListingRequirementLoader_or_InplaceUpdateRequirementLoader_or_SecretsLoader_or_TimeLimitLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader, ) ) -idmap_requirements_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_LoadListingRequirementLoader_or_InplaceUpdateRequirementLoader_or_SecretsLoader_or_TimeLimitLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader = _IdMapLoader( +idmap_requirements_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_LoadListingRequirementLoader_or_InplaceUpdateRequirementLoader_or_SecretsLoader_or_TimeLimitLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader: ( + Final +) = _IdMapLoader( 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_LoadListingRequirementLoader_or_InplaceUpdateRequirementLoader_or_SecretsLoader_or_TimeLimitLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader, "class", "None", ) -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_LoadListingRequirementLoader_or_InplaceUpdateRequirementLoader_or_SecretsLoader_or_TimeLimitLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader_or_Any_type = _UnionLoader( +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_LoadListingRequirementLoader_or_InplaceUpdateRequirementLoader_or_SecretsLoader_or_TimeLimitLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader_or_Any_type: ( + Final +) = _UnionLoader( ( InlineJavascriptRequirementLoader, SchemaDefRequirementLoader, @@ -24810,68 +24929,86 @@ def save( Any_type, ) ) -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_LoadListingRequirementLoader_or_InplaceUpdateRequirementLoader_or_SecretsLoader_or_TimeLimitLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader_or_Any_type = _ArrayLoader( +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_LoadListingRequirementLoader_or_InplaceUpdateRequirementLoader_or_SecretsLoader_or_TimeLimitLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader_or_Any_type: ( + Final +) = _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_LoadListingRequirementLoader_or_InplaceUpdateRequirementLoader_or_SecretsLoader_or_TimeLimitLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader_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_LoadListingRequirementLoader_or_InplaceUpdateRequirementLoader_or_SecretsLoader_or_TimeLimitLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader_or_Any_type = _UnionLoader( +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_LoadListingRequirementLoader_or_InplaceUpdateRequirementLoader_or_SecretsLoader_or_TimeLimitLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader_or_Any_type: ( + Final +) = _UnionLoader( ( None_type, 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_LoadListingRequirementLoader_or_InplaceUpdateRequirementLoader_or_SecretsLoader_or_TimeLimitLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader_or_Any_type, ) ) -idmap_hints_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_LoadListingRequirementLoader_or_InplaceUpdateRequirementLoader_or_SecretsLoader_or_TimeLimitLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader_or_Any_type = _IdMapLoader( +idmap_hints_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_LoadListingRequirementLoader_or_InplaceUpdateRequirementLoader_or_SecretsLoader_or_TimeLimitLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader_or_Any_type: ( + Final +) = _IdMapLoader( 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_LoadListingRequirementLoader_or_InplaceUpdateRequirementLoader_or_SecretsLoader_or_TimeLimitLoader_or_WorkReuseLoader_or_NetworkAccessLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader_or_Any_type, "class", "None", ) -union_of_None_type_or_CWLVersionLoader = _UnionLoader( +union_of_None_type_or_CWLVersionLoader: Final = _UnionLoader( ( None_type, CWLVersionLoader, ) ) -uri_union_of_None_type_or_CWLVersionLoader_False_True_None_None = _URILoader( +uri_union_of_None_type_or_CWLVersionLoader_False_True_None_None: Final = _URILoader( union_of_None_type_or_CWLVersionLoader, False, True, None, None ) -InlineJavascriptRequirement_classLoader = _EnumLoader( +InlineJavascriptRequirement_classLoader: Final = _EnumLoader( ("InlineJavascriptRequirement",), "InlineJavascriptRequirement_class" ) -uri_InlineJavascriptRequirement_classLoader_False_True_None_None = _URILoader( +uri_InlineJavascriptRequirement_classLoader_False_True_None_None: Final = _URILoader( InlineJavascriptRequirement_classLoader, False, True, None, None ) -union_of_None_type_or_array_of_strtype = _UnionLoader( +union_of_None_type_or_array_of_strtype: Final = _UnionLoader( ( None_type, array_of_strtype, ) ) -SchemaDefRequirement_classLoader = _EnumLoader( +SchemaDefRequirement_classLoader: Final = _EnumLoader( ("SchemaDefRequirement",), "SchemaDefRequirement_class" ) -uri_SchemaDefRequirement_classLoader_False_True_None_None = _URILoader( +uri_SchemaDefRequirement_classLoader_False_True_None_None: Final = _URILoader( SchemaDefRequirement_classLoader, False, True, None, None ) -union_of_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader = ( - _UnionLoader( - ( - InputRecordSchemaLoader, - InputEnumSchemaLoader, - InputArraySchemaLoader, - ) +union_of_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader: ( + Final +) = _UnionLoader( + ( + InputRecordSchemaLoader, + InputEnumSchemaLoader, + InputArraySchemaLoader, ) ) -array_of_union_of_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader = _ArrayLoader( +array_of_union_of_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader: ( + Final +) = _ArrayLoader( union_of_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader ) -union_of_None_type_or_strtype_or_ExpressionLoader_or_array_of_strtype = _UnionLoader( +union_of_None_type_or_inttype: Final = _UnionLoader( ( None_type, - strtype, - ExpressionLoader, - array_of_strtype, + inttype, + ) +) +union_of_None_type_or_strtype_or_ExpressionLoader_or_array_of_strtype: Final = ( + _UnionLoader( + ( + None_type, + strtype, + ExpressionLoader, + array_of_strtype, + ) ) ) -union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype = _UnionLoader( +union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype: ( + Final +) = _UnionLoader( ( CWLTypeLoader, CommandInputRecordSchemaLoader, @@ -24880,10 +25017,14 @@ def save( strtype, ) ) -array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype = _ArrayLoader( +array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype: ( + Final +) = _ArrayLoader( 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( +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: ( + Final +) = _UnionLoader( ( CWLTypeLoader, CommandInputRecordSchemaLoader, @@ -24893,31 +25034,39 @@ def save( array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype, ) ) -typedsl_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_2 = _TypeDSLLoader( +typedsl_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_2: ( + Final +) = _TypeDSLLoader( 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, 2, "v1.1", ) -array_of_CommandInputRecordFieldLoader = _ArrayLoader(CommandInputRecordFieldLoader) -union_of_None_type_or_array_of_CommandInputRecordFieldLoader = _UnionLoader( +array_of_CommandInputRecordFieldLoader: Final = _ArrayLoader( + CommandInputRecordFieldLoader +) +union_of_None_type_or_array_of_CommandInputRecordFieldLoader: Final = _UnionLoader( ( None_type, array_of_CommandInputRecordFieldLoader, ) ) -idmap_fields_union_of_None_type_or_array_of_CommandInputRecordFieldLoader = ( +idmap_fields_union_of_None_type_or_array_of_CommandInputRecordFieldLoader: Final = ( _IdMapLoader( union_of_None_type_or_array_of_CommandInputRecordFieldLoader, "name", "type" ) ) -uri_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_False_True_2_None = _URILoader( +uri_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_False_True_2_None: ( + Final +) = _URILoader( 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, False, True, 2, None, ) -union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype = _UnionLoader( +union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype: ( + Final +) = _UnionLoader( ( CWLTypeLoader, CommandOutputRecordSchemaLoader, @@ -24926,10 +25075,14 @@ def save( strtype, ) ) -array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype = _ArrayLoader( +array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype: ( + Final +) = _ArrayLoader( 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( +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: ( + Final +) = _UnionLoader( ( CWLTypeLoader, CommandOutputRecordSchemaLoader, @@ -24939,31 +25092,39 @@ def save( array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype, ) ) -typedsl_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_2 = _TypeDSLLoader( +typedsl_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_2: ( + Final +) = _TypeDSLLoader( 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, 2, "v1.1", ) -array_of_CommandOutputRecordFieldLoader = _ArrayLoader(CommandOutputRecordFieldLoader) -union_of_None_type_or_array_of_CommandOutputRecordFieldLoader = _UnionLoader( +array_of_CommandOutputRecordFieldLoader: Final = _ArrayLoader( + CommandOutputRecordFieldLoader +) +union_of_None_type_or_array_of_CommandOutputRecordFieldLoader: Final = _UnionLoader( ( None_type, array_of_CommandOutputRecordFieldLoader, ) ) -idmap_fields_union_of_None_type_or_array_of_CommandOutputRecordFieldLoader = ( +idmap_fields_union_of_None_type_or_array_of_CommandOutputRecordFieldLoader: Final = ( _IdMapLoader( union_of_None_type_or_array_of_CommandOutputRecordFieldLoader, "name", "type" ) ) -uri_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_False_True_2_None = _URILoader( +uri_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_False_True_2_None: ( + Final +) = _URILoader( 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, False, True, 2, None, ) -union_of_None_type_or_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype = _UnionLoader( +union_of_None_type_or_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype: ( + Final +) = _UnionLoader( ( None_type, CWLTypeLoader, @@ -24974,12 +25135,16 @@ def save( array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype, ) ) -typedsl_union_of_None_type_or_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype_2 = _TypeDSLLoader( +typedsl_union_of_None_type_or_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype_2: ( + Final +) = _TypeDSLLoader( union_of_None_type_or_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype, 2, "v1.1", ) -union_of_None_type_or_CWLTypeLoader_or_stdoutLoader_or_stderrLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype = _UnionLoader( +union_of_None_type_or_CWLTypeLoader_or_stdoutLoader_or_stderrLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype: ( + Final +) = _UnionLoader( ( None_type, CWLTypeLoader, @@ -24992,72 +25157,82 @@ def save( array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype, ) ) -typedsl_union_of_None_type_or_CWLTypeLoader_or_stdoutLoader_or_stderrLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype_2 = _TypeDSLLoader( +typedsl_union_of_None_type_or_CWLTypeLoader_or_stdoutLoader_or_stderrLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype_2: ( + Final +) = _TypeDSLLoader( union_of_None_type_or_CWLTypeLoader_or_stdoutLoader_or_stderrLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype, 2, "v1.1", ) -CommandLineTool_classLoader = _EnumLoader(("CommandLineTool",), "CommandLineTool_class") -uri_CommandLineTool_classLoader_False_True_None_None = _URILoader( +CommandLineTool_classLoader: Final = _EnumLoader( + ("CommandLineTool",), "CommandLineTool_class" +) +uri_CommandLineTool_classLoader_False_True_None_None: Final = _URILoader( CommandLineTool_classLoader, False, True, None, None ) -array_of_CommandInputParameterLoader = _ArrayLoader(CommandInputParameterLoader) -idmap_inputs_array_of_CommandInputParameterLoader = _IdMapLoader( +array_of_CommandInputParameterLoader: Final = _ArrayLoader(CommandInputParameterLoader) +idmap_inputs_array_of_CommandInputParameterLoader: Final = _IdMapLoader( array_of_CommandInputParameterLoader, "id", "type" ) -array_of_CommandOutputParameterLoader = _ArrayLoader(CommandOutputParameterLoader) -idmap_outputs_array_of_CommandOutputParameterLoader = _IdMapLoader( +array_of_CommandOutputParameterLoader: Final = _ArrayLoader( + CommandOutputParameterLoader +) +idmap_outputs_array_of_CommandOutputParameterLoader: Final = _IdMapLoader( array_of_CommandOutputParameterLoader, "id", "type" ) -union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader = _UnionLoader( +union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader: Final = _UnionLoader( ( strtype, ExpressionLoader, CommandLineBindingLoader, ) ) -array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader = ( +array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader: Final = ( _ArrayLoader(union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader) ) -union_of_None_type_or_array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader = _UnionLoader( +union_of_None_type_or_array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader: ( + Final +) = _UnionLoader( ( None_type, array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader, ) ) -array_of_inttype = _ArrayLoader(inttype) -union_of_None_type_or_array_of_inttype = _UnionLoader( +array_of_inttype: Final = _ArrayLoader(inttype) +union_of_None_type_or_array_of_inttype: Final = _UnionLoader( ( None_type, array_of_inttype, ) ) -DockerRequirement_classLoader = _EnumLoader( +DockerRequirement_classLoader: Final = _EnumLoader( ("DockerRequirement",), "DockerRequirement_class" ) -uri_DockerRequirement_classLoader_False_True_None_None = _URILoader( +uri_DockerRequirement_classLoader_False_True_None_None: Final = _URILoader( DockerRequirement_classLoader, False, True, None, None ) -SoftwareRequirement_classLoader = _EnumLoader( +SoftwareRequirement_classLoader: Final = _EnumLoader( ("SoftwareRequirement",), "SoftwareRequirement_class" ) -uri_SoftwareRequirement_classLoader_False_True_None_None = _URILoader( +uri_SoftwareRequirement_classLoader_False_True_None_None: Final = _URILoader( SoftwareRequirement_classLoader, False, True, None, None ) -array_of_SoftwarePackageLoader = _ArrayLoader(SoftwarePackageLoader) -idmap_packages_array_of_SoftwarePackageLoader = _IdMapLoader( +array_of_SoftwarePackageLoader: Final = _ArrayLoader(SoftwarePackageLoader) +idmap_packages_array_of_SoftwarePackageLoader: Final = _IdMapLoader( array_of_SoftwarePackageLoader, "package", "specs" ) -uri_union_of_None_type_or_array_of_strtype_False_False_None_True = _URILoader( +uri_union_of_None_type_or_array_of_strtype_False_False_None_True: Final = _URILoader( union_of_None_type_or_array_of_strtype, False, False, None, True ) -InitialWorkDirRequirement_classLoader = _EnumLoader( +InitialWorkDirRequirement_classLoader: Final = _EnumLoader( ("InitialWorkDirRequirement",), "InitialWorkDirRequirement_class" ) -uri_InitialWorkDirRequirement_classLoader_False_True_None_None = _URILoader( +uri_InitialWorkDirRequirement_classLoader_False_True_None_None: Final = _URILoader( InitialWorkDirRequirement_classLoader, False, True, None, None ) -union_of_FileLoader_or_DirectoryLoader_or_DirentLoader_or_strtype_or_ExpressionLoader = _UnionLoader( +union_of_FileLoader_or_DirectoryLoader_or_DirentLoader_or_strtype_or_ExpressionLoader: ( + Final +) = _UnionLoader( ( FileLoader, DirectoryLoader, @@ -25066,39 +25241,54 @@ def save( ExpressionLoader, ) ) -array_of_union_of_FileLoader_or_DirectoryLoader_or_DirentLoader_or_strtype_or_ExpressionLoader = _ArrayLoader( +array_of_union_of_FileLoader_or_DirectoryLoader_or_DirentLoader_or_strtype_or_ExpressionLoader: ( + Final +) = _ArrayLoader( 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( +union_of_array_of_union_of_FileLoader_or_DirectoryLoader_or_DirentLoader_or_strtype_or_ExpressionLoader_or_strtype_or_ExpressionLoader: ( + Final +) = _UnionLoader( ( array_of_union_of_FileLoader_or_DirectoryLoader_or_DirentLoader_or_strtype_or_ExpressionLoader, strtype, ExpressionLoader, ) ) -EnvVarRequirement_classLoader = _EnumLoader( +EnvVarRequirement_classLoader: Final = _EnumLoader( ("EnvVarRequirement",), "EnvVarRequirement_class" ) -uri_EnvVarRequirement_classLoader_False_True_None_None = _URILoader( +uri_EnvVarRequirement_classLoader_False_True_None_None: Final = _URILoader( EnvVarRequirement_classLoader, False, True, None, None ) -array_of_EnvironmentDefLoader = _ArrayLoader(EnvironmentDefLoader) -idmap_envDef_array_of_EnvironmentDefLoader = _IdMapLoader( +array_of_EnvironmentDefLoader: Final = _ArrayLoader(EnvironmentDefLoader) +idmap_envDef_array_of_EnvironmentDefLoader: Final = _IdMapLoader( array_of_EnvironmentDefLoader, "envName", "envValue" ) -ShellCommandRequirement_classLoader = _EnumLoader( +ShellCommandRequirement_classLoader: Final = _EnumLoader( ("ShellCommandRequirement",), "ShellCommandRequirement_class" ) -uri_ShellCommandRequirement_classLoader_False_True_None_None = _URILoader( +uri_ShellCommandRequirement_classLoader_False_True_None_None: Final = _URILoader( ShellCommandRequirement_classLoader, False, True, None, None ) -ResourceRequirement_classLoader = _EnumLoader( +ResourceRequirement_classLoader: Final = _EnumLoader( ("ResourceRequirement",), "ResourceRequirement_class" ) -uri_ResourceRequirement_classLoader_False_True_None_None = _URILoader( +uri_ResourceRequirement_classLoader_False_True_None_None: Final = _URILoader( ResourceRequirement_classLoader, False, True, None, None ) -union_of_None_type_or_inttype_or_strtype_or_ExpressionLoader = _UnionLoader( +union_of_None_type_or_inttype_or_inttype_or_strtype_or_ExpressionLoader: Final = ( + _UnionLoader( + ( + None_type, + inttype, + inttype, + strtype, + ExpressionLoader, + ) + ) +) +union_of_None_type_or_inttype_or_strtype_or_ExpressionLoader: Final = _UnionLoader( ( None_type, inttype, @@ -25106,7 +25296,9 @@ def save( ExpressionLoader, ) ) -union_of_None_type_or_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype = _UnionLoader( +union_of_None_type_or_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype: ( + Final +) = _UnionLoader( ( None_type, CWLTypeLoader, @@ -25117,67 +25309,75 @@ def save( array_of_union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype, ) ) -typedsl_union_of_None_type_or_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype_2 = _TypeDSLLoader( +typedsl_union_of_None_type_or_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype_2: ( + Final +) = _TypeDSLLoader( union_of_None_type_or_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype, 2, "v1.1", ) -ExpressionTool_classLoader = _EnumLoader(("ExpressionTool",), "ExpressionTool_class") -uri_ExpressionTool_classLoader_False_True_None_None = _URILoader( +ExpressionTool_classLoader: Final = _EnumLoader( + ("ExpressionTool",), "ExpressionTool_class" +) +uri_ExpressionTool_classLoader_False_True_None_None: Final = _URILoader( ExpressionTool_classLoader, False, True, None, None ) -array_of_ExpressionToolOutputParameterLoader = _ArrayLoader( +array_of_ExpressionToolOutputParameterLoader: Final = _ArrayLoader( ExpressionToolOutputParameterLoader ) -idmap_outputs_array_of_ExpressionToolOutputParameterLoader = _IdMapLoader( +idmap_outputs_array_of_ExpressionToolOutputParameterLoader: Final = _IdMapLoader( array_of_ExpressionToolOutputParameterLoader, "id", "type" ) -uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_1_None = _URILoader( - union_of_None_type_or_strtype_or_array_of_strtype, False, False, 1, None +uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_1_None: Final = ( + _URILoader(union_of_None_type_or_strtype_or_array_of_strtype, False, False, 1, None) ) -union_of_None_type_or_LinkMergeMethodLoader = _UnionLoader( +union_of_None_type_or_LinkMergeMethodLoader: Final = _UnionLoader( ( None_type, LinkMergeMethodLoader, ) ) -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 +uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_2_None: Final = ( + _URILoader(union_of_None_type_or_strtype_or_array_of_strtype, False, False, 2, None) ) -array_of_WorkflowStepInputLoader = _ArrayLoader(WorkflowStepInputLoader) -idmap_in__array_of_WorkflowStepInputLoader = _IdMapLoader( +array_of_WorkflowStepInputLoader: Final = _ArrayLoader(WorkflowStepInputLoader) +idmap_in__array_of_WorkflowStepInputLoader: Final = _IdMapLoader( array_of_WorkflowStepInputLoader, "id", "source" ) -union_of_strtype_or_WorkflowStepOutputLoader = _UnionLoader( +union_of_strtype_or_WorkflowStepOutputLoader: Final = _UnionLoader( ( strtype, WorkflowStepOutputLoader, ) ) -array_of_union_of_strtype_or_WorkflowStepOutputLoader = _ArrayLoader( +array_of_union_of_strtype_or_WorkflowStepOutputLoader: Final = _ArrayLoader( union_of_strtype_or_WorkflowStepOutputLoader ) -union_of_array_of_union_of_strtype_or_WorkflowStepOutputLoader = _UnionLoader( +union_of_array_of_union_of_strtype_or_WorkflowStepOutputLoader: Final = _UnionLoader( (array_of_union_of_strtype_or_WorkflowStepOutputLoader,) ) -uri_union_of_array_of_union_of_strtype_or_WorkflowStepOutputLoader_True_False_None_None = _URILoader( +uri_union_of_array_of_union_of_strtype_or_WorkflowStepOutputLoader_True_False_None_None: ( + Final +) = _URILoader( union_of_array_of_union_of_strtype_or_WorkflowStepOutputLoader, True, False, None, None, ) -array_of_Any_type = _ArrayLoader(Any_type) -union_of_None_type_or_array_of_Any_type = _UnionLoader( +array_of_Any_type: Final = _ArrayLoader(Any_type) +union_of_None_type_or_array_of_Any_type: Final = _UnionLoader( ( None_type, array_of_Any_type, ) ) -idmap_hints_union_of_None_type_or_array_of_Any_type = _IdMapLoader( +idmap_hints_union_of_None_type_or_array_of_Any_type: Final = _IdMapLoader( union_of_None_type_or_array_of_Any_type, "class", "None" ) -union_of_strtype_or_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader = _UnionLoader( +union_of_strtype_or_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader: ( + Final +) = _UnionLoader( ( strtype, CommandLineToolLoader, @@ -25186,64 +25386,70 @@ def save( ProcessGeneratorLoader, ) ) -uri_union_of_strtype_or_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader_False_False_None_None = _URILoader( +uri_union_of_strtype_or_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader_False_False_None_None: ( + Final +) = _URILoader( union_of_strtype_or_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader, False, False, None, None, ) -uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_0_None = _URILoader( - union_of_None_type_or_strtype_or_array_of_strtype, False, False, 0, None +uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_0_None: Final = ( + _URILoader(union_of_None_type_or_strtype_or_array_of_strtype, False, False, 0, None) ) -union_of_None_type_or_ScatterMethodLoader = _UnionLoader( +union_of_None_type_or_ScatterMethodLoader: Final = _UnionLoader( ( None_type, ScatterMethodLoader, ) ) -uri_union_of_None_type_or_ScatterMethodLoader_False_True_None_None = _URILoader( +uri_union_of_None_type_or_ScatterMethodLoader_False_True_None_None: Final = _URILoader( union_of_None_type_or_ScatterMethodLoader, False, True, None, None ) -Workflow_classLoader = _EnumLoader(("Workflow",), "Workflow_class") -uri_Workflow_classLoader_False_True_None_None = _URILoader( +Workflow_classLoader: Final = _EnumLoader(("Workflow",), "Workflow_class") +uri_Workflow_classLoader_False_True_None_None: Final = _URILoader( Workflow_classLoader, False, True, None, None ) -array_of_WorkflowOutputParameterLoader = _ArrayLoader(WorkflowOutputParameterLoader) -idmap_outputs_array_of_WorkflowOutputParameterLoader = _IdMapLoader( +array_of_WorkflowOutputParameterLoader: Final = _ArrayLoader( + WorkflowOutputParameterLoader +) +idmap_outputs_array_of_WorkflowOutputParameterLoader: Final = _IdMapLoader( array_of_WorkflowOutputParameterLoader, "id", "type" ) -array_of_WorkflowStepLoader = _ArrayLoader(WorkflowStepLoader) -union_of_array_of_WorkflowStepLoader = _UnionLoader((array_of_WorkflowStepLoader,)) -idmap_steps_union_of_array_of_WorkflowStepLoader = _IdMapLoader( +array_of_WorkflowStepLoader: Final = _ArrayLoader(WorkflowStepLoader) +union_of_array_of_WorkflowStepLoader: Final = _UnionLoader( + (array_of_WorkflowStepLoader,) +) +idmap_steps_union_of_array_of_WorkflowStepLoader: Final = _IdMapLoader( union_of_array_of_WorkflowStepLoader, "id", "None" ) -SubworkflowFeatureRequirement_classLoader = _EnumLoader( +SubworkflowFeatureRequirement_classLoader: Final = _EnumLoader( ("SubworkflowFeatureRequirement",), "SubworkflowFeatureRequirement_class" ) -uri_SubworkflowFeatureRequirement_classLoader_False_True_None_None = _URILoader( +uri_SubworkflowFeatureRequirement_classLoader_False_True_None_None: Final = _URILoader( SubworkflowFeatureRequirement_classLoader, False, True, None, None ) -ScatterFeatureRequirement_classLoader = _EnumLoader( +ScatterFeatureRequirement_classLoader: Final = _EnumLoader( ("ScatterFeatureRequirement",), "ScatterFeatureRequirement_class" ) -uri_ScatterFeatureRequirement_classLoader_False_True_None_None = _URILoader( +uri_ScatterFeatureRequirement_classLoader_False_True_None_None: Final = _URILoader( ScatterFeatureRequirement_classLoader, False, True, None, None ) -MultipleInputFeatureRequirement_classLoader = _EnumLoader( +MultipleInputFeatureRequirement_classLoader: Final = _EnumLoader( ("MultipleInputFeatureRequirement",), "MultipleInputFeatureRequirement_class" ) -uri_MultipleInputFeatureRequirement_classLoader_False_True_None_None = _URILoader( - MultipleInputFeatureRequirement_classLoader, False, True, None, None +uri_MultipleInputFeatureRequirement_classLoader_False_True_None_None: Final = ( + _URILoader(MultipleInputFeatureRequirement_classLoader, False, True, None, None) ) -StepInputExpressionRequirement_classLoader = _EnumLoader( +StepInputExpressionRequirement_classLoader: Final = _EnumLoader( ("StepInputExpressionRequirement",), "StepInputExpressionRequirement_class" ) -uri_StepInputExpressionRequirement_classLoader_False_True_None_None = _URILoader( +uri_StepInputExpressionRequirement_classLoader_False_True_None_None: Final = _URILoader( StepInputExpressionRequirement_classLoader, False, True, None, None ) -uri_strtype_False_True_None_None = _URILoader(strtype, False, True, None, None) -LoadListingEnumLoader = _EnumLoader( +uri_strtype_False_True_None_None: Final = _URILoader(strtype, False, True, None, None) +LoadListingEnumLoader: Final = _EnumLoader( ( "no_listing", "shallow_listing", @@ -25251,42 +25457,44 @@ def save( ), "LoadListingEnum", ) -union_of_LoadListingEnumLoader = _UnionLoader((LoadListingEnumLoader,)) -uri_array_of_strtype_False_False_0_None = _URILoader( +union_of_LoadListingEnumLoader: Final = _UnionLoader((LoadListingEnumLoader,)) +uri_array_of_strtype_False_False_0_None: Final = _URILoader( array_of_strtype, False, False, 0, None ) -union_of_inttype_or_strtype = _UnionLoader( +union_of_inttype_or_strtype: Final = _UnionLoader( ( inttype, strtype, ) ) -union_of_booltype_or_strtype = _UnionLoader( +union_of_booltype_or_strtype: Final = _UnionLoader( ( booltype, strtype, ) ) -union_of_inttype_or_ExpressionLoader = _UnionLoader( +union_of_inttype_or_ExpressionLoader: Final = _UnionLoader( ( inttype, ExpressionLoader, ) ) -union_of_strtype_or_array_of_strtype = _UnionLoader( +union_of_strtype_or_array_of_strtype: Final = _UnionLoader( ( strtype, array_of_strtype, ) ) -union_of_None_type_or_inttype_or_ExpressionLoader = _UnionLoader( +union_of_None_type_or_inttype_or_ExpressionLoader: Final = _UnionLoader( ( None_type, inttype, ExpressionLoader, ) ) -union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader = _UnionLoader( +union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader: ( + Final +) = _UnionLoader( ( CommandLineToolLoader, ExpressionToolLoader, @@ -25294,10 +25502,14 @@ def save( ProcessGeneratorLoader, ) ) -array_of_union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader = _ArrayLoader( +array_of_union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader: ( + Final +) = _ArrayLoader( union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader ) -union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader_or_array_of_union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader = _UnionLoader( +union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader_or_array_of_union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader: ( + Final +) = _UnionLoader( ( CommandLineToolLoader, ExpressionToolLoader, @@ -25311,6 +25523,7 @@ def save( ( booltype, inttype, + longtype, floattype, strtype, FileLoader, @@ -25319,12 +25532,15 @@ def save( map_of_union_of_None_type_or_CWLObjectTypeLoader, ) ) +CWLObjectType: TypeAlias = ( + "Directory | File | Mapping[str, CWLObjectType | None] | Sequence[CWLObjectType | None] | bool | float | i32 | i64 | str" +) def load_document( doc: Any, - baseuri: Optional[str] = None, - loadingOptions: Optional[LoadingOptions] = None, + baseuri: str | None = None, + loadingOptions: LoadingOptions | None = None, ) -> Any: if baseuri is None: baseuri = file_uri(os.getcwd()) + "/" @@ -25341,9 +25557,9 @@ def load_document( def load_document_with_metadata( doc: Any, - baseuri: Optional[str] = None, - loadingOptions: Optional[LoadingOptions] = None, - addl_metadata_fields: Optional[MutableSequence[str]] = None, + baseuri: str | None = None, + loadingOptions: LoadingOptions | None = None, + addl_metadata_fields: MutableSequence[str] | None = None, ) -> Any: if baseuri is None: baseuri = file_uri(os.getcwd()) + "/" @@ -25361,7 +25577,7 @@ def load_document_with_metadata( def load_document_by_string( string: Any, uri: str, - loadingOptions: Optional[LoadingOptions] = None, + loadingOptions: LoadingOptions | None = None, ) -> Any: yaml = yaml_no_ts() result = yaml.load(string) @@ -25382,7 +25598,7 @@ def load_document_by_string( def load_document_by_yaml( yaml: Any, uri: str, - loadingOptions: Optional[LoadingOptions] = None, + loadingOptions: LoadingOptions | None = None, ) -> Any: """ Shortcut to load via a YAML object. diff --git a/cwl_utils/parser/cwl_v1_0_utils.py b/cwl_utils/parser/cwl_v1_0_utils.py index 2400298b..38e3e320 100644 --- a/cwl_utils/parser/cwl_v1_0_utils.py +++ b/cwl_utils/parser/cwl_v1_0_utils.py @@ -2,10 +2,10 @@ import hashlib import logging from collections import namedtuple -from collections.abc import MutableMapping, MutableSequence +from collections.abc import MutableMapping, MutableSequence, Sequence from io import StringIO from pathlib import Path -from typing import Any, IO, cast +from typing import IO, Any, Literal, TypeAlias, TypeVar, cast from urllib.parse import urldefrag from schema_salad.exceptions import ValidationException @@ -16,6 +16,7 @@ import cwl_utils.parser.cwl_v1_0 as cwl import cwl_utils.parser.utils from cwl_utils.errors import WorkflowException +from cwl_utils.types import is_sequence from cwl_utils.utils import yaml_dumps CONTENT_LIMIT: int = 64 * 1024 @@ -24,6 +25,132 @@ SrcSink = namedtuple("SrcSink", ["src", "sink", "linkMerge", "message"]) +BasicInputTypeSchemas: TypeAlias = ( + cwl.InputArraySchema + | cwl.InputEnumSchema + | cwl.InputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] +) +InputTypeSchemas: TypeAlias = BasicInputTypeSchemas | Sequence[BasicInputTypeSchemas] +BasicCommandInputTypeSchemas: TypeAlias = ( + cwl.CommandInputArraySchema + | cwl.CommandInputEnumSchema + | cwl.CommandInputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] +) +CommandInputTypeSchemas: TypeAlias = ( + BasicCommandInputTypeSchemas | Sequence[BasicCommandInputTypeSchemas] +) +BasicOutputTypeSchemas: TypeAlias = ( + cwl.OutputArraySchema + | cwl.OutputEnumSchema + | cwl.OutputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] +) +OutputTypeSchemas: TypeAlias = BasicOutputTypeSchemas | Sequence[BasicOutputTypeSchemas] +BasicCommandOutputTypeSchemas: TypeAlias = ( + cwl.CommandOutputArraySchema + | cwl.CommandOutputEnumSchema + | cwl.CommandOutputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] +) +CommandOutputTypeSchemas: TypeAlias = ( + BasicCommandOutputTypeSchemas | Sequence[BasicCommandOutputTypeSchemas] +) +AnyTypeSchema = TypeVar( + "AnyTypeSchema", bound=InputTypeSchemas | CommandOutputTypeSchemas +) + + +def _in_output_type_schema_to_output_type_schema( + schema_type: BasicInputTypeSchemas | BasicOutputTypeSchemas, + loading_options: cwl.LoadingOptions, +) -> BasicOutputTypeSchemas: + match schema_type: + case cwl.ArraySchema(): + return cwl.OutputArraySchema.fromDoc( + schema_type.save(), + loading_options.baseuri, + loading_options, + ) + case cwl.EnumSchema(): + return cwl.OutputEnumSchema.fromDoc( + schema_type.save(), + loading_options.baseuri, + loading_options, + ) + case cwl.RecordSchema(): + return cwl.OutputRecordSchema.fromDoc( + schema_type.save(), + loading_options.baseuri, + loading_options, + ) + case str(): + return schema_type + raise WorkflowException(f"Unexpected output type: {schema_type}.") + + +def in_output_type_schema_to_output_type_schema( + schema_type: ( + BasicInputTypeSchemas + | BasicOutputTypeSchemas + | Sequence[BasicInputTypeSchemas | BasicOutputTypeSchemas] + ), + loading_options: cwl.LoadingOptions, +) -> OutputTypeSchemas: + if is_sequence(schema_type): + return [ + _in_output_type_schema_to_output_type_schema( + schema_type_item, loading_options + ) + for schema_type_item in schema_type + ] + return _in_output_type_schema_to_output_type_schema(schema_type, loading_options) + def _compare_records( src: cwl.RecordSchema, sink: cwl.RecordSchema, strict: bool = False @@ -181,7 +308,7 @@ def can_assign_src_to_sink(src: Any, sink: Any, strict: bool = False) -> bool: def check_all_types( src_dict: dict[str, Any], - sinks: MutableSequence[cwl.WorkflowStepInput | cwl.WorkflowOutputParameter], + sinks: Sequence[cwl.WorkflowStepInput | cwl.WorkflowOutputParameter], type_dict: dict[str, Any], ) -> dict[str, list[SrcSink]]: """Given a list of sinks, check if their types match with the types of their sources.""" @@ -195,23 +322,23 @@ def check_all_types( sourceName = "source" sourceField = sink.source case _: - continue + raise WorkflowException(f"Invalid sink type {sink.__class__.__name__}") if sourceField is not None: - if isinstance(sourceField, MutableSequence): - linkMerge = sink.linkMerge or ( - "merge_nested" if len(sourceField) > 1 else None - ) - srcs_of_sink = [] - for parm_id in sourceField: - srcs_of_sink += [src_dict[parm_id]] - else: - parm_id = cast(str, sourceField) + if isinstance(sourceField, str): + parm_id = sourceField if parm_id not in src_dict: raise SourceLine(sink, sourceName, ValidationException).makeError( f"{sourceName} not found: {parm_id}" ) srcs_of_sink = [src_dict[parm_id]] linkMerge = None + else: + linkMerge = sink.linkMerge or ( + "merge_nested" if len(sourceField) > 1 else None + ) + srcs_of_sink = [] + for parm_id in sourceField: + srcs_of_sink += [src_dict[parm_id]] for src in srcs_of_sink: check_result = check_types( type_dict[cast(str, src.id)], @@ -364,48 +491,62 @@ def merge_flatten_type(src: Any) -> Any: return cwl.ArraySchema(type_="array", items=src) +def to_input_array(type_: InputTypeSchemas) -> cwl.InputArraySchema: + return cwl.InputArraySchema(type_="array", items=type_) + + +def to_output_array(type_: OutputTypeSchemas) -> cwl.OutputArraySchema: + return cwl.OutputArraySchema(type_="array", items=type_) + + def type_for_step_input( step: cwl.WorkflowStep, in_: cwl.WorkflowStepInput, -) -> Any: +) -> cwl_utils.parser.utils.InputTypeSchemas | None: """Determine the type for the given step input.""" if in_.valueFrom is not None: return "Any" step_run = cwl_utils.parser.utils.load_step(step) cwl_utils.parser.utils.convert_stdstreams_to_files(step_run) - if step_run and step_run.inputs: - for step_input in step_run.inputs: - if cast(str, step_input.id).split("#")[-1] == in_.id.split("#")[-1]: - 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") - return input_type + for step_input in step_run.inputs: + if step_input.id.split("#")[-1] == in_.id.split("#")[-1]: + input_type = step_input.type_ + if ( + input_type is not None + and step.scatter is not None + and in_.id in aslist(step.scatter) + ): + input_type = cwl_utils.parser.utils.to_input_array( + input_type, step_run.cwlVersion or "v1.0" + ) + return input_type return "Any" def type_for_step_output( step: cwl.WorkflowStep, sourcename: str, -) -> Any: +) -> cwl_utils.parser.utils.OutputTypeSchemas | None: """Determine the type for the given step output.""" step_run = cwl_utils.parser.utils.load_step(step) cwl_utils.parser.utils.convert_stdstreams_to_files(step_run) - if step_run and step_run.outputs: - for step_output in step_run.outputs: - if ( - step_output.id.split("#")[-1].split("/")[-1] - == sourcename.split("#")[-1].split("/")[-1] - ): - 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" - ) - else: - output_type = cwl.ArraySchema(items=output_type, type_="array") - return output_type + for output in step_run.outputs: + if ( + output.id.split("#")[-1].split("/")[-1] + == sourcename.split("#")[-1].split("/")[-1] + ): + output_type = output.type_ + if output_type is not None and step.scatter is not None: + if step.scatterMethod == "nested_crossproduct": + for _ in range(len(aslist(step.scatter))): + output_type = cwl_utils.parser.utils.to_output_array( + output_type, step_run.cwlVersion or "v1.0" + ) + else: + output_type = cwl_utils.parser.utils.to_output_array( + output_type, step_run.cwlVersion or "v1.0" + ) + return output_type raise ValidationException( "param {} not found in {}.".format( sourcename, @@ -415,33 +556,52 @@ def type_for_step_output( def type_for_source( - process: cwl.CommandLineTool | cwl.Workflow | cwl.ExpressionTool, - sourcenames: str | list[str], + process: cwl.Process, + sourcenames: str | Sequence[str], parent: cwl.Workflow | None = None, linkMerge: str | None = None, -) -> Any: +) -> ( + MutableSequence[InputTypeSchemas | OutputTypeSchemas] + | InputTypeSchemas + | OutputTypeSchemas +): """Determine the type for the given sourcenames.""" scatter_context: list[tuple[int, str] | None] = [] params = param_for_source_id(process, sourcenames, parent, scatter_context) if not isinstance(params, MutableSequence): - new_type = params.type_ + new_type: InputTypeSchemas | OutputTypeSchemas = 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.OutputArraySchema( + items=in_output_type_schema_to_output_type_schema( + new_type, process.loadingOptions # type: ignore[attr-defined] + ), + type_="array", + ) else: - new_type = cwl.ArraySchema(items=new_type, type_="array") + new_type = cwl.OutputArraySchema( + items=in_output_type_schema_to_output_type_schema( + new_type, process.loadingOptions # type: ignore[attr-defined] + ), + type_="array", + ) if linkMerge == "merge_nested": - new_type = cwl.ArraySchema(items=new_type, type_="array") + new_type = cwl.OutputArraySchema( + items=in_output_type_schema_to_output_type_schema( + new_type, process.loadingOptions # type: ignore[attr-defined] + ), + type_="array", + ) elif linkMerge == "merge_flattened": new_type = merge_flatten_type(new_type) return new_type - new_type = [] + new_types: MutableSequence[InputTypeSchemas | OutputTypeSchemas] = [] for p, sc in zip(params, scatter_context): - if isinstance(p, str) and not any(_compare_type(t, p) for t in new_type): + if isinstance(p, str) and not any(_compare_type(t, p) for t in new_types): cur_type = p elif hasattr(p, "type_") and not any( - _compare_type(t, p.type_) for t in new_type + _compare_type(t, p.type_) for t in new_types ): cur_type = p.type_ else: @@ -450,35 +610,78 @@ def type_for_source( 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.OutputArraySchema( + items=in_output_type_schema_to_output_type_schema( + cur_type, process.loadingOptions # type: ignore[attr-defined] + ), + type_="array", + ) else: - cur_type = cwl.ArraySchema(items=cur_type, type_="array") - new_type.append(cur_type) - if len(new_type) == 1: - new_type = new_type[0] + cur_type = cwl.OutputArraySchema( + items=in_output_type_schema_to_output_type_schema( + cur_type, process.loadingOptions # type: ignore[attr-defined] + ), + type_="array", + ) + new_types.append(cur_type) + if len(new_types) == 1: + final_type: ( + MutableSequence[InputTypeSchemas | OutputTypeSchemas] + | InputTypeSchemas + | OutputTypeSchemas + ) = new_types[0] + else: + final_type = new_types if linkMerge == "merge_nested": - return cwl.ArraySchema(items=new_type, type_="array") + final_type = cwl.OutputArraySchema( + items=final_type, + type_="array", + ) elif linkMerge == "merge_flattened": - return merge_flatten_type(new_type) + final_type = merge_flatten_type(final_type) elif isinstance(sourcenames, list) and len(sourcenames) > 1: - return cwl.ArraySchema(items=new_type, type_="array") - return new_type + return cwl.OutputArraySchema( + items=final_type, + type_="array", + ) + return final_type def param_for_source_id( - process: cwl.CommandLineTool | cwl.Workflow | cwl.ExpressionTool, - sourcenames: str | list[str], + process: cwl.Process, + sourcenames: str | Sequence[str], parent: cwl.Workflow | None = None, scatter_context: list[tuple[int, str] | None] | None = None, ) -> ( - cwl.InputParameter - | cwl.CommandOutputParameter - | MutableSequence[cwl.InputParameter | cwl.CommandOutputParameter] + cwl_utils.parser.CommandInputParameter + | cwl_utils.parser.CommandOutputParameter + | cwl_utils.parser.ExpressionToolOutputParameter + | cwl_utils.parser.OperationInputParameter + | cwl_utils.parser.OperationOutputParameter + | cwl_utils.parser.WorkflowInputParameter + | cwl_utils.parser.WorkflowOutputParameter + | MutableSequence[ + cwl_utils.parser.CommandInputParameter + | cwl_utils.parser.CommandOutputParameter + | cwl_utils.parser.ExpressionToolOutputParameter + | cwl_utils.parser.OperationInputParameter + | cwl_utils.parser.OperationOutputParameter + | cwl_utils.parser.WorkflowInputParameter + | cwl_utils.parser.WorkflowOutputParameter + ] ): """Find the process input parameter that matches one of the given sourcenames.""" if isinstance(sourcenames, str): sourcenames = [sourcenames] - params: MutableSequence[cwl.InputParameter | cwl.CommandOutputParameter] = [] + params: MutableSequence[ + cwl_utils.parser.CommandInputParameter + | cwl_utils.parser.CommandOutputParameter + | cwl_utils.parser.ExpressionToolOutputParameter + | cwl_utils.parser.OperationInputParameter + | cwl_utils.parser.OperationOutputParameter + | cwl_utils.parser.WorkflowInputParameter + | cwl_utils.parser.WorkflowOutputParameter + ] = [] for sourcename in sourcenames: if not isinstance(process, cwl.Workflow): for param in process.inputs: @@ -518,26 +721,25 @@ def param_for_source_id( ): params.append(output) if scatter_context is not None: - if isinstance(step.scatter, str): - scatter_context.append( - ( - 1, - step.scatterMethod - or "dotproduct", + match step.scatter: + case str(): + scatter_context.append( + ( + 1, + step.scatterMethod + or "dotproduct", + ) ) - ) - elif isinstance( - step.scatter, MutableSequence - ): - scatter_context.append( - ( - len(step.scatter), - step.scatterMethod - or "dotproduct", + case Sequence(): + scatter_context.append( + ( + len(step.scatter), + step.scatterMethod + or "dotproduct", + ) ) - ) - else: - scatter_context.append(None) + case _: + scatter_context.append(None) if len(params) == 1: return params[0] elif len(params) > 1: diff --git a/cwl_utils/parser/cwl_v1_1.py b/cwl_utils/parser/cwl_v1_1.py index 744cba7f..f229e0b0 100644 --- a/cwl_utils/parser/cwl_v1_1.py +++ b/cwl_utils/parser/cwl_v1_1.py @@ -3,18 +3,24 @@ # The code itself is released under the Apache 2.0 license and the help text is # subject to the license of the original schema. +from __future__ import annotations + import copy import logging import os import pathlib +import sys import tempfile import uuid as _uuid__ # pylint: disable=unused-import # noqa: F401 import xml.sax # nosec -from abc import ABC, abstractmethod +from abc import ABCMeta, abstractmethod from collections.abc import MutableMapping, MutableSequence, Sequence +from collections.abc import Collection # pylint: disable=unused-import # noqa: F401 from io import StringIO from itertools import chain -from typing import Any, Final, Optional, Union, cast +from mypy_extensions import i32, i64, trait +from typing import Any, Final, Generic, TypeAlias, TypeVar, cast +from typing import ClassVar, Literal, Mapping # pylint: disable=unused-import # noqa: F401 from urllib.parse import quote, urldefrag, urlparse, urlsplit, urlunsplit from urllib.request import pathname2url @@ -27,22 +33,28 @@ from schema_salad.sourceline import SourceLine, add_lc_filename from schema_salad.utils import CacheType, yaml_no_ts # requires schema-salad v8.2+ -_vocab: dict[str, str] = {} -_rvocab: dict[str, str] = {} +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + +_vocab: Final[dict[str, str]] = {} +_rvocab: Final[dict[str, str]] = {} _logger: Final = logging.getLogger("salad") -IdxType = MutableMapping[str, tuple[Any, "LoadingOptions"]] +IdxType: TypeAlias = MutableMapping[str, tuple[Any, "LoadingOptions"]] +S = TypeVar("S", bound="Saveable") class LoadingOptions: idx: Final[IdxType] - fileuri: Final[Optional[str]] + fileuri: Final[str | None] baseuri: Final[str] namespaces: Final[MutableMapping[str, str]] schemas: Final[MutableSequence[str]] - original_doc: Final[Optional[Any]] + original_doc: Final[Any | None] addl_metadata: Final[MutableMapping[str, Any]] fetcher: Final[Fetcher] vocab: Final[dict[str, str]] @@ -50,24 +62,24 @@ class LoadingOptions: cache: Final[CacheType] imports: Final[list[str]] includes: Final[list[str]] - no_link_check: Final[Optional[bool]] - container: Final[Optional[str]] + no_link_check: Final[bool | None] + container: Final[str | None] def __init__( self, - fetcher: Optional[Fetcher] = None, - namespaces: Optional[dict[str, str]] = None, - schemas: Optional[list[str]] = None, - fileuri: Optional[str] = None, - copyfrom: Optional["LoadingOptions"] = None, - original_doc: Optional[Any] = None, - addl_metadata: Optional[dict[str, str]] = None, - baseuri: Optional[str] = None, - idx: Optional[IdxType] = None, - imports: Optional[list[str]] = None, - includes: Optional[list[str]] = None, - no_link_check: Optional[bool] = None, - container: Optional[str] = None, + fetcher: Fetcher | None = None, + namespaces: dict[str, str] | None = None, + schemas: list[str] | None = None, + fileuri: str | None = None, + copyfrom: LoadingOptions | None = None, + original_doc: Any | None = None, + addl_metadata: dict[str, str] | None = None, + baseuri: str | None = None, + idx: IdxType | None = None, + imports: list[str] | None = None, + includes: list[str] | None = None, + no_link_check: bool | None = None, + container: str | None = None, ) -> None: """Create a LoadingOptions object.""" self.original_doc = original_doc @@ -79,7 +91,7 @@ def __init__( self.idx = temp_idx if fileuri is not None: - temp_fileuri: Optional[str] = fileuri + temp_fileuri: str | None = fileuri else: temp_fileuri = copyfrom.fileuri if copyfrom is not None else None self.fileuri = temp_fileuri @@ -121,13 +133,13 @@ def __init__( self.includes = temp_includes if no_link_check is not None: - temp_no_link_check: Optional[bool] = no_link_check + temp_no_link_check: bool | None = no_link_check else: temp_no_link_check = copyfrom.no_link_check if copyfrom is not None else False self.no_link_check = temp_no_link_check if container is not None: - temp_container: Optional[str] = container + temp_container: str | None = container else: temp_container = copyfrom.container if copyfrom is not None else None self.container = temp_container @@ -201,7 +213,8 @@ def graph(self) -> Graph: return graph -class Saveable(ABC): +@trait +class Saveable(metaclass=ABCMeta): """Mark classes than have a save() and fromDoc() function.""" @classmethod @@ -211,8 +224,8 @@ def fromDoc( _doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - ) -> "Saveable": + docRoot: str | None = None, + ) -> Self: """Construct this object from the result of yaml.load().""" @abstractmethod @@ -223,11 +236,11 @@ def save( def load_field( - val: Union[str, dict[str, str]], + val: Any | None, fieldtype: "_Loader", baseuri: str, loadingOptions: LoadingOptions, - lc: Optional[list[Any]] = None, + lc: Any | None = None, ) -> Any: """Load field.""" if isinstance(val, MutableMapping): @@ -251,7 +264,9 @@ def load_field( return fieldtype.load(val, baseuri, loadingOptions, lc=lc) -save_type = Optional[Union[MutableMapping[str, Any], MutableSequence[Any], int, float, bool, str]] +save_type: TypeAlias = ( + None | MutableMapping[str, Any] | MutableSequence[Any] | i32 | i64 | float | bool | str +) def extract_type(val_type: type[Any]) -> str: @@ -328,7 +343,7 @@ def save( for key in val: newdict[key] = save(val[key], top=False, base_url=base_url, relative_uris=relative_uris) return newdict - if val is None or isinstance(val, (int, float, bool, str)): + if val is None or isinstance(val, (i32, i64, float, bool, str)): return val raise Exception("Not Saveable: %s" % type(val)) @@ -367,7 +382,7 @@ def expand_url( loadingOptions: LoadingOptions, scoped_id: bool = False, vocab_term: bool = False, - scoped_ref: Optional[int] = None, + scoped_ref: int | None = None, ) -> str: if url in ("@id", "@type"): return url @@ -434,9 +449,9 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, - ) -> Any: + docRoot: str | None = None, + lc: Any | None = None, + ) -> Any | None: pass @@ -446,8 +461,8 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, + docRoot: str | None = None, + lc: Any | None = None, ) -> Any: if doc is not None: return doc @@ -455,7 +470,7 @@ def load( class _PrimitiveLoader(_Loader): - def __init__(self, tp: Union[type, tuple[type[str], type[str]]]) -> None: + def __init__(self, tp: type | tuple[type[str], type[str]]) -> None: self.tp: Final = tp def load( @@ -463,8 +478,8 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, + docRoot: str | None = None, + lc: Any | None = None, ) -> Any: if not isinstance(doc, self.tp): raise ValidationException(f"Expected a {self.tp} but got {doc.__class__.__name__}") @@ -483,9 +498,9 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, - ) -> Any: + docRoot: str | None = None, + lc: Any | None = None, + ) -> list[Any]: if not isinstance(doc, MutableSequence): raise ValidationException( f"Value is a {convert_typing(extract_type(type(doc)))}, " @@ -535,9 +550,9 @@ class _MapLoader(_Loader): def __init__( self, values: _Loader, - name: Optional[str] = None, - container: Optional[str] = None, - no_link_check: Optional[bool] = None, + name: str | None = None, + container: str | None = None, + no_link_check: bool | None = None, ) -> None: self.values: Final = values self.name: Final = name @@ -549,9 +564,9 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, - ) -> Any: + docRoot: str | None = None, + lc: Any | None = None, + ) -> dict[str, 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: @@ -584,11 +599,11 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, - ) -> Any: + docRoot: str | None = None, + lc: Any | None = None, + ) -> str: if doc in self.symbols: - return doc + return cast(str, doc) raise ValidationException(f"Expected one of {self.symbols}") def __repr__(self) -> str: @@ -604,75 +619,76 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, + docRoot: str | None = None, + lc: Any | None = None, ) -> Any: r: Final[list[dict[str, Any]]] = [] - if isinstance(doc, MutableSequence): - for d in doc: - if isinstance(d, str): - if d.endswith("?"): - r.append({"pattern": d[:-1], "required": False}) - else: - r.append({"pattern": d}) - elif isinstance(d, dict): - new_dict1: dict[str, Any] = {} - dict_copy = copy.deepcopy(d) - if "pattern" in dict_copy: - new_dict1["pattern"] = dict_copy.pop("pattern") - else: - raise ValidationException( - f"Missing pattern in secondaryFiles specification entry: {d}" + match doc: + case MutableSequence() as dlist: + for d in dlist: + if isinstance(d, str): + if d.endswith("?"): + r.append({"pattern": d[:-1], "required": False}) + else: + r.append({"pattern": d}) + elif isinstance(d, dict): + new_dict1: dict[str, Any] = {} + dict_copy = copy.deepcopy(d) + if "pattern" in dict_copy: + new_dict1["pattern"] = dict_copy.pop("pattern") + else: + raise ValidationException( + f"Missing pattern in secondaryFiles specification entry: {d}" + ) + new_dict1["required"] = ( + dict_copy.pop("required") if "required" in dict_copy else None ) - new_dict1["required"] = ( - dict_copy.pop("required") if "required" in dict_copy else None - ) - if len(dict_copy): - raise ValidationException( - "Unallowed values in secondaryFiles specification entry: {}".format( - dict_copy + if len(dict_copy): + raise ValidationException( + "Unallowed values in secondaryFiles specification entry: {}".format( + dict_copy + ) ) - ) - r.append(new_dict1) + r.append(new_dict1) + else: + raise ValidationException( + "Expected a string or sequence of (strings or mappings)." + ) + case MutableMapping() as decl: + new_dict2 = {} + doc_copy = copy.deepcopy(decl) + if "pattern" in doc_copy: + new_dict2["pattern"] = doc_copy.pop("pattern") else: raise ValidationException( - "Expected a string or sequence of (strings or mappings)." + f"Missing pattern in secondaryFiles specification entry: {decl}" ) - elif isinstance(doc, MutableMapping): - new_dict2: Final = {} - doc_copy: Final = copy.deepcopy(doc) - if "pattern" in doc_copy: - new_dict2["pattern"] = doc_copy.pop("pattern") - else: - raise ValidationException( - f"Missing pattern in secondaryFiles specification entry: {doc}" - ) - new_dict2["required"] = doc_copy.pop("required") if "required" in doc_copy else None + new_dict2["required"] = doc_copy.pop("required") if "required" in doc_copy else None - if len(doc_copy): - raise ValidationException( - f"Unallowed values in secondaryFiles specification entry: {doc_copy}" - ) - r.append(new_dict2) + if len(doc_copy): + raise ValidationException( + f"Unallowed values in secondaryFiles specification entry: {doc_copy}" + ) + r.append(new_dict2) - elif isinstance(doc, str): - if doc.endswith("?"): - r.append({"pattern": doc[:-1], "required": False}) - else: - r.append({"pattern": doc}) - else: - raise ValidationException("Expected str or sequence of str") + case str(decl): + if decl.endswith("?"): + r.append({"pattern": decl[:-1], "required": False}) + else: + r.append({"pattern": decl}) + case _: + raise ValidationException("Expected str or sequence of str") return self.inner.load(r, baseuri, loadingOptions, docRoot, lc=lc) -class _RecordLoader(_Loader): +class _RecordLoader(_Loader, Generic[S]): def __init__( self, - classtype: type[Saveable], - container: Optional[str] = None, - no_link_check: Optional[bool] = None, + classtype: type[S], + container: str | None = None, + no_link_check: bool | None = None, ) -> None: self.classtype: Final = classtype self.container: Final = container @@ -683,9 +699,9 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, - ) -> Any: + docRoot: str | None = None, + lc: Any | None = None, + ) -> S: if not isinstance(doc, MutableMapping): raise ValidationException( f"Value is a {convert_typing(extract_type(type(doc)))}, " @@ -710,19 +726,20 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, - ) -> Any: + docRoot: str | None = None, + lc: Any | None = None, + ) -> str: if not isinstance(doc, str): raise ValidationException( f"Value is a {convert_typing(extract_type(type(doc)))}, " f"but valid type for this field is a str." ) - return doc + else: + return doc class _UnionLoader(_Loader): - def __init__(self, alternates: Sequence[_Loader], name: Optional[str] = None) -> None: + def __init__(self, alternates: Sequence[_Loader], name: str | None = None) -> None: self.alternates = alternates self.name: Final = name @@ -734,8 +751,8 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, + docRoot: str | None = None, + lc: Any | None = None, ) -> Any: errors: Final = [] @@ -817,8 +834,8 @@ def __init__( inner: _Loader, scoped_id: bool, vocab_term: bool, - scoped_ref: Optional[int], - no_link_check: Optional[bool], + scoped_ref: int | None, + no_link_check: bool | None, ) -> None: self.inner: Final = inner self.scoped_id: Final = scoped_id @@ -831,39 +848,40 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, + docRoot: str | None = None, + lc: Any | None = None, ) -> Any: if self.no_link_check is not None: loadingOptions = LoadingOptions( copyfrom=loadingOptions, no_link_check=self.no_link_check ) - if isinstance(doc, MutableSequence): - newdoc: Final = [] - for i in doc: - if isinstance(i, str): - newdoc.append( - expand_url( - i, - baseuri, - loadingOptions, - self.scoped_id, - self.vocab_term, - self.scoped_ref, - ) - ) - else: - newdoc.append(i) - doc = newdoc - elif isinstance(doc, str): - doc = expand_url( - doc, - baseuri, - loadingOptions, - self.scoped_id, - self.vocab_term, - self.scoped_ref, - ) + match doc: + case MutableSequence() as decl: + newdoc: Final = [] + for i in decl: + if isinstance(i, str): + newdoc.append( + expand_url( + i, + baseuri, + loadingOptions, + self.scoped_id, + self.vocab_term, + self.scoped_ref, + ) + ) + else: + newdoc.append(i) + doc = newdoc + case str(decl): + doc = expand_url( + decl, + baseuri, + loadingOptions, + self.scoped_id, + self.vocab_term, + self.scoped_ref, + ) if isinstance(doc, str): if not loadingOptions.no_link_check: errors: Final = [] @@ -880,7 +898,7 @@ def load( class _TypeDSLLoader(_Loader): - def __init__(self, inner: _Loader, refScope: Optional[int], salad_version: str) -> None: + def __init__(self, inner: _Loader, refScope: int | None, salad_version: str) -> None: self.inner: Final = inner self.refScope: Final = refScope self.salad_version: Final = salad_version @@ -890,7 +908,7 @@ def resolve( doc: str, baseuri: str, loadingOptions: LoadingOptions, - ) -> Union[list[Union[dict[str, Any], str]], dict[str, Any], str]: + ) -> list[dict[str, Any] | str] | dict[str, Any] | str: doc_ = doc optional = False if doc_.endswith("?"): @@ -899,7 +917,7 @@ def resolve( if doc_.endswith("[]"): salad_versions: Final = [int(v) for v in self.salad_version[1:].split(".")] - items: Union[list[Union[dict[str, Any], str]], dict[str, Any], str] = "" + items: list[dict[str, Any] | str] | dict[str, Any] | str = "" rest: Final = doc_[0:-2] if salad_versions < [1, 3]: if rest.endswith("[]"): @@ -911,7 +929,7 @@ def resolve( items = self.resolve(rest, baseuri, loadingOptions) if isinstance(items, str): items = expand_url(items, baseuri, loadingOptions, False, True, self.refScope) - expanded: Union[dict[str, Any], str] = {"type": "array", "items": items} + expanded: dict[str, Any] | str = {"type": "array", "items": items} else: expanded = expand_url(doc_, baseuri, loadingOptions, False, True, self.refScope) @@ -925,8 +943,8 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, + docRoot: str | None = None, + lc: Any | None = None, ) -> Any: if isinstance(doc, MutableSequence): r: Final[list[Any]] = [] @@ -950,7 +968,7 @@ def load( class _IdMapLoader(_Loader): - def __init__(self, inner: _Loader, mapSubject: str, mapPredicate: Optional[str]) -> None: + def __init__(self, inner: _Loader, mapSubject: str, mapPredicate: str | None) -> None: self.inner: Final = inner self.mapSubject: Final = mapSubject self.mapPredicate: Final = mapPredicate @@ -960,8 +978,8 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, + docRoot: str | None = None, + lc: Any | None = None, ) -> Any: if isinstance(doc, MutableMapping): r: Final[list[Any]] = [] @@ -990,10 +1008,10 @@ def load( def _document_load( loader: _Loader, - doc: Union[str, MutableMapping[str, Any], MutableSequence[Any]], + doc: str | MutableMapping[str, Any] | MutableSequence[Any], baseuri: str, loadingOptions: LoadingOptions, - addl_metadata_fields: Optional[MutableSequence[str]] = None, + addl_metadata_fields: MutableSequence[str] | None = None, ) -> tuple[Any, LoadingOptions]: if isinstance(doc, str): return _document_load_by_url( @@ -1062,7 +1080,7 @@ def _document_load_by_url( loader: _Loader, url: str, loadingOptions: LoadingOptions, - addl_metadata_fields: Optional[MutableSequence[str]] = None, + addl_metadata_fields: MutableSequence[str] | None = None, ) -> tuple[Any, LoadingOptions]: if url in loadingOptions.idx: return loadingOptions.idx[url] @@ -1117,7 +1135,7 @@ def save_relative_uri( uri: Any, base_url: str, scoped_id: bool, - ref_scope: Optional[int], + ref_scope: int | None, relative_uris: bool, ) -> Any: """Convert any URI to a relative one, obeying the scoping rules.""" @@ -1168,8 +1186,9 @@ def parser_info() -> str: return "org.w3id.cwl.v1_1" -class Documented(Saveable): - pass +@trait +class Documented(Saveable, metaclass=ABCMeta): + doc: None | Sequence[str] | str class RecordField(Documented): @@ -1179,26 +1198,6 @@ class RecordField(Documented): name: str - def __init__( - self, - name: Any, - type_: Any, - doc: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.type_ = type_ - def __eq__(self, other: Any) -> bool: if isinstance(other, RecordField): return bool( @@ -1217,8 +1216,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "RecordField": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -1376,7 +1375,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -1401,8 +1400,8 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), doc=doc, - name=name, type_=type_, extension_fields=extension_fields, loadingOptions=loadingOptions, @@ -1441,16 +1440,13 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["doc", "name", "type"]) - - -class RecordSchema(Saveable): def __init__( self, - type_: Any, - fields: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + name: str, + type_: ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | Sequence[ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | UnionSchema | str] | UnionSchema | str, + doc: None | Sequence[str] | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -1460,9 +1456,14 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields = fields - self.type_ = type_ + self.doc: None | Sequence[str] | str = doc + self.name: str = name + self.type_: ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | Sequence[ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | UnionSchema | str] | UnionSchema | str = type_ + + attrs: ClassVar[Collection[str]] = frozenset(["doc", "name", "type"]) + +class RecordSchema(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, RecordSchema): return bool(self.fields == other.fields and self.type_ == other.type_) @@ -1477,8 +1478,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "RecordSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -1580,7 +1581,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -1640,24 +1641,12 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["fields", "type"]) - - -class EnumSchema(Saveable): - """ - Define an enumerated type. - - """ - - name: str - def __init__( self, - symbols: Any, - type_: Any, - name: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + type_: Literal["record"], + fields: None | Sequence[RecordField] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -1667,9 +1656,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.symbols = symbols - self.type_ = type_ + self.fields: None | Sequence[RecordField] = fields + self.type_: Literal["record"] = type_ + + attrs: ClassVar[Collection[str]] = frozenset(["fields", "type"]) + + +class EnumSchema(Saveable): + """ + Define an enumerated type. + + """ + + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, EnumSchema): @@ -1689,8 +1688,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "EnumSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -1849,7 +1848,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -1874,7 +1873,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=name, + name=cast(str, name), symbols=symbols, type_=type_, extension_fields=extension_fields, @@ -1913,16 +1912,13 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["name", "symbols", "type"]) - - -class ArraySchema(Saveable): def __init__( self, - items: Any, - type_: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + symbols: Sequence[str], + type_: Literal["enum"], + name: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -1932,9 +1928,14 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items - self.type_ = type_ + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols: Sequence[str] = symbols + self.type_: Literal["enum"] = type_ + attrs: ClassVar[Collection[str]] = frozenset(["name", "symbols", "type"]) + + +class ArraySchema(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, ArraySchema): return bool(self.items == other.items and self.type_ == other.type_) @@ -1949,8 +1950,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "ArraySchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -2053,7 +2054,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -2112,16 +2113,12 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["items", "type"]) - - -class MapSchema(Saveable): def __init__( self, - type_: Any, - values: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + items: ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | Sequence[ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | UnionSchema | str] | UnionSchema | str, + type_: Literal["array"], + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -2131,9 +2128,13 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.type_ = type_ - self.values = values + self.items: ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | Sequence[ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | UnionSchema | str] | UnionSchema | str = items + self.type_: Literal["array"] = type_ + + attrs: ClassVar[Collection[str]] = frozenset(["items", "type"]) + +class MapSchema(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, MapSchema): return bool(self.type_ == other.type_ and self.values == other.values) @@ -2148,8 +2149,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "MapSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -2252,7 +2253,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -2311,16 +2312,12 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["type", "values"]) - - -class UnionSchema(Saveable): def __init__( self, - names: Any, - type_: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + type_: Literal["map"], + values: ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | Sequence[ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | UnionSchema | str] | UnionSchema | str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -2330,9 +2327,13 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.names = names - self.type_ = type_ + self.type_: Literal["map"] = type_ + self.values: ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | Sequence[ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | UnionSchema | str] | UnionSchema | str = values + attrs: ClassVar[Collection[str]] = frozenset(["type", "values"]) + + +class UnionSchema(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, UnionSchema): return bool(self.names == other.names and self.type_ == other.type_) @@ -2347,8 +2348,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "UnionSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -2451,7 +2452,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -2510,16 +2511,12 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["names", "type"]) - - -class CWLArraySchema(ArraySchema): def __init__( self, - items: Any, - type_: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + names: ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | Sequence[ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | UnionSchema | str] | UnionSchema | str, + type_: Literal["union"], + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -2529,9 +2526,13 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items - self.type_ = type_ + self.names: ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | Sequence[ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | UnionSchema | str] | UnionSchema | str = names + self.type_: Literal["union"] = type_ + + attrs: ClassVar[Collection[str]] = frozenset(["names", "type"]) + +class CWLArraySchema(ArraySchema): def __eq__(self, other: Any) -> bool: if isinstance(other, CWLArraySchema): return bool(self.items == other.items and self.type_ == other.type_) @@ -2546,8 +2547,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CWLArraySchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -2650,7 +2651,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -2709,19 +2710,12 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["items", "type"]) - - -class CWLRecordField(RecordField): - name: str - def __init__( self, - name: Any, - type_: Any, - doc: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + items: CWLArraySchema | CWLRecordSchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | Sequence[CWLArraySchema | CWLRecordSchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | str] | str, + type_: Literal["array"], + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -2731,9 +2725,14 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.type_ = type_ + self.items: CWLArraySchema | CWLRecordSchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | Sequence[CWLArraySchema | CWLRecordSchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | str] | str = items + self.type_: Literal["array"] = type_ + + attrs: ClassVar[Collection[str]] = frozenset(["items", "type"]) + + +class CWLRecordField(RecordField): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, CWLRecordField): @@ -2753,8 +2752,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CWLRecordField": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -2912,7 +2911,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -2937,8 +2936,8 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), doc=doc, - name=name, type_=type_, extension_fields=extension_fields, loadingOptions=loadingOptions, @@ -2977,16 +2976,13 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["doc", "name", "type"]) - - -class CWLRecordSchema(RecordSchema): def __init__( self, - type_: Any, - fields: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + name: str, + type_: CWLArraySchema | CWLRecordSchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | Sequence[CWLArraySchema | CWLRecordSchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | str] | str, + doc: None | Sequence[str] | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -2996,9 +2992,14 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields = fields - self.type_ = type_ + self.doc: None | Sequence[str] | str = doc + self.name: str = name + self.type_: CWLArraySchema | CWLRecordSchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | Sequence[CWLArraySchema | CWLRecordSchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | str] | str = type_ + + attrs: ClassVar[Collection[str]] = frozenset(["doc", "name", "type"]) + +class CWLRecordSchema(RecordSchema): def __eq__(self, other: Any) -> bool: if isinstance(other, CWLRecordSchema): return bool(self.fields == other.fields and self.type_ == other.type_) @@ -3013,8 +3014,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CWLRecordSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -3116,7 +3117,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -3176,7 +3177,25 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["fields", "type"]) + def __init__( + self, + type_: Literal["record"], + fields: None | Sequence[CWLRecordField] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.fields: None | Sequence[CWLRecordField] = fields + self.type_: Literal["record"] = type_ + + attrs: ClassVar[Collection[str]] = frozenset(["fields", "type"]) class File(Saveable): @@ -3250,43 +3269,6 @@ class File(Saveable): """ - def __init__( - self, - location: Optional[Any] = None, - path: Optional[Any] = None, - basename: Optional[Any] = None, - dirname: Optional[Any] = None, - nameroot: Optional[Any] = None, - nameext: Optional[Any] = None, - checksum: Optional[Any] = None, - size: Optional[Any] = None, - secondaryFiles: Optional[Any] = None, - format: Optional[Any] = None, - contents: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "File" - self.location = location - self.path = path - self.basename = basename - self.dirname = dirname - self.nameroot = nameroot - self.nameext = nameext - self.checksum = checksum - self.size = size - self.secondaryFiles = secondaryFiles - self.format = format - self.contents = contents - def __eq__(self, other: Any) -> bool: if isinstance(other, File): return bool( @@ -3329,8 +3311,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "File": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -3687,7 +3669,7 @@ def fromDoc( try: size = load_field( _doc.get("size"), - union_of_None_type_or_inttype, + union_of_None_type_or_inttype_or_inttype, baseuri, loadingOptions, lc=_doc.get("size") @@ -3870,7 +3852,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -3983,7 +3965,44 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + location: None | str = None, + path: None | str = None, + basename: None | str = None, + dirname: None | str = None, + nameroot: None | str = None, + nameext: None | str = None, + checksum: None | str = None, + size: None | i32 = None, + secondaryFiles: None | Sequence[Directory | File] = None, + format: None | str = None, + contents: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "File" + self.location: None | str = location + self.path: None | str = path + self.basename: None | str = basename + self.dirname: None | str = dirname + self.nameroot: None | str = nameroot + self.nameext: None | str = nameext + self.checksum: None | str = checksum + self.size: None | i32 = size + self.secondaryFiles: None | Sequence[Directory | File] = secondaryFiles + self.format: None | str = format + self.contents: None | str = contents + + attrs: ClassVar[Collection[str]] = frozenset( [ "class", "location", @@ -4049,29 +4068,6 @@ class Directory(Saveable): """ - def __init__( - self, - location: Optional[Any] = None, - path: Optional[Any] = None, - basename: Optional[Any] = None, - listing: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "Directory" - self.location = location - self.path = path - self.basename = basename - self.listing = listing - def __eq__(self, other: Any) -> bool: if isinstance(other, Directory): return bool( @@ -4094,8 +4090,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "Directory": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -4306,7 +4302,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -4382,63 +4378,87 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "location", "path", "basename", "listing"]) + def __init__( + self, + location: None | str = None, + path: None | str = None, + basename: None | str = None, + listing: None | Sequence[Directory | File] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "Directory" + self.location: None | str = location + self.path: None | str = path + self.basename: None | str = basename + self.listing: None | Sequence[Directory | File] = listing + + attrs: ClassVar[Collection[str]] = frozenset( + ["class", "location", "path", "basename", "listing"] + ) -class Labeled(Saveable): - pass +@trait +class Labeled(Saveable, metaclass=ABCMeta): + label: None | str -class Identified(Saveable): - pass +@trait +class Identified(Saveable, metaclass=ABCMeta): + id: None | str -class IdentifierRequired(Identified): - pass +@trait +class IdentifierRequired(Identified, metaclass=ABCMeta): + id: str -class LoadContents(Saveable): - pass +@trait +class LoadContents(Saveable, metaclass=ABCMeta): + loadContents: None | bool + loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None -class FieldBase(Labeled): - pass +@trait +class FieldBase(Labeled, metaclass=ABCMeta): + label: None | str + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] + streamable: None | bool -class InputFormat(Saveable): - pass +@trait +class InputFormat(Saveable, metaclass=ABCMeta): + format: None | Sequence[str] | str -class OutputFormat(Saveable): - pass +@trait +class OutputFormat(Saveable, metaclass=ABCMeta): + format: None | str -class Parameter(FieldBase, Documented, IdentifierRequired): +@trait +class Parameter(FieldBase, Documented, IdentifierRequired, metaclass=ABCMeta): """ Define an input or output parameter to a process. """ - pass + label: None | str + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] + streamable: None | bool + doc: None | Sequence[str] | str + id: str class InputBinding(Saveable): - def __init__( - self, - loadContents: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.loadContents = loadContents - def __eq__(self, other: Any) -> bool: if isinstance(other, InputBinding): return bool(self.loadContents == other.loadContents) @@ -4453,8 +4473,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "InputBinding": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -4508,7 +4528,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -4566,37 +4586,11 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["loadContents"]) - - -class IOSchema(Labeled, Documented): - pass - - -class InputSchema(IOSchema): - pass - - -class OutputSchema(IOSchema): - pass - - -class InputRecordField(CWLRecordField, FieldBase, InputFormat, LoadContents): - name: str - def __init__( self, - name: Any, - type_: Any, - doc: Optional[Any] = None, - label: Optional[Any] = None, - secondaryFiles: Optional[Any] = None, - streamable: Optional[Any] = None, - format: Optional[Any] = None, - loadContents: Optional[Any] = None, - loadListing: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + loadContents: None | bool = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -4606,15 +4600,34 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.type_ = type_ - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.format = format - self.loadContents = loadContents - self.loadListing = loadListing + self.loadContents: None | bool = loadContents + + attrs: ClassVar[Collection[str]] = frozenset(["loadContents"]) + + +@trait +class IOSchema(Labeled, Documented, metaclass=ABCMeta): + label: None | str + doc: None | Sequence[str] | str + name: None | str + + +@trait +class InputSchema(IOSchema, metaclass=ABCMeta): + label: None | str + doc: None | Sequence[str] | str + name: None | str + + +@trait +class OutputSchema(IOSchema, metaclass=ABCMeta): + label: None | str + doc: None | Sequence[str] | str + name: None | str + + +class InputRecordField(CWLRecordField, FieldBase, InputFormat, LoadContents): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, InputRecordField): @@ -4652,8 +4665,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "InputRecordField": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -5093,7 +5106,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -5118,8 +5131,8 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), doc=doc, - name=name, type_=type_, label=label, secondaryFiles=secondaryFiles, @@ -5199,7 +5212,39 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + name: str, + type_: InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str, + doc: None | Sequence[str] | str = None, + label: None | str = None, + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = None, + streamable: None | bool = None, + format: None | Sequence[str] | str = None, + loadContents: None | bool = None, + loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.doc: None | Sequence[str] | str = doc + self.name: str = name + self.type_: InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str = type_ + self.label: None | str = label + self.secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = secondaryFiles + self.streamable: None | bool = streamable + self.format: None | Sequence[str] | str = format + self.loadContents: None | bool = loadContents + self.loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = loadListing + + attrs: ClassVar[Collection[str]] = frozenset( [ "doc", "name", @@ -5217,30 +5262,6 @@ def save( class InputRecordSchema(CWLRecordSchema, InputSchema): name: str - def __init__( - self, - type_: Any, - fields: Optional[Any] = None, - label: Optional[Any] = None, - doc: Optional[Any] = None, - name: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.fields = fields - self.type_ = type_ - self.label = label - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - def __eq__(self, other: Any) -> bool: if isinstance(other, InputRecordSchema): return bool( @@ -5261,8 +5282,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "InputRecordSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -5514,7 +5535,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -5539,11 +5560,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), fields=fields, type_=type_, label=label, doc=doc, - name=name, extension_fields=extension_fields, loadingOptions=loadingOptions, ) @@ -5589,21 +5610,15 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["fields", "type", "label", "doc", "name"]) - - -class InputEnumSchema(EnumSchema, InputSchema): - name: str - def __init__( self, - symbols: Any, - type_: Any, - name: Optional[Any] = None, - label: Optional[Any] = None, - doc: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + type_: Literal["record"], + fields: None | Sequence[InputRecordField] = None, + label: None | str = None, + doc: None | Sequence[str] | str = None, + name: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -5613,11 +5628,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.symbols = symbols - self.type_ = type_ - self.label = label - self.doc = doc + self.fields: None | Sequence[InputRecordField] = fields + self.type_: Literal["record"] = type_ + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + + attrs: ClassVar[Collection[str]] = frozenset( + ["fields", "type", "label", "doc", "name"] + ) + + +class InputEnumSchema(EnumSchema, InputSchema): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, InputEnumSchema): @@ -5639,8 +5662,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "InputEnumSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -5893,7 +5916,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -5918,7 +5941,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=name, + name=cast(str, name), symbols=symbols, type_=type_, label=label, @@ -5967,21 +5990,15 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["name", "symbols", "type", "label", "doc"]) - - -class InputArraySchema(CWLArraySchema, InputSchema): - name: str - def __init__( self, - items: Any, - type_: Any, - label: Optional[Any] = None, - doc: Optional[Any] = None, - name: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + symbols: Sequence[str], + type_: Literal["enum"], + name: None | str = None, + label: None | str = None, + doc: None | Sequence[str] | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -5991,11 +6008,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items - self.type_ = type_ - self.label = label - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols: Sequence[str] = symbols + self.type_: Literal["enum"] = type_ + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + + attrs: ClassVar[Collection[str]] = frozenset( + ["name", "symbols", "type", "label", "doc"] + ) + + +class InputArraySchema(CWLArraySchema, InputSchema): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, InputArraySchema): @@ -6017,8 +6042,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "InputArraySchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -6271,7 +6296,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -6296,11 +6321,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), items=items, type_=type_, label=label, doc=doc, - name=name, extension_fields=extension_fields, loadingOptions=loadingOptions, ) @@ -6345,23 +6370,15 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["items", "type", "label", "doc", "name"]) - - -class OutputRecordField(CWLRecordField, FieldBase, OutputFormat): - name: str - def __init__( self, - name: Any, - type_: Any, - doc: Optional[Any] = None, - label: Optional[Any] = None, - secondaryFiles: Optional[Any] = None, - streamable: Optional[Any] = None, - format: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + items: InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str, + type_: Literal["array"], + label: None | str = None, + doc: None | Sequence[str] | str = None, + name: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -6371,13 +6388,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.type_ = type_ - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.format = format + self.items: InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str = items + self.type_: Literal["array"] = type_ + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + + attrs: ClassVar[Collection[str]] = frozenset( + ["items", "type", "label", "doc", "name"] + ) + + +class OutputRecordField(CWLRecordField, FieldBase, OutputFormat): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, OutputRecordField): @@ -6411,8 +6434,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "OutputRecordField": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -6758,7 +6781,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -6783,8 +6806,8 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), doc=doc, - name=name, type_=type_, label=label, secondaryFiles=secondaryFiles, @@ -6848,23 +6871,17 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( - ["doc", "name", "type", "label", "secondaryFiles", "streamable", "format"] - ) - - -class OutputRecordSchema(CWLRecordSchema, OutputSchema): - name: str - def __init__( self, - type_: Any, - fields: Optional[Any] = None, - label: Optional[Any] = None, - doc: Optional[Any] = None, - name: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + name: str, + type_: Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str, + doc: None | Sequence[str] | str = None, + label: None | str = None, + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = None, + streamable: None | bool = None, + format: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -6874,11 +6891,21 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields = fields - self.type_ = type_ - self.label = label - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.doc: None | Sequence[str] | str = doc + self.name: str = name + self.type_: Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str = type_ + self.label: None | str = label + self.secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = secondaryFiles + self.streamable: None | bool = streamable + self.format: None | str = format + + attrs: ClassVar[Collection[str]] = frozenset( + ["doc", "name", "type", "label", "secondaryFiles", "streamable", "format"] + ) + + +class OutputRecordSchema(CWLRecordSchema, OutputSchema): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, OutputRecordSchema): @@ -6900,8 +6927,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "OutputRecordSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -7153,7 +7180,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -7178,11 +7205,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), fields=fields, type_=type_, label=label, doc=doc, - name=name, extension_fields=extension_fields, loadingOptions=loadingOptions, ) @@ -7228,21 +7255,15 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["fields", "type", "label", "doc", "name"]) - - -class OutputEnumSchema(EnumSchema, OutputSchema): - name: str - def __init__( self, - symbols: Any, - type_: Any, - name: Optional[Any] = None, - label: Optional[Any] = None, - doc: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + type_: Literal["record"], + fields: None | Sequence[OutputRecordField] = None, + label: None | str = None, + doc: None | Sequence[str] | str = None, + name: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -7252,11 +7273,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.symbols = symbols - self.type_ = type_ - self.label = label - self.doc = doc + self.fields: None | Sequence[OutputRecordField] = fields + self.type_: Literal["record"] = type_ + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + + attrs: ClassVar[Collection[str]] = frozenset( + ["fields", "type", "label", "doc", "name"] + ) + + +class OutputEnumSchema(EnumSchema, OutputSchema): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, OutputEnumSchema): @@ -7278,8 +7307,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "OutputEnumSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -7532,7 +7561,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -7557,7 +7586,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=name, + name=cast(str, name), symbols=symbols, type_=type_, label=label, @@ -7606,21 +7635,15 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["name", "symbols", "type", "label", "doc"]) - - -class OutputArraySchema(CWLArraySchema, OutputSchema): - name: str - def __init__( self, - items: Any, - type_: Any, - label: Optional[Any] = None, - doc: Optional[Any] = None, - name: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + symbols: Sequence[str], + type_: Literal["enum"], + name: None | str = None, + label: None | str = None, + doc: None | Sequence[str] | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -7630,11 +7653,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items - self.type_ = type_ - self.label = label - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols: Sequence[str] = symbols + self.type_: Literal["enum"] = type_ + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + + attrs: ClassVar[Collection[str]] = frozenset( + ["name", "symbols", "type", "label", "doc"] + ) + + +class OutputArraySchema(CWLArraySchema, OutputSchema): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, OutputArraySchema): @@ -7656,8 +7687,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "OutputArraySchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -7910,7 +7941,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -7935,11 +7966,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), items=items, type_=type_, label=label, doc=doc, - name=name, extension_fields=extension_fields, loadingOptions=loadingOptions, ) @@ -7984,18 +8015,60 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["items", "type", "label", "doc", "name"]) - - -class InputParameter(Parameter, InputFormat, LoadContents): - pass + def __init__( + self, + items: Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str, + type_: Literal["array"], + label: None | str = None, + doc: None | Sequence[str] | str = None, + name: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.items: Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str = items + self.type_: Literal["array"] = type_ + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + + attrs: ClassVar[Collection[str]] = frozenset( + ["items", "type", "label", "doc", "name"] + ) -class OutputParameter(Parameter, OutputFormat): - pass +@trait +class InputParameter(Parameter, InputFormat, LoadContents, metaclass=ABCMeta): + label: None | str + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] + streamable: None | bool + doc: None | Sequence[str] | str + id: str + format: None | Sequence[str] | str + loadContents: None | bool + loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None + default: CWLObjectType | None + + +@trait +class OutputParameter(Parameter, OutputFormat, metaclass=ABCMeta): + label: None | str + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] + streamable: None | bool + doc: None | Sequence[str] | str + id: str + format: None | str -class ProcessRequirement(Saveable): +@trait +class ProcessRequirement(Saveable, metaclass=ABCMeta): """ A process requirement declares a prerequisite that may or must be fulfilled before executing a process. See [`Process.hints`](#process) and @@ -8009,7 +8082,8 @@ class ProcessRequirement(Saveable): pass -class Process(Identified, Labeled, Documented): +@trait +class Process(Identified, Labeled, Documented, metaclass=ABCMeta): """ The base executable type in CWL is the `Process` object defined by the @@ -8018,7 +8092,14 @@ class Process(Identified, Labeled, Documented): """ - pass + id: None | str + label: None | str + doc: None | Sequence[str] | str + inputs: Sequence[CommandInputParameter | WorkflowInputParameter] + outputs: Sequence[CommandOutputParameter | ExpressionToolOutputParameter | WorkflowOutputParameter] + requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] + hints: None | Sequence[Any | CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] + cwlVersion: Literal["v1.1"] | None class InlineJavascriptRequirement(ProcessRequirement): @@ -8029,23 +8110,6 @@ class InlineJavascriptRequirement(ProcessRequirement): """ - def __init__( - self, - expressionLib: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "InlineJavascriptRequirement" - self.expressionLib = expressionLib - def __eq__(self, other: Any) -> bool: if isinstance(other, InlineJavascriptRequirement): return bool( @@ -8063,8 +8127,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "InlineJavascriptRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -8134,7 +8198,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -8200,10 +8264,28 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "expressionLib"]) + def __init__( + self, + expressionLib: None | Sequence[str] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "InlineJavascriptRequirement" + self.expressionLib: None | Sequence[str] = expressionLib + + attrs: ClassVar[Collection[str]] = frozenset(["class", "expressionLib"]) -class CommandInputSchema(Saveable): +@trait +class CommandInputSchema(Saveable, metaclass=ABCMeta): pass @@ -8219,23 +8301,6 @@ class SchemaDefRequirement(ProcessRequirement): """ - def __init__( - self, - types: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "SchemaDefRequirement" - self.types = types - def __eq__(self, other: Any) -> bool: if isinstance(other, SchemaDefRequirement): return bool(self.class_ == other.class_ and self.types == other.types) @@ -8250,8 +8315,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "SchemaDefRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -8322,7 +8387,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -8385,16 +8450,11 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "types"]) - - -class SecondaryFileSchema(Saveable): def __init__( self, - pattern: Any, - required: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + types: Sequence[CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema], + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -8404,9 +8464,13 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.pattern = pattern - self.required = required + self.class_: Final[str] = "SchemaDefRequirement" + self.types: Sequence[CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema] = types + + attrs: ClassVar[Collection[str]] = frozenset(["class", "types"]) + +class SecondaryFileSchema(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, SecondaryFileSchema): return bool( @@ -8423,8 +8487,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "SecondaryFileSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -8526,7 +8590,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -8586,21 +8650,12 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["pattern", "required"]) - - -class LoadListingRequirement(ProcessRequirement): - """ - Specify the desired behavior for loading the `listing` field of - a Directory object for use by expressions. - - """ - def __init__( self, - loadListing: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + pattern: str, + required: None | bool | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -8610,8 +8665,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "LoadListingRequirement" - self.loadListing = loadListing + self.pattern: str = pattern + self.required: None | bool | str = required + + attrs: ClassVar[Collection[str]] = frozenset(["pattern", "required"]) + + +class LoadListingRequirement(ProcessRequirement): + """ + Specify the desired behavior for loading the `listing` field of + a Directory object for use by expressions. + + """ def __eq__(self, other: Any) -> bool: if isinstance(other, LoadListingRequirement): @@ -8629,8 +8694,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "LoadListingRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -8700,7 +8765,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -8766,23 +8831,11 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "loadListing"]) - - -class EnvironmentDef(Saveable): - """ - Define an environment variable that will be set in the runtime environment - by the workflow platform when executing the command line tool. May be the - result of executing an expression, such as getting a parameter from input. - - """ - def __init__( self, - envName: Any, - envValue: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -8792,8 +8845,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.envName = envName - self.envValue = envValue + self.class_: Final[str] = "LoadListingRequirement" + self.loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = loadListing + + attrs: ClassVar[Collection[str]] = frozenset(["class", "loadListing"]) + + +class EnvironmentDef(Saveable): + """ + Define an environment variable that will be set in the runtime environment + by the workflow platform when executing the command line tool. May be the + result of executing an expression, such as getting a parameter from input. + + """ def __eq__(self, other: Any) -> bool: if isinstance(other, EnvironmentDef): @@ -8811,8 +8875,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "EnvironmentDef": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -8915,7 +8979,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -8975,7 +9039,25 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["envName", "envValue"]) + def __init__( + self, + envName: str, + envValue: str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.envName: str = envName + self.envValue: str = envValue + + attrs: ClassVar[Collection[str]] = frozenset(["envName", "envValue"]) class CommandLineBinding(InputBinding): @@ -9018,34 +9100,6 @@ class CommandLineBinding(InputBinding): """ - def __init__( - self, - loadContents: Optional[Any] = None, - position: Optional[Any] = None, - prefix: Optional[Any] = None, - separate: Optional[Any] = None, - itemSeparator: Optional[Any] = None, - valueFrom: Optional[Any] = None, - shellQuote: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.loadContents = loadContents - self.position = position - self.prefix = prefix - self.separate = separate - self.itemSeparator = itemSeparator - self.valueFrom = valueFrom - self.shellQuote = shellQuote - def __eq__(self, other: Any) -> bool: if isinstance(other, CommandLineBinding): return bool( @@ -9078,8 +9132,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandLineBinding": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -9415,7 +9469,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -9512,7 +9566,35 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + loadContents: None | bool = None, + position: None | i32 | str = None, + prefix: None | str = None, + separate: None | bool = None, + itemSeparator: None | str = None, + valueFrom: None | str = None, + shellQuote: None | bool = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.loadContents: None | bool = loadContents + self.position: None | i32 | str = position + self.prefix: None | str = prefix + self.separate: None | bool = separate + self.itemSeparator: None | str = itemSeparator + self.valueFrom: None | str = valueFrom + self.shellQuote: None | bool = shellQuote + + attrs: ClassVar[Collection[str]] = frozenset( [ "loadContents", "position", @@ -9540,28 +9622,6 @@ class CommandOutputBinding(LoadContents): """ - def __init__( - self, - loadContents: Optional[Any] = None, - loadListing: Optional[Any] = None, - glob: Optional[Any] = None, - outputEval: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.loadContents = loadContents - self.loadListing = loadListing - self.glob = glob - self.outputEval = outputEval - def __eq__(self, other: Any) -> bool: if isinstance(other, CommandOutputBinding): return bool( @@ -9581,8 +9641,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandOutputBinding": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -9777,7 +9837,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -9856,30 +9916,14 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["loadContents", "loadListing", "glob", "outputEval"]) - - -class CommandLineBindable(Saveable): - pass - - -class CommandInputRecordField(InputRecordField, CommandLineBindable): - name: str - def __init__( self, - name: Any, - type_: Any, - doc: Optional[Any] = None, - label: Optional[Any] = None, - secondaryFiles: Optional[Any] = None, - streamable: Optional[Any] = None, - format: Optional[Any] = None, - loadContents: Optional[Any] = None, - loadListing: Optional[Any] = None, - inputBinding: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + loadContents: None | bool = None, + loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = None, + glob: None | Sequence[str] | str = None, + outputEval: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -9889,16 +9933,23 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.type_ = type_ - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.format = format - self.loadContents = loadContents - self.loadListing = loadListing - self.inputBinding = inputBinding + self.loadContents: None | bool = loadContents + self.loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = loadListing + self.glob: None | Sequence[str] | str = glob + self.outputEval: None | str = outputEval + + attrs: ClassVar[Collection[str]] = frozenset( + ["loadContents", "loadListing", "glob", "outputEval"] + ) + + +@trait +class CommandLineBindable(Saveable, metaclass=ABCMeta): + inputBinding: CommandLineBinding | None + + +class CommandInputRecordField(InputRecordField, CommandLineBindable): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, CommandInputRecordField): @@ -9938,8 +9989,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandInputRecordField": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -10426,7 +10477,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -10451,8 +10502,8 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), doc=doc, - name=name, type_=type_, label=label, secondaryFiles=secondaryFiles, @@ -10540,7 +10591,41 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + name: str, + type_: CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str, + doc: None | Sequence[str] | str = None, + label: None | str = None, + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = None, + streamable: None | bool = None, + format: None | Sequence[str] | str = None, + loadContents: None | bool = None, + loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = None, + inputBinding: CommandLineBinding | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.doc: None | Sequence[str] | str = doc + self.name: str = name + self.type_: CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str = type_ + self.label: None | str = label + self.secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = secondaryFiles + self.streamable: None | bool = streamable + self.format: None | Sequence[str] | str = format + self.loadContents: None | bool = loadContents + self.loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = loadListing + self.inputBinding: CommandLineBinding | None = inputBinding + + attrs: ClassVar[Collection[str]] = frozenset( [ "doc", "name", @@ -10561,32 +10646,6 @@ class CommandInputRecordSchema( ): name: str - def __init__( - self, - type_: Any, - fields: Optional[Any] = None, - label: Optional[Any] = None, - doc: Optional[Any] = None, - name: Optional[Any] = None, - inputBinding: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.fields = fields - self.type_ = type_ - self.label = label - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.inputBinding = inputBinding - def __eq__(self, other: Any) -> bool: if isinstance(other, CommandInputRecordSchema): return bool( @@ -10617,8 +10676,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandInputRecordSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -10917,7 +10976,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -10942,11 +11001,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), fields=fields, type_=type_, label=label, doc=doc, - name=name, inputBinding=inputBinding, extension_fields=extension_fields, loadingOptions=loadingOptions, @@ -11000,22 +11059,16 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["fields", "type", "label", "doc", "name", "inputBinding"]) - - -class CommandInputEnumSchema(InputEnumSchema, CommandInputSchema, CommandLineBindable): - name: str - def __init__( self, - symbols: Any, - type_: Any, - name: Optional[Any] = None, - label: Optional[Any] = None, - doc: Optional[Any] = None, - inputBinding: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + type_: Literal["record"], + fields: None | Sequence[CommandInputRecordField] = None, + label: None | str = None, + doc: None | Sequence[str] | str = None, + name: None | str = None, + inputBinding: CommandLineBinding | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -11025,12 +11078,20 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.symbols = symbols - self.type_ = type_ - self.label = label - self.doc = doc - self.inputBinding = inputBinding + self.fields: None | Sequence[CommandInputRecordField] = fields + self.type_: Literal["record"] = type_ + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.inputBinding: CommandLineBinding | None = inputBinding + + attrs: ClassVar[Collection[str]] = frozenset( + ["fields", "type", "label", "doc", "name", "inputBinding"] + ) + + +class CommandInputEnumSchema(InputEnumSchema, CommandInputSchema, CommandLineBindable): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, CommandInputEnumSchema): @@ -11062,8 +11123,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandInputEnumSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -11363,7 +11424,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -11388,7 +11449,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=name, + name=cast(str, name), symbols=symbols, type_=type_, label=label, @@ -11445,24 +11506,16 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["name", "symbols", "type", "label", "doc", "inputBinding"]) - - -class CommandInputArraySchema( - InputArraySchema, CommandInputSchema, CommandLineBindable -): - name: str - def __init__( self, - items: Any, - type_: Any, - label: Optional[Any] = None, - doc: Optional[Any] = None, - name: Optional[Any] = None, - inputBinding: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + symbols: Sequence[str], + type_: Literal["enum"], + name: None | str = None, + label: None | str = None, + doc: None | Sequence[str] | str = None, + inputBinding: CommandLineBinding | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -11472,12 +11525,22 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items - self.type_ = type_ - self.label = label - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.inputBinding = inputBinding + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols: Sequence[str] = symbols + self.type_: Literal["enum"] = type_ + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + self.inputBinding: CommandLineBinding | None = inputBinding + + attrs: ClassVar[Collection[str]] = frozenset( + ["name", "symbols", "type", "label", "doc", "inputBinding"] + ) + + +class CommandInputArraySchema( + InputArraySchema, CommandInputSchema, CommandLineBindable +): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, CommandInputArraySchema): @@ -11502,8 +11565,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandInputArraySchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -11803,7 +11866,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -11828,11 +11891,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), items=items, type_=type_, label=label, doc=doc, - name=name, inputBinding=inputBinding, extension_fields=extension_fields, loadingOptions=loadingOptions, @@ -11885,24 +11948,16 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["items", "type", "label", "doc", "name", "inputBinding"]) - - -class CommandOutputRecordField(OutputRecordField): - name: str - def __init__( self, - name: Any, - type_: Any, - doc: Optional[Any] = None, - label: Optional[Any] = None, - secondaryFiles: Optional[Any] = None, - streamable: Optional[Any] = None, - format: Optional[Any] = None, - outputBinding: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + items: CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str, + type_: Literal["array"], + label: None | str = None, + doc: None | Sequence[str] | str = None, + name: None | str = None, + inputBinding: CommandLineBinding | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -11912,14 +11967,20 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.type_ = type_ - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.format = format - self.outputBinding = outputBinding + self.items: CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str = items + self.type_: Literal["array"] = type_ + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.inputBinding: CommandLineBinding | None = inputBinding + + attrs: ClassVar[Collection[str]] = frozenset( + ["items", "type", "label", "doc", "name", "inputBinding"] + ) + + +class CommandOutputRecordField(OutputRecordField): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, CommandOutputRecordField): @@ -11955,8 +12016,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandOutputRecordField": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -12349,7 +12410,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -12374,8 +12435,8 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), doc=doc, - name=name, type_=type_, label=label, secondaryFiles=secondaryFiles, @@ -12447,7 +12508,37 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + name: str, + type_: CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str, + doc: None | Sequence[str] | str = None, + label: None | str = None, + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = None, + streamable: None | bool = None, + format: None | str = None, + outputBinding: CommandOutputBinding | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.doc: None | Sequence[str] | str = doc + self.name: str = name + self.type_: CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str = type_ + self.label: None | str = label + self.secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = secondaryFiles + self.streamable: None | bool = streamable + self.format: None | str = format + self.outputBinding: CommandOutputBinding | None = outputBinding + + attrs: ClassVar[Collection[str]] = frozenset( [ "doc", "name", @@ -12464,30 +12555,6 @@ def save( class CommandOutputRecordSchema(OutputRecordSchema): name: str - def __init__( - self, - type_: Any, - fields: Optional[Any] = None, - label: Optional[Any] = None, - doc: Optional[Any] = None, - name: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.fields = fields - self.type_ = type_ - self.label = label - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - def __eq__(self, other: Any) -> bool: if isinstance(other, CommandOutputRecordSchema): return bool( @@ -12508,8 +12575,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandOutputRecordSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -12761,7 +12828,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -12786,11 +12853,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), fields=fields, type_=type_, label=label, doc=doc, - name=name, extension_fields=extension_fields, loadingOptions=loadingOptions, ) @@ -12836,21 +12903,15 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["fields", "type", "label", "doc", "name"]) - - -class CommandOutputEnumSchema(OutputEnumSchema): - name: str - def __init__( self, - symbols: Any, - type_: Any, - name: Optional[Any] = None, - label: Optional[Any] = None, - doc: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + type_: Literal["record"], + fields: None | Sequence[CommandOutputRecordField] = None, + label: None | str = None, + doc: None | Sequence[str] | str = None, + name: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -12860,11 +12921,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.symbols = symbols - self.type_ = type_ - self.label = label - self.doc = doc + self.fields: None | Sequence[CommandOutputRecordField] = fields + self.type_: Literal["record"] = type_ + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + + attrs: ClassVar[Collection[str]] = frozenset( + ["fields", "type", "label", "doc", "name"] + ) + + +class CommandOutputEnumSchema(OutputEnumSchema): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, CommandOutputEnumSchema): @@ -12886,8 +12955,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandOutputEnumSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -13140,7 +13209,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -13165,7 +13234,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=name, + name=cast(str, name), symbols=symbols, type_=type_, label=label, @@ -13214,21 +13283,15 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["name", "symbols", "type", "label", "doc"]) - - -class CommandOutputArraySchema(OutputArraySchema): - name: str - def __init__( self, - items: Any, - type_: Any, - label: Optional[Any] = None, - doc: Optional[Any] = None, - name: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + symbols: Sequence[str], + type_: Literal["enum"], + name: None | str = None, + label: None | str = None, + doc: None | Sequence[str] | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -13238,11 +13301,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items - self.type_ = type_ - self.label = label - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols: Sequence[str] = symbols + self.type_: Literal["enum"] = type_ + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + + attrs: ClassVar[Collection[str]] = frozenset( + ["name", "symbols", "type", "label", "doc"] + ) + + +class CommandOutputArraySchema(OutputArraySchema): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, CommandOutputArraySchema): @@ -13264,8 +13335,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandOutputArraySchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -13518,7 +13589,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -13543,11 +13614,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), items=items, type_=type_, label=label, doc=doc, - name=name, extension_fields=extension_fields, loadingOptions=loadingOptions, ) @@ -13592,31 +13663,15 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["items", "type", "label", "doc", "name"]) - - -class CommandInputParameter(InputParameter): - """ - An input parameter for a CommandLineTool. - """ - - id: str - def __init__( self, - id: Any, - type_: Any, - label: Optional[Any] = None, - secondaryFiles: Optional[Any] = None, - streamable: Optional[Any] = None, - doc: Optional[Any] = None, - format: Optional[Any] = None, - loadContents: Optional[Any] = None, - loadListing: Optional[Any] = None, - default: Optional[Any] = None, - inputBinding: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + items: CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str, + type_: Literal["array"], + label: None | str = None, + doc: None | Sequence[str] | str = None, + name: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -13626,17 +13681,23 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.format = format - self.loadContents = loadContents - self.loadListing = loadListing - self.default = default - self.type_ = type_ - self.inputBinding = inputBinding + self.items: CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str = items + self.type_: Literal["array"] = type_ + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + + attrs: ClassVar[Collection[str]] = frozenset( + ["items", "type", "label", "doc", "name"] + ) + + +class CommandInputParameter(InputParameter): + """ + An input parameter for a CommandLineTool. + """ + + id: str def __eq__(self, other: Any) -> bool: if isinstance(other, CommandInputParameter): @@ -13678,8 +13739,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandInputParameter": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -14213,7 +14274,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -14238,11 +14299,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + id=cast(str, id), label=label, secondaryFiles=secondaryFiles, streamable=streamable, doc=doc, - id=id, format=format, loadContents=loadContents, loadListing=loadListing, @@ -14332,7 +14393,43 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + id: str, + type_: CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Literal["stdin"] | Sequence[CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str, + label: None | str = None, + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = None, + streamable: None | bool = None, + doc: None | Sequence[str] | str = None, + format: None | Sequence[str] | str = None, + loadContents: None | bool = None, + loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = None, + default: CWLObjectType | None = None, + inputBinding: CommandLineBinding | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.label: None | str = label + self.secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = secondaryFiles + self.streamable: None | bool = streamable + self.doc: None | Sequence[str] | str = doc + self.id: str = id + self.format: None | Sequence[str] | str = format + self.loadContents: None | bool = loadContents + self.loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = loadListing + self.default: CWLObjectType | None = default + self.type_: CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Literal["stdin"] | Sequence[CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str = type_ + self.inputBinding: CommandLineBinding | None = inputBinding + + attrs: ClassVar[Collection[str]] = frozenset( [ "label", "secondaryFiles", @@ -14356,36 +14453,6 @@ class CommandOutputParameter(OutputParameter): id: str - def __init__( - self, - id: Any, - type_: Any, - label: Optional[Any] = None, - secondaryFiles: Optional[Any] = None, - streamable: Optional[Any] = None, - doc: Optional[Any] = None, - format: Optional[Any] = None, - outputBinding: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.format = format - self.type_ = type_ - self.outputBinding = outputBinding - def __eq__(self, other: Any) -> bool: if isinstance(other, CommandOutputParameter): return bool( @@ -14420,8 +14487,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandOutputParameter": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -14814,7 +14881,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -14839,11 +14906,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + id=cast(str, id), label=label, secondaryFiles=secondaryFiles, streamable=streamable, doc=doc, - id=id, format=format, type_=type_, outputBinding=outputBinding, @@ -14912,7 +14979,37 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + id: str, + type_: CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Literal["stderr"] | Literal["stdout"] | Sequence[CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str, + label: None | str = None, + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = None, + streamable: None | bool = None, + doc: None | Sequence[str] | str = None, + format: None | str = None, + outputBinding: CommandOutputBinding | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.label: None | str = label + self.secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = secondaryFiles + self.streamable: None | bool = streamable + self.doc: None | Sequence[str] | str = doc + self.id: str = id + self.format: None | str = format + self.type_: CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Literal["stderr"] | Literal["stdout"] | Sequence[CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str = type_ + self.outputBinding: CommandOutputBinding | None = outputBinding + + attrs: ClassVar[Collection[str]] = frozenset( [ "label", "secondaryFiles", @@ -14934,53 +15031,6 @@ class CommandLineTool(Process): id: str - def __init__( - self, - inputs: Any, - outputs: Any, - id: Optional[Any] = None, - label: Optional[Any] = None, - doc: Optional[Any] = None, - requirements: Optional[Any] = None, - hints: Optional[Any] = None, - cwlVersion: Optional[Any] = None, - baseCommand: Optional[Any] = None, - arguments: Optional[Any] = None, - stdin: Optional[Any] = None, - stderr: Optional[Any] = None, - stdout: Optional[Any] = None, - successCodes: Optional[Any] = None, - temporaryFailCodes: Optional[Any] = None, - permanentFailCodes: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.label = label - self.doc = doc - self.inputs = inputs - self.outputs = outputs - self.requirements = requirements - self.hints = hints - self.cwlVersion = cwlVersion - self.class_ = "CommandLineTool" - self.baseCommand = baseCommand - self.arguments = arguments - self.stdin = stdin - self.stderr = stderr - self.stdout = stdout - self.successCodes = successCodes - self.temporaryFailCodes = temporaryFailCodes - self.permanentFailCodes = permanentFailCodes - def __eq__(self, other: Any) -> bool: if isinstance(other, CommandLineTool): return bool( @@ -15033,8 +15083,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandLineTool": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -15820,7 +15870,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -15845,7 +15895,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=id, + id=cast(str, id), label=label, doc=doc, inputs=inputs, @@ -15972,7 +16022,54 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + inputs: Sequence[CommandInputParameter], + outputs: Sequence[CommandOutputParameter], + id: None | str = None, + label: None | str = None, + doc: None | Sequence[str] | str = None, + requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = None, + hints: None | Sequence[Any | CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = None, + cwlVersion: Literal["v1.1"] | None = None, + baseCommand: None | Sequence[str] | str = None, + arguments: None | Sequence[CommandLineBinding | str] = None, + stdin: None | str = None, + stderr: None | str = None, + stdout: None | str = None, + successCodes: None | Sequence[i32] = None, + temporaryFailCodes: None | Sequence[i32] = None, + permanentFailCodes: None | Sequence[i32] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.id: str = id if id is not None else "_:" + str(_uuid__.uuid4()) + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + self.inputs: Sequence[CommandInputParameter] = inputs + self.outputs: Sequence[CommandOutputParameter] = outputs + self.requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = requirements + self.hints: None | Sequence[Any | CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = hints + self.cwlVersion: Literal["v1.1"] | None = cwlVersion + self.class_: Final[str] = "CommandLineTool" + self.baseCommand: None | Sequence[str] | str = baseCommand + self.arguments: None | Sequence[CommandLineBinding | str] = arguments + self.stdin: None | str = stdin + self.stderr: None | str = stderr + self.stdout: None | str = stdout + self.successCodes: None | Sequence[i32] = successCodes + self.temporaryFailCodes: None | Sequence[i32] = temporaryFailCodes + self.permanentFailCodes: None | Sequence[i32] = permanentFailCodes + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "label", @@ -16051,33 +16148,6 @@ class DockerRequirement(ProcessRequirement): """ - def __init__( - self, - dockerPull: Optional[Any] = None, - dockerLoad: Optional[Any] = None, - dockerFile: Optional[Any] = None, - dockerImport: Optional[Any] = None, - dockerImageId: Optional[Any] = None, - dockerOutputDirectory: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "DockerRequirement" - self.dockerPull = dockerPull - self.dockerLoad = dockerLoad - self.dockerFile = dockerFile - self.dockerImport = dockerImport - self.dockerImageId = dockerImageId - self.dockerOutputDirectory = dockerOutputDirectory - def __eq__(self, other: Any) -> bool: if isinstance(other, DockerRequirement): return bool( @@ -16110,8 +16180,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "DockerRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -16416,7 +16486,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -16522,7 +16592,34 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + dockerPull: None | str = None, + dockerLoad: None | str = None, + dockerFile: None | str = None, + dockerImport: None | str = None, + dockerImageId: None | str = None, + dockerOutputDirectory: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "DockerRequirement" + self.dockerPull: None | str = dockerPull + self.dockerLoad: None | str = dockerLoad + self.dockerFile: None | str = dockerFile + self.dockerImport: None | str = dockerImport + self.dockerImageId: None | str = dockerImageId + self.dockerOutputDirectory: None | str = dockerOutputDirectory + + attrs: ClassVar[Collection[str]] = frozenset( [ "class", "dockerPull", @@ -16542,23 +16639,6 @@ class SoftwareRequirement(ProcessRequirement): """ - def __init__( - self, - packages: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "SoftwareRequirement" - self.packages = packages - def __eq__(self, other: Any) -> bool: if isinstance(other, SoftwareRequirement): return bool(self.class_ == other.class_ and self.packages == other.packages) @@ -16573,8 +16653,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "SoftwareRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -16645,7 +16725,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -16708,17 +16788,11 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "packages"]) - - -class SoftwarePackage(Saveable): def __init__( self, - package: Any, - version: Optional[Any] = None, - specs: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + packages: Sequence[SoftwarePackage], + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -16728,10 +16802,13 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.package = package - self.version = version - self.specs = specs + self.class_: Final[str] = "SoftwareRequirement" + self.packages: Sequence[SoftwarePackage] = packages + attrs: ClassVar[Collection[str]] = frozenset(["class", "packages"]) + + +class SoftwarePackage(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, SoftwarePackage): return bool( @@ -16750,8 +16827,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "SoftwarePackage": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -16900,7 +16977,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -16964,25 +17041,13 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["package", "version", "specs"]) - - -class Dirent(Saveable): - """ - Define a file or subdirectory that must be placed in the designated output - directory prior to executing the command line tool. May be the result of - executing an expression, such as building a configuration file from a - template. - - """ - def __init__( self, - entry: Any, - entryname: Optional[Any] = None, - writable: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + package: str, + version: None | Sequence[str] = None, + specs: None | Sequence[str] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -16992,9 +17057,21 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.entryname = entryname - self.entry = entry - self.writable = writable + self.package: str = package + self.version: None | Sequence[str] = version + self.specs: None | Sequence[str] = specs + + attrs: ClassVar[Collection[str]] = frozenset(["package", "version", "specs"]) + + +class Dirent(Saveable): + """ + Define a file or subdirectory that must be placed in the designated output + directory prior to executing the command line tool. May be the result of + executing an expression, such as building a configuration file from a + template. + + """ def __eq__(self, other: Any) -> bool: if isinstance(other, Dirent): @@ -17014,8 +17091,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "Dirent": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -17164,7 +17241,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -17232,19 +17309,13 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["entryname", "entry", "writable"]) - - -class InitialWorkDirRequirement(ProcessRequirement): - """ - Define a list of files and subdirectories that must be created by the workflow platform in the designated output directory prior to executing the command line tool. - """ - def __init__( self, - listing: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + entry: str, + entryname: None | str = None, + writable: None | bool = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -17254,8 +17325,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "InitialWorkDirRequirement" - self.listing = listing + self.entryname: None | str = entryname + self.entry: str = entry + self.writable: None | bool = writable + + attrs: ClassVar[Collection[str]] = frozenset(["entryname", "entry", "writable"]) + + +class InitialWorkDirRequirement(ProcessRequirement): + """ + Define a list of files and subdirectories that must be created by the workflow platform in the designated output directory prior to executing the command line tool. + """ def __eq__(self, other: Any) -> bool: if isinstance(other, InitialWorkDirRequirement): @@ -17271,8 +17351,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "InitialWorkDirRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -17343,7 +17423,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -17406,21 +17486,11 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "listing"]) - - -class EnvVarRequirement(ProcessRequirement): - """ - Define a list of environment variables which will be set in the - execution environment of the tool. See `EnvironmentDef` for details. - - """ - def __init__( self, - envDef: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + listing: Sequence[Directory | Dirent | File | None | Sequence[Directory | File] | str] | str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -17430,8 +17500,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "EnvVarRequirement" - self.envDef = envDef + self.class_: Final[str] = "InitialWorkDirRequirement" + self.listing: Sequence[Directory | Dirent | File | None | Sequence[Directory | File] | str] | str = listing + + attrs: ClassVar[Collection[str]] = frozenset(["class", "listing"]) + + +class EnvVarRequirement(ProcessRequirement): + """ + Define a list of environment variables which will be set in the + execution environment of the tool. See `EnvironmentDef` for details. + + """ def __eq__(self, other: Any) -> bool: if isinstance(other, EnvVarRequirement): @@ -17447,8 +17527,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "EnvVarRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -17519,7 +17599,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -17582,7 +17662,24 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "envDef"]) + def __init__( + self, + envDef: Sequence[EnvironmentDef], + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "EnvVarRequirement" + self.envDef: Sequence[EnvironmentDef] = envDef + + attrs: ClassVar[Collection[str]] = frozenset(["class", "envDef"]) class ShellCommandRequirement(ProcessRequirement): @@ -17597,21 +17694,6 @@ class ShellCommandRequirement(ProcessRequirement): """ - def __init__( - self, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "ShellCommandRequirement" - def __eq__(self, other: Any) -> bool: if isinstance(other, ShellCommandRequirement): return bool(self.class_ == other.class_) @@ -17626,8 +17708,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "ShellCommandRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -17650,7 +17732,7 @@ def fromDoc( raise ValidationException(f"tried `{cls.__name__}` but") except ValidationException as e: raise e - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -17706,7 +17788,22 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class"]) + def __init__( + self, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "ShellCommandRequirement" + + attrs: ClassVar[Collection[str]] = frozenset(["class"]) class ResourceRequirement(ProcessRequirement): @@ -17734,37 +17831,6 @@ class ResourceRequirement(ProcessRequirement): """ - def __init__( - self, - coresMin: Optional[Any] = None, - coresMax: Optional[Any] = None, - ramMin: Optional[Any] = None, - ramMax: Optional[Any] = None, - tmpdirMin: Optional[Any] = None, - tmpdirMax: Optional[Any] = None, - outdirMin: Optional[Any] = None, - outdirMax: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "ResourceRequirement" - self.coresMin = coresMin - self.coresMax = coresMax - self.ramMin = ramMin - self.ramMax = ramMax - self.tmpdirMin = tmpdirMin - self.tmpdirMax = tmpdirMax - self.outdirMin = outdirMin - self.outdirMax = outdirMax - def __eq__(self, other: Any) -> bool: if isinstance(other, ResourceRequirement): return bool( @@ -17801,8 +17867,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "ResourceRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -17830,7 +17896,7 @@ def fromDoc( try: coresMin = load_field( _doc.get("coresMin"), - union_of_None_type_or_inttype_or_ExpressionLoader, + union_of_None_type_or_inttype_or_inttype_or_ExpressionLoader, baseuri, loadingOptions, lc=_doc.get("coresMin") @@ -17877,7 +17943,7 @@ def fromDoc( try: coresMax = load_field( _doc.get("coresMax"), - union_of_None_type_or_inttype_or_ExpressionLoader, + union_of_None_type_or_inttype_or_inttype_or_ExpressionLoader, baseuri, loadingOptions, lc=_doc.get("coresMax") @@ -17924,7 +17990,7 @@ def fromDoc( try: ramMin = load_field( _doc.get("ramMin"), - union_of_None_type_or_inttype_or_ExpressionLoader, + union_of_None_type_or_inttype_or_inttype_or_ExpressionLoader, baseuri, loadingOptions, lc=_doc.get("ramMin") @@ -17971,7 +18037,7 @@ def fromDoc( try: ramMax = load_field( _doc.get("ramMax"), - union_of_None_type_or_inttype_or_ExpressionLoader, + union_of_None_type_or_inttype_or_inttype_or_ExpressionLoader, baseuri, loadingOptions, lc=_doc.get("ramMax") @@ -18018,7 +18084,7 @@ def fromDoc( try: tmpdirMin = load_field( _doc.get("tmpdirMin"), - union_of_None_type_or_inttype_or_ExpressionLoader, + union_of_None_type_or_inttype_or_inttype_or_ExpressionLoader, baseuri, loadingOptions, lc=_doc.get("tmpdirMin") @@ -18065,7 +18131,7 @@ def fromDoc( try: tmpdirMax = load_field( _doc.get("tmpdirMax"), - union_of_None_type_or_inttype_or_ExpressionLoader, + union_of_None_type_or_inttype_or_inttype_or_ExpressionLoader, baseuri, loadingOptions, lc=_doc.get("tmpdirMax") @@ -18112,7 +18178,7 @@ def fromDoc( try: outdirMin = load_field( _doc.get("outdirMin"), - union_of_None_type_or_inttype_or_ExpressionLoader, + union_of_None_type_or_inttype_or_inttype_or_ExpressionLoader, baseuri, loadingOptions, lc=_doc.get("outdirMin") @@ -18159,7 +18225,7 @@ def fromDoc( try: outdirMax = load_field( _doc.get("outdirMax"), - union_of_None_type_or_inttype_or_ExpressionLoader, + union_of_None_type_or_inttype_or_inttype_or_ExpressionLoader, baseuri, loadingOptions, lc=_doc.get("outdirMax") @@ -18201,7 +18267,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -18311,7 +18377,38 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + coresMin: None | i32 | str = None, + coresMax: None | i32 | str = None, + ramMin: None | i32 | str = None, + ramMax: None | i32 | str = None, + tmpdirMin: None | i32 | str = None, + tmpdirMax: None | i32 | str = None, + outdirMin: None | i32 | str = None, + outdirMax: None | i32 | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "ResourceRequirement" + self.coresMin: None | i32 | str = coresMin + self.coresMax: None | i32 | str = coresMax + self.ramMin: None | i32 | str = ramMin + self.ramMax: None | i32 | str = ramMax + self.tmpdirMin: None | i32 | str = tmpdirMin + self.tmpdirMax: None | i32 | str = tmpdirMax + self.outdirMin: None | i32 | str = outdirMin + self.outdirMax: None | i32 | str = outdirMax + + attrs: ClassVar[Collection[str]] = frozenset( [ "class", "coresMin", @@ -18340,23 +18437,6 @@ class WorkReuse(ProcessRequirement): """ - def __init__( - self, - enableReuse: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "WorkReuse" - self.enableReuse = enableReuse - def __eq__(self, other: Any) -> bool: if isinstance(other, WorkReuse): return bool( @@ -18373,8 +18453,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "WorkReuse": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -18445,7 +18525,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -18511,7 +18591,24 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "enableReuse"]) + def __init__( + self, + enableReuse: bool | str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "WorkReuse" + self.enableReuse: bool | str = enableReuse + + attrs: ClassVar[Collection[str]] = frozenset(["class", "enableReuse"]) class NetworkAccess(ProcessRequirement): @@ -18534,23 +18631,6 @@ class NetworkAccess(ProcessRequirement): """ - def __init__( - self, - networkAccess: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "NetworkAccess" - self.networkAccess = networkAccess - def __eq__(self, other: Any) -> bool: if isinstance(other, NetworkAccess): return bool( @@ -18568,8 +18648,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "NetworkAccess": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -18640,7 +18720,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -18706,7 +18786,24 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "networkAccess"]) + def __init__( + self, + networkAccess: bool | str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "NetworkAccess" + self.networkAccess: bool | str = networkAccess + + attrs: ClassVar[Collection[str]] = frozenset(["class", "networkAccess"]) class InplaceUpdateRequirement(ProcessRequirement): @@ -18744,23 +18841,6 @@ class InplaceUpdateRequirement(ProcessRequirement): """ - def __init__( - self, - inplaceUpdate: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "InplaceUpdateRequirement" - self.inplaceUpdate = inplaceUpdate - def __eq__(self, other: Any) -> bool: if isinstance(other, InplaceUpdateRequirement): return bool( @@ -18778,8 +18858,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "InplaceUpdateRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -18850,7 +18930,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -18916,7 +18996,24 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "inplaceUpdate"]) + def __init__( + self, + inplaceUpdate: bool, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "InplaceUpdateRequirement" + self.inplaceUpdate: bool = inplaceUpdate + + attrs: ClassVar[Collection[str]] = frozenset(["class", "inplaceUpdate"]) class ToolTimeLimit(ProcessRequirement): @@ -18931,23 +19028,6 @@ class ToolTimeLimit(ProcessRequirement): """ - def __init__( - self, - timelimit: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "ToolTimeLimit" - self.timelimit = timelimit - def __eq__(self, other: Any) -> bool: if isinstance(other, ToolTimeLimit): return bool( @@ -18964,8 +19044,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "ToolTimeLimit": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -18994,7 +19074,7 @@ def fromDoc( timelimit = load_field( _doc.get("timelimit"), - union_of_inttype_or_ExpressionLoader, + union_of_inttype_or_inttype_or_ExpressionLoader, baseuri, loadingOptions, lc=_doc.get("timelimit") @@ -19036,7 +19116,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -19102,23 +19182,11 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "timelimit"]) - - -class ExpressionToolOutputParameter(OutputParameter): - id: str - def __init__( self, - id: Any, - type_: Any, - label: Optional[Any] = None, - secondaryFiles: Optional[Any] = None, - streamable: Optional[Any] = None, - doc: Optional[Any] = None, - format: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + timelimit: i32 | str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -19128,13 +19196,14 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.format = format - self.type_ = type_ + self.class_: Final[str] = "ToolTimeLimit" + self.timelimit: i32 | str = timelimit + + attrs: ClassVar[Collection[str]] = frozenset(["class", "timelimit"]) + + +class ExpressionToolOutputParameter(OutputParameter): + id: str def __eq__(self, other: Any) -> bool: if isinstance(other, ExpressionToolOutputParameter): @@ -19168,8 +19237,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "ExpressionToolOutputParameter": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -19515,7 +19584,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -19540,11 +19609,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + id=cast(str, id), label=label, secondaryFiles=secondaryFiles, streamable=streamable, doc=doc, - id=id, format=format, type_=type_, extension_fields=extension_fields, @@ -19605,29 +19674,17 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( - ["label", "secondaryFiles", "streamable", "doc", "id", "format", "type"] - ) - - -class WorkflowInputParameter(InputParameter): - id: str - def __init__( self, - id: Any, - type_: Any, - label: Optional[Any] = None, - secondaryFiles: Optional[Any] = None, - streamable: Optional[Any] = None, - doc: Optional[Any] = None, - format: Optional[Any] = None, - loadContents: Optional[Any] = None, - loadListing: Optional[Any] = None, - default: Optional[Any] = None, - inputBinding: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + id: str, + type_: Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str, + label: None | str = None, + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = None, + streamable: None | bool = None, + doc: None | Sequence[str] | str = None, + format: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -19637,17 +19694,21 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.format = format - self.loadContents = loadContents - self.loadListing = loadListing - self.default = default - self.type_ = type_ - self.inputBinding = inputBinding + self.label: None | str = label + self.secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = secondaryFiles + self.streamable: None | bool = streamable + self.doc: None | Sequence[str] | str = doc + self.id: str = id + self.format: None | str = format + self.type_: Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str = type_ + + attrs: ClassVar[Collection[str]] = frozenset( + ["label", "secondaryFiles", "streamable", "doc", "id", "format", "type"] + ) + + +class WorkflowInputParameter(InputParameter): + id: str def __eq__(self, other: Any) -> bool: if isinstance(other, WorkflowInputParameter): @@ -19689,8 +19750,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "WorkflowInputParameter": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -20224,7 +20285,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -20249,11 +20310,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + id=cast(str, id), label=label, secondaryFiles=secondaryFiles, streamable=streamable, doc=doc, - id=id, format=format, loadContents=loadContents, loadListing=loadListing, @@ -20343,7 +20404,43 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + id: str, + type_: InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str, + label: None | str = None, + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = None, + streamable: None | bool = None, + doc: None | Sequence[str] | str = None, + format: None | Sequence[str] | str = None, + loadContents: None | bool = None, + loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = None, + default: CWLObjectType | None = None, + inputBinding: InputBinding | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.label: None | str = label + self.secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = secondaryFiles + self.streamable: None | bool = streamable + self.doc: None | Sequence[str] | str = doc + self.id: str = id + self.format: None | Sequence[str] | str = format + self.loadContents: None | bool = loadContents + self.loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = loadListing + self.default: CWLObjectType | None = default + self.type_: InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str = type_ + self.inputBinding: InputBinding | None = inputBinding + + attrs: ClassVar[Collection[str]] = frozenset( [ "label", "secondaryFiles", @@ -20374,39 +20471,6 @@ class ExpressionTool(Process): id: str - def __init__( - self, - inputs: Any, - outputs: Any, - expression: Any, - id: Optional[Any] = None, - label: Optional[Any] = None, - doc: Optional[Any] = None, - requirements: Optional[Any] = None, - hints: Optional[Any] = None, - cwlVersion: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.label = label - self.doc = doc - self.inputs = inputs - self.outputs = outputs - self.requirements = requirements - self.hints = hints - self.cwlVersion = cwlVersion - self.class_ = "ExpressionTool" - self.expression = expression - def __eq__(self, other: Any) -> bool: if isinstance(other, ExpressionTool): return bool( @@ -20445,8 +20509,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "ExpressionTool": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -20904,7 +20968,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -20929,7 +20993,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=id, + id=cast(str, id), label=label, doc=doc, inputs=inputs, @@ -21012,7 +21076,40 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + inputs: Sequence[WorkflowInputParameter], + outputs: Sequence[ExpressionToolOutputParameter], + expression: str, + id: None | str = None, + label: None | str = None, + doc: None | Sequence[str] | str = None, + requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = None, + hints: None | Sequence[Any | CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = None, + cwlVersion: Literal["v1.1"] | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.id: str = id if id is not None else "_:" + str(_uuid__.uuid4()) + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + self.inputs: Sequence[WorkflowInputParameter] = inputs + self.outputs: Sequence[ExpressionToolOutputParameter] = outputs + self.requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = requirements + self.hints: None | Sequence[Any | CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = hints + self.cwlVersion: Literal["v1.1"] | None = cwlVersion + self.class_: Final[str] = "ExpressionTool" + self.expression: str = expression + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "label", @@ -21039,38 +21136,6 @@ class WorkflowOutputParameter(OutputParameter): id: str - def __init__( - self, - id: Any, - type_: Any, - label: Optional[Any] = None, - secondaryFiles: Optional[Any] = None, - streamable: Optional[Any] = None, - doc: Optional[Any] = None, - format: Optional[Any] = None, - outputSource: Optional[Any] = None, - linkMerge: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.format = format - self.outputSource = outputSource - self.linkMerge = linkMerge - self.type_ = type_ - def __eq__(self, other: Any) -> bool: if isinstance(other, WorkflowOutputParameter): return bool( @@ -21107,8 +21172,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "WorkflowOutputParameter": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -21548,7 +21613,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -21573,11 +21638,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + id=cast(str, id), label=label, secondaryFiles=secondaryFiles, streamable=streamable, doc=doc, - id=id, format=format, outputSource=outputSource, linkMerge=linkMerge, @@ -21647,7 +21712,39 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + id: str, + type_: Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str, + label: None | str = None, + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = None, + streamable: None | bool = None, + doc: None | Sequence[str] | str = None, + format: None | str = None, + outputSource: None | Sequence[str] | str = None, + linkMerge: Literal["merge_nested", "merge_flattened"] | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.label: None | str = label + self.secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = secondaryFiles + self.streamable: None | bool = streamable + self.doc: None | Sequence[str] | str = doc + self.id: str = id + self.format: None | str = format + self.outputSource: None | Sequence[str] | str = outputSource + self.linkMerge: Literal["merge_nested", "merge_flattened"] | None = linkMerge + self.type_: Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str = type_ + + attrs: ClassVar[Collection[str]] = frozenset( [ "label", "secondaryFiles", @@ -21662,8 +21759,10 @@ def save( ) -class Sink(Saveable): - pass +@trait +class Sink(Saveable, metaclass=ABCMeta): + source: None | Sequence[str] | str + linkMerge: Literal["merge_nested", "merge_flattened"] | None class WorkflowStepInput(IdentifierRequired, Sink, LoadContents, Labeled): @@ -21716,36 +21815,6 @@ class WorkflowStepInput(IdentifierRequired, Sink, LoadContents, Labeled): id: str - def __init__( - self, - id: Any, - source: Optional[Any] = None, - linkMerge: Optional[Any] = None, - loadContents: Optional[Any] = None, - loadListing: Optional[Any] = None, - label: Optional[Any] = None, - default: Optional[Any] = None, - valueFrom: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.source = source - self.linkMerge = linkMerge - self.loadContents = loadContents - self.loadListing = loadListing - self.label = label - self.default = default - self.valueFrom = valueFrom - def __eq__(self, other: Any) -> bool: if isinstance(other, WorkflowStepInput): return bool( @@ -21780,8 +21849,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "WorkflowStepInput": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -22173,7 +22242,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -22198,7 +22267,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=id, + id=cast(str, id), source=source, linkMerge=linkMerge, loadContents=loadContents, @@ -22268,7 +22337,37 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + id: str, + source: None | Sequence[str] | str = None, + linkMerge: Literal["merge_nested", "merge_flattened"] | None = None, + loadContents: None | bool = None, + loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = None, + label: None | str = None, + default: CWLObjectType | None = None, + valueFrom: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.id: str = id + self.source: None | Sequence[str] | str = source + self.linkMerge: Literal["merge_nested", "merge_flattened"] | None = linkMerge + self.loadContents: None | bool = loadContents + self.loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = loadListing + self.label: None | str = label + self.default: CWLObjectType | None = default + self.valueFrom: None | str = valueFrom + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "source", @@ -22297,22 +22396,6 @@ class WorkflowStepOutput(IdentifierRequired): id: str - def __init__( - self, - id: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - def __eq__(self, other: Any) -> bool: if isinstance(other, WorkflowStepOutput): return bool(self.id == other.id) @@ -22327,8 +22410,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "WorkflowStepOutput": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -22391,7 +22474,7 @@ def fromDoc( _errors__.append(ValidationException("missing id")) if not __original_id_is_none: baseuri = cast(str, id) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -22414,7 +22497,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=id, + id=cast(str, id), extension_fields=extension_fields, loadingOptions=loadingOptions, ) @@ -22444,10 +22527,26 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["id"]) - - -class WorkflowStep(IdentifierRequired, Labeled, Documented): + def __init__( + self, + id: str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.id: str = id + + attrs: ClassVar[Collection[str]] = frozenset(["id"]) + + +class WorkflowStep(IdentifierRequired, Labeled, Documented): """ A workflow step is an executable element of a workflow. It specifies the underlying process implementation (such as `CommandLineTool` or another @@ -22509,40 +22608,6 @@ class WorkflowStep(IdentifierRequired, Labeled, Documented): id: str - def __init__( - self, - id: Any, - in_: Any, - out: Any, - run: Any, - label: Optional[Any] = None, - doc: Optional[Any] = None, - requirements: Optional[Any] = None, - hints: Optional[Any] = None, - scatter: Optional[Any] = None, - scatterMethod: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.label = label - self.doc = doc - self.in_ = in_ - self.out = out - self.requirements = requirements - self.hints = hints - self.run = run - self.scatter = scatter - self.scatterMethod = scatterMethod - def __eq__(self, other: Any) -> bool: if isinstance(other, WorkflowStep): return bool( @@ -22581,8 +22646,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "WorkflowStep": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -23073,7 +23138,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -23098,7 +23163,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=id, + id=cast(str, id), label=label, doc=doc, in_=in_, @@ -23174,7 +23239,41 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + id: str, + in_: Sequence[WorkflowStepInput], + out: Sequence[WorkflowStepOutput | str], + run: CommandLineTool | ExpressionTool | ProcessGenerator | Workflow | str, + label: None | str = None, + doc: None | Sequence[str] | str = None, + requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = None, + hints: None | Sequence[Any] = None, + scatter: None | Sequence[str] | str = None, + scatterMethod: Literal["dotproduct", "nested_crossproduct", "flat_crossproduct"] | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.id: str = id + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + self.in_: Sequence[WorkflowStepInput] = in_ + self.out: Sequence[WorkflowStepOutput | str] = out + self.requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = requirements + self.hints: None | Sequence[Any] = hints + self.run: CommandLineTool | ExpressionTool | ProcessGenerator | Workflow | str = run + self.scatter: None | Sequence[str] | str = scatter + self.scatterMethod: Literal["dotproduct", "nested_crossproduct", "flat_crossproduct"] | None = scatterMethod + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "label", @@ -23242,39 +23341,6 @@ class Workflow(Process): id: str - def __init__( - self, - inputs: Any, - outputs: Any, - steps: Any, - id: Optional[Any] = None, - label: Optional[Any] = None, - doc: Optional[Any] = None, - requirements: Optional[Any] = None, - hints: Optional[Any] = None, - cwlVersion: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.label = label - self.doc = doc - self.inputs = inputs - self.outputs = outputs - self.requirements = requirements - self.hints = hints - self.cwlVersion = cwlVersion - self.class_ = "Workflow" - self.steps = steps - def __eq__(self, other: Any) -> bool: if isinstance(other, Workflow): return bool( @@ -23313,8 +23379,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "Workflow": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -23772,7 +23838,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -23797,7 +23863,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=id, + id=cast(str, id), label=label, doc=doc, inputs=inputs, @@ -23877,7 +23943,40 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + inputs: Sequence[WorkflowInputParameter], + outputs: Sequence[WorkflowOutputParameter], + steps: Sequence[WorkflowStep], + id: None | str = None, + label: None | str = None, + doc: None | Sequence[str] | str = None, + requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = None, + hints: None | Sequence[Any | CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = None, + cwlVersion: Literal["v1.1"] | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.id: str = id if id is not None else "_:" + str(_uuid__.uuid4()) + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + self.inputs: Sequence[WorkflowInputParameter] = inputs + self.outputs: Sequence[WorkflowOutputParameter] = outputs + self.requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = requirements + self.hints: None | Sequence[Any | CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = hints + self.cwlVersion: Literal["v1.1"] | None = cwlVersion + self.class_: Final[str] = "Workflow" + self.steps: Sequence[WorkflowStep] = steps + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "label", @@ -23900,21 +23999,6 @@ class SubworkflowFeatureRequirement(ProcessRequirement): """ - def __init__( - self, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "SubworkflowFeatureRequirement" - def __eq__(self, other: Any) -> bool: if isinstance(other, SubworkflowFeatureRequirement): return bool(self.class_ == other.class_) @@ -23929,8 +24013,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "SubworkflowFeatureRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -23953,7 +24037,7 @@ def fromDoc( raise ValidationException(f"tried `{cls.__name__}` but") except ValidationException as e: raise e - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -24009,20 +24093,10 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class"]) - - -class ScatterFeatureRequirement(ProcessRequirement): - """ - Indicates that the workflow platform must support the `scatter` and - `scatterMethod` fields of [WorkflowStep](#WorkflowStep). - - """ - def __init__( self, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -24032,7 +24106,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "ScatterFeatureRequirement" + self.class_: Final[str] = "SubworkflowFeatureRequirement" + + attrs: ClassVar[Collection[str]] = frozenset(["class"]) + + +class ScatterFeatureRequirement(ProcessRequirement): + """ + Indicates that the workflow platform must support the `scatter` and + `scatterMethod` fields of [WorkflowStep](#WorkflowStep). + + """ def __eq__(self, other: Any) -> bool: if isinstance(other, ScatterFeatureRequirement): @@ -24048,8 +24132,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "ScatterFeatureRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -24072,7 +24156,7 @@ def fromDoc( raise ValidationException(f"tried `{cls.__name__}` but") except ValidationException as e: raise e - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -24128,20 +24212,10 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class"]) - - -class MultipleInputFeatureRequirement(ProcessRequirement): - """ - Indicates that the workflow platform must support multiple inbound data links - listed in the `source` field of [WorkflowStepInput](#WorkflowStepInput). - - """ - def __init__( self, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -24151,7 +24225,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "MultipleInputFeatureRequirement" + self.class_: Final[str] = "ScatterFeatureRequirement" + + attrs: ClassVar[Collection[str]] = frozenset(["class"]) + + +class MultipleInputFeatureRequirement(ProcessRequirement): + """ + Indicates that the workflow platform must support multiple inbound data links + listed in the `source` field of [WorkflowStepInput](#WorkflowStepInput). + + """ def __eq__(self, other: Any) -> bool: if isinstance(other, MultipleInputFeatureRequirement): @@ -24167,8 +24251,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "MultipleInputFeatureRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -24191,7 +24275,7 @@ def fromDoc( raise ValidationException(f"tried `{cls.__name__}` but") except ValidationException as e: raise e - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -24247,20 +24331,10 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class"]) - - -class StepInputExpressionRequirement(ProcessRequirement): - """ - Indicate that the workflow platform must support the `valueFrom` field - of [WorkflowStepInput](#WorkflowStepInput). - - """ - def __init__( self, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -24270,7 +24344,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "StepInputExpressionRequirement" + self.class_: Final[str] = "MultipleInputFeatureRequirement" + + attrs: ClassVar[Collection[str]] = frozenset(["class"]) + + +class StepInputExpressionRequirement(ProcessRequirement): + """ + Indicate that the workflow platform must support the `valueFrom` field + of [WorkflowStepInput](#WorkflowStepInput). + + """ def __eq__(self, other: Any) -> bool: if isinstance(other, StepInputExpressionRequirement): @@ -24286,8 +24370,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "StepInputExpressionRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -24310,7 +24394,7 @@ def fromDoc( raise ValidationException(f"tried `{cls.__name__}` but") except ValidationException as e: raise e - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -24366,15 +24450,10 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class"]) - - -class Secrets(ProcessRequirement): def __init__( self, - secrets: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -24384,9 +24463,12 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "Secrets" - self.secrets = secrets + self.class_: Final[str] = "StepInputExpressionRequirement" + attrs: ClassVar[Collection[str]] = frozenset(["class"]) + + +class Secrets(ProcessRequirement): def __eq__(self, other: Any) -> bool: if isinstance(other, Secrets): return bool(self.class_ == other.class_ and self.secrets == other.secrets) @@ -24401,8 +24483,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "Secrets": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -24473,7 +24555,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -24535,25 +24617,11 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "secrets"]) - - -class ProcessGenerator(Process): - id: str - def __init__( self, - inputs: Any, - outputs: Any, - run: Any, - id: Optional[Any] = None, - label: Optional[Any] = None, - doc: Optional[Any] = None, - requirements: Optional[Any] = None, - hints: Optional[Any] = None, - cwlVersion: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + secrets: Sequence[str], + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -24563,16 +24631,14 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.label = label - self.doc = doc - self.inputs = inputs - self.outputs = outputs - self.requirements = requirements - self.hints = hints - self.cwlVersion = cwlVersion - self.class_ = "ProcessGenerator" - self.run = run + self.class_: Final[str] = "Secrets" + self.secrets: Sequence[str] = secrets + + attrs: ClassVar[Collection[str]] = frozenset(["class", "secrets"]) + + +class ProcessGenerator(Process): + id: str def __eq__(self, other: Any) -> bool: if isinstance(other, ProcessGenerator): @@ -24612,8 +24678,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "ProcessGenerator": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -24792,7 +24858,7 @@ def fromDoc( inputs = load_field( _doc.get("inputs"), - idmap_inputs_array_of_union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader, + idmap_inputs_array_of_WorkflowInputParameterLoader, baseuri, loadingOptions, lc=_doc.get("inputs") @@ -24840,7 +24906,7 @@ def fromDoc( outputs = load_field( _doc.get("outputs"), - idmap_outputs_array_of_union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader, + idmap_outputs_array_of_ExpressionToolOutputParameterLoader, baseuri, loadingOptions, lc=_doc.get("outputs") @@ -25073,7 +25139,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -25098,7 +25164,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=id, + id=cast(str, id), label=label, doc=doc, inputs=inputs, @@ -25177,7 +25243,40 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + inputs: Sequence[WorkflowInputParameter], + outputs: Sequence[ExpressionToolOutputParameter], + run: CommandLineTool | ExpressionTool | ProcessGenerator | Workflow | str, + id: None | str = None, + label: None | str = None, + doc: None | Sequence[str] | str = None, + requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = None, + hints: None | Sequence[Any | CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = None, + cwlVersion: Literal["v1.1"] | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.id: str = id if id is not None else "_:" + str(_uuid__.uuid4()) + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + self.inputs: Sequence[WorkflowInputParameter] = inputs + self.outputs: Sequence[ExpressionToolOutputParameter] = outputs + self.requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = requirements + self.hints: None | Sequence[Any | CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = hints + self.cwlVersion: Literal["v1.1"] | None = cwlVersion + self.class_: Final[str] = "ProcessGenerator" + self.run: CommandLineTool | ExpressionTool | ProcessGenerator | Workflow | str = run + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "label", @@ -25199,23 +25298,6 @@ class MPIRequirement(ProcessRequirement): """ - def __init__( - self, - processes: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "MPIRequirement" - self.processes = processes - def __eq__(self, other: Any) -> bool: if isinstance(other, MPIRequirement): return bool( @@ -25232,8 +25314,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "MPIRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -25304,7 +25386,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -25370,23 +25452,11 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "processes"]) - - -class CUDARequirement(ProcessRequirement): - """ - Require support for NVIDA CUDA (GPU hardware acceleration). - - """ - def __init__( self, - cudaComputeCapability: Any, - cudaVersionMin: Any, - cudaDeviceCountMax: Optional[Any] = None, - cudaDeviceCountMin: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + processes: i32 | str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -25396,11 +25466,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "CUDARequirement" - self.cudaComputeCapability = cudaComputeCapability - self.cudaDeviceCountMax = cudaDeviceCountMax - self.cudaDeviceCountMin = cudaDeviceCountMin - self.cudaVersionMin = cudaVersionMin + self.class_: Final[str] = "MPIRequirement" + self.processes: i32 | str = processes + + attrs: ClassVar[Collection[str]] = frozenset(["class", "processes"]) + + +class CUDARequirement(ProcessRequirement): + """ + Require support for NVIDA CUDA (GPU hardware acceleration). + + """ def __eq__(self, other: Any) -> bool: if isinstance(other, CUDARequirement): @@ -25430,8 +25506,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CUDARequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -25644,7 +25720,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -25734,23 +25810,14 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( - [ - "class", - "cudaComputeCapability", - "cudaDeviceCountMax", - "cudaDeviceCountMin", - "cudaVersionMin", - ] - ) - - -class ShmSize(ProcessRequirement): def __init__( self, - shmSize: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + cudaComputeCapability: Sequence[str] | str, + cudaVersionMin: str, + cudaDeviceCountMax: None | i32 | str = None, + cudaDeviceCountMin: None | i32 | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -25760,9 +25827,24 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "ShmSize" - self.shmSize = shmSize + self.class_: Final[str] = "CUDARequirement" + self.cudaComputeCapability: Sequence[str] | str = cudaComputeCapability + self.cudaDeviceCountMax: None | i32 | str = cudaDeviceCountMax + self.cudaDeviceCountMin: None | i32 | str = cudaDeviceCountMin + self.cudaVersionMin: str = cudaVersionMin + attrs: ClassVar[Collection[str]] = frozenset( + [ + "class", + "cudaComputeCapability", + "cudaDeviceCountMax", + "cudaDeviceCountMin", + "cudaVersionMin", + ] + ) + + +class ShmSize(ProcessRequirement): def __eq__(self, other: Any) -> bool: if isinstance(other, ShmSize): return bool(self.class_ == other.class_ and self.shmSize == other.shmSize) @@ -25777,8 +25859,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "ShmSize": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -25849,7 +25931,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -25912,10 +25994,27 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "shmSize"]) + def __init__( + self, + shmSize: str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "ShmSize" + self.shmSize: str = shmSize + + attrs: ClassVar[Collection[str]] = frozenset(["class", "shmSize"]) -_vocab = { +_vocab.update({ "Any": "https://w3id.org/cwl/salad#Any", "ArraySchema": "https://w3id.org/cwl/salad#ArraySchema", "CUDARequirement": "http://commonwl.org/cwltool#CUDARequirement", @@ -26018,16 +26117,6 @@ def save( "deep_listing": "https://w3id.org/cwl/cwl#LoadListingEnum/deep_listing", "dotproduct": "https://w3id.org/cwl/cwl#ScatterMethod/dotproduct", "double": "http://www.w3.org/2001/XMLSchema#double", - "draft-2": "https://w3id.org/cwl/cwl#draft-2", - "draft-3": "https://w3id.org/cwl/cwl#draft-3", - "draft-3.dev1": "https://w3id.org/cwl/cwl#draft-3.dev1", - "draft-3.dev2": "https://w3id.org/cwl/cwl#draft-3.dev2", - "draft-3.dev3": "https://w3id.org/cwl/cwl#draft-3.dev3", - "draft-3.dev4": "https://w3id.org/cwl/cwl#draft-3.dev4", - "draft-3.dev5": "https://w3id.org/cwl/cwl#draft-3.dev5", - "draft-4.dev1": "https://w3id.org/cwl/cwl#draft-4.dev1", - "draft-4.dev2": "https://w3id.org/cwl/cwl#draft-4.dev2", - "draft-4.dev3": "https://w3id.org/cwl/cwl#draft-4.dev3", "enum": "https://w3id.org/cwl/salad#enum", "flat_crossproduct": "https://w3id.org/cwl/cwl#ScatterMethod/flat_crossproduct", "float": "http://www.w3.org/2001/XMLSchema#float", @@ -26046,12 +26135,9 @@ def save( "stdout": "https://w3id.org/cwl/cwl#stdout", "string": "http://www.w3.org/2001/XMLSchema#string", "union": "https://w3id.org/cwl/salad#union", - "v1.0": "https://w3id.org/cwl/cwl#v1.0", - "v1.0.dev4": "https://w3id.org/cwl/cwl#v1.0.dev4", "v1.1": "https://w3id.org/cwl/cwl#v1.1", - "v1.1.0-dev1": "https://w3id.org/cwl/cwl#v1.1.0-dev1", -} -_rvocab = { +}) +_rvocab.update({ "https://w3id.org/cwl/salad#Any": "Any", "https://w3id.org/cwl/salad#ArraySchema": "ArraySchema", "http://commonwl.org/cwltool#CUDARequirement": "CUDARequirement", @@ -26154,16 +26240,6 @@ def save( "https://w3id.org/cwl/cwl#LoadListingEnum/deep_listing": "deep_listing", "https://w3id.org/cwl/cwl#ScatterMethod/dotproduct": "dotproduct", "http://www.w3.org/2001/XMLSchema#double": "double", - "https://w3id.org/cwl/cwl#draft-2": "draft-2", - "https://w3id.org/cwl/cwl#draft-3": "draft-3", - "https://w3id.org/cwl/cwl#draft-3.dev1": "draft-3.dev1", - "https://w3id.org/cwl/cwl#draft-3.dev2": "draft-3.dev2", - "https://w3id.org/cwl/cwl#draft-3.dev3": "draft-3.dev3", - "https://w3id.org/cwl/cwl#draft-3.dev4": "draft-3.dev4", - "https://w3id.org/cwl/cwl#draft-3.dev5": "draft-3.dev5", - "https://w3id.org/cwl/cwl#draft-4.dev1": "draft-4.dev1", - "https://w3id.org/cwl/cwl#draft-4.dev2": "draft-4.dev2", - "https://w3id.org/cwl/cwl#draft-4.dev3": "draft-4.dev3", "https://w3id.org/cwl/salad#enum": "enum", "https://w3id.org/cwl/cwl#ScatterMethod/flat_crossproduct": "flat_crossproduct", "http://www.w3.org/2001/XMLSchema#float": "float", @@ -26182,19 +26258,17 @@ def save( "https://w3id.org/cwl/cwl#stdout": "stdout", "http://www.w3.org/2001/XMLSchema#string": "string", "https://w3id.org/cwl/salad#union": "union", - "https://w3id.org/cwl/cwl#v1.0": "v1.0", - "https://w3id.org/cwl/cwl#v1.0.dev4": "v1.0.dev4", "https://w3id.org/cwl/cwl#v1.1": "v1.1", - "https://w3id.org/cwl/cwl#v1.1.0-dev1": "v1.1.0-dev1", -} - -strtype = _PrimitiveLoader(str) -inttype = _PrimitiveLoader(int) -floattype = _PrimitiveLoader(float) -booltype = _PrimitiveLoader(bool) -None_type = _PrimitiveLoader(type(None)) -Any_type = _AnyLoader() -PrimitiveTypeLoader = _EnumLoader( +}) + +strtype: Final = _PrimitiveLoader(str) +inttype: Final = _PrimitiveLoader(i32) +floattype: Final = _PrimitiveLoader(float) +booltype: Final = _PrimitiveLoader(bool) +None_type: Final = _PrimitiveLoader(type(None)) +Any_type: Final = _AnyLoader() +longtype: Final = _PrimitiveLoader(i64) +PrimitiveTypeLoader: Final = _EnumLoader( ( "null", "boolean", @@ -26220,17 +26294,17 @@ def save( double: double precision (64-bit) IEEE 754 floating-point number string: Unicode character sequence """ -AnyLoader = _EnumLoader(("Any",), "Any") +AnyLoader: Final = _EnumLoader(("Any",), "Any") """ The **Any** type validates for any non-null value. """ -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( +RecordFieldLoader: Final = _RecordLoader(RecordField, None, None) +RecordSchemaLoader: Final = _RecordLoader(RecordSchema, None, None) +EnumSchemaLoader: Final = _RecordLoader(EnumSchema, None, None) +ArraySchemaLoader: Final = _RecordLoader(ArraySchema, None, None) +MapSchemaLoader: Final = _RecordLoader(MapSchema, None, None) +UnionSchemaLoader: Final = _RecordLoader(UnionSchema, None, None) +CWLTypeLoader: Final = _EnumLoader( ( "null", "boolean", @@ -26249,54 +26323,64 @@ def save( File: A File object Directory: A Directory object """ -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( +CWLArraySchemaLoader: Final = _RecordLoader(CWLArraySchema, None, None) +CWLRecordFieldLoader: Final = _RecordLoader(CWLRecordField, None, None) +CWLRecordSchemaLoader: Final = _RecordLoader(CWLRecordSchema, None, None) +FileLoader: Final = _RecordLoader(File, None, None) +DirectoryLoader: Final = _RecordLoader(Directory, None, None) +CWLObjectTypeLoader: Final = _UnionLoader((), "CWLObjectTypeLoader") +union_of_None_type_or_CWLObjectTypeLoader: Final = _UnionLoader( ( None_type, CWLObjectTypeLoader, ) ) -array_of_union_of_None_type_or_CWLObjectTypeLoader = _ArrayLoader( +array_of_union_of_None_type_or_CWLObjectTypeLoader: Final = _ArrayLoader( union_of_None_type_or_CWLObjectTypeLoader ) -map_of_union_of_None_type_or_CWLObjectTypeLoader = _MapLoader( +map_of_union_of_None_type_or_CWLObjectTypeLoader: Final = _MapLoader( union_of_None_type_or_CWLObjectTypeLoader, "None", None, None ) -InlineJavascriptRequirementLoader = _RecordLoader( +InlineJavascriptRequirementLoader: Final = _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( +SchemaDefRequirementLoader: Final = _RecordLoader(SchemaDefRequirement, None, None) +LoadListingRequirementLoader: Final = _RecordLoader(LoadListingRequirement, None, None) +DockerRequirementLoader: Final = _RecordLoader(DockerRequirement, None, None) +SoftwareRequirementLoader: Final = _RecordLoader(SoftwareRequirement, None, None) +InitialWorkDirRequirementLoader: Final = _RecordLoader( + InitialWorkDirRequirement, None, None +) +EnvVarRequirementLoader: Final = _RecordLoader(EnvVarRequirement, None, None) +ShellCommandRequirementLoader: Final = _RecordLoader( + ShellCommandRequirement, None, None +) +ResourceRequirementLoader: Final = _RecordLoader(ResourceRequirement, None, None) +WorkReuseLoader: Final = _RecordLoader(WorkReuse, None, None) +NetworkAccessLoader: Final = _RecordLoader(NetworkAccess, None, None) +InplaceUpdateRequirementLoader: Final = _RecordLoader( + InplaceUpdateRequirement, None, None +) +ToolTimeLimitLoader: Final = _RecordLoader(ToolTimeLimit, None, None) +SubworkflowFeatureRequirementLoader: Final = _RecordLoader( SubworkflowFeatureRequirement, None, None ) -ScatterFeatureRequirementLoader = _RecordLoader(ScatterFeatureRequirement, None, None) -MultipleInputFeatureRequirementLoader = _RecordLoader( +ScatterFeatureRequirementLoader: Final = _RecordLoader( + ScatterFeatureRequirement, None, None +) +MultipleInputFeatureRequirementLoader: Final = _RecordLoader( MultipleInputFeatureRequirement, None, None ) -StepInputExpressionRequirementLoader = _RecordLoader( +StepInputExpressionRequirementLoader: Final = _RecordLoader( StepInputExpressionRequirement, None, None ) -SecretsLoader = _RecordLoader(Secrets, None, None) -MPIRequirementLoader = _RecordLoader(MPIRequirement, None, None) -CUDARequirementLoader = _RecordLoader(CUDARequirement, None, None) -ShmSizeLoader = _RecordLoader(ShmSize, None, None) -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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader = _UnionLoader( +SecretsLoader: Final = _RecordLoader(Secrets, None, None) +MPIRequirementLoader: Final = _RecordLoader(MPIRequirement, None, None) +CUDARequirementLoader: Final = _RecordLoader(CUDARequirement, None, None) +ShmSizeLoader: Final = _RecordLoader(ShmSize, None, None) +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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader: ( + Final +) = _UnionLoader( ( InlineJavascriptRequirementLoader, SchemaDefRequirementLoader, @@ -26321,46 +26405,36 @@ def save( ShmSizeLoader, ) ) -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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader = _ArrayLoader( +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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader: ( + Final +) = _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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader ) -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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader_or_CWLObjectTypeLoader = _UnionLoader( +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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader_or_CWLObjectTypeLoader: ( + Final +) = _UnionLoader( ( None_type, 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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader, CWLObjectTypeLoader, ) ) -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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader_or_CWLObjectTypeLoader = _MapLoader( +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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader_or_CWLObjectTypeLoader: ( + Final +) = _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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader_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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader_or_CWLObjectTypeLoader -CWLVersionLoader = _EnumLoader( - ( - "draft-2", - "draft-3.dev1", - "draft-3.dev2", - "draft-3.dev3", - "draft-3.dev4", - "draft-3.dev5", - "draft-3", - "draft-4.dev1", - "draft-4.dev2", - "draft-4.dev3", - "v1.0.dev4", - "v1.0", - "v1.1.0-dev1", - "v1.1", - ), - "CWLVersion", +CWLInputFileLoader: Final = ( + 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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader_or_CWLObjectTypeLoader ) +CWLVersionLoader: Final = _EnumLoader(("v1.1",), "CWLVersion") """ -Version symbols for published CWL document versions. +Current version symbol for CWL documents. """ -LoadListingEnumLoader = _EnumLoader( +LoadListingEnumLoader: Final = _EnumLoader( ( "no_listing", "shallow_listing", @@ -26376,31 +26450,45 @@ def save( shallow_listing: Only load the top level listing, do not recurse into subdirectories. deep_listing: Load the directory listing and recursively load all subdirectories as well. """ -ExpressionLoader = _ExpressionLoader(str) -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) -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") +ExpressionLoader: Final = _ExpressionLoader(str) +InputBindingLoader: Final = _RecordLoader(InputBinding, None, None) +InputRecordFieldLoader: Final = _RecordLoader(InputRecordField, None, None) +InputRecordSchemaLoader: Final = _RecordLoader(InputRecordSchema, None, None) +InputEnumSchemaLoader: Final = _RecordLoader(InputEnumSchema, None, None) +InputArraySchemaLoader: Final = _RecordLoader(InputArraySchema, None, None) +OutputRecordFieldLoader: Final = _RecordLoader(OutputRecordField, None, None) +OutputRecordSchemaLoader: Final = _RecordLoader(OutputRecordSchema, None, None) +OutputEnumSchemaLoader: Final = _RecordLoader(OutputEnumSchema, None, None) +OutputArraySchemaLoader: Final = _RecordLoader(OutputArraySchema, None, None) +SecondaryFileSchemaLoader: Final = _RecordLoader(SecondaryFileSchema, None, None) +EnvironmentDefLoader: Final = _RecordLoader(EnvironmentDef, None, None) +CommandLineBindingLoader: Final = _RecordLoader(CommandLineBinding, None, None) +CommandOutputBindingLoader: Final = _RecordLoader(CommandOutputBinding, None, None) +CommandInputRecordFieldLoader: Final = _RecordLoader( + CommandInputRecordField, None, None +) +CommandInputRecordSchemaLoader: Final = _RecordLoader( + CommandInputRecordSchema, None, None +) +CommandInputEnumSchemaLoader: Final = _RecordLoader(CommandInputEnumSchema, None, None) +CommandInputArraySchemaLoader: Final = _RecordLoader( + CommandInputArraySchema, None, None +) +CommandOutputRecordFieldLoader: Final = _RecordLoader( + CommandOutputRecordField, None, None +) +CommandOutputRecordSchemaLoader: Final = _RecordLoader( + CommandOutputRecordSchema, None, None +) +CommandOutputEnumSchemaLoader: Final = _RecordLoader( + CommandOutputEnumSchema, None, None +) +CommandOutputArraySchemaLoader: Final = _RecordLoader( + CommandOutputArraySchema, None, None +) +CommandInputParameterLoader: Final = _RecordLoader(CommandInputParameter, None, None) +CommandOutputParameterLoader: Final = _RecordLoader(CommandOutputParameter, None, None) +stdinLoader: Final = _EnumLoader(("stdin",), "stdin") """ Only valid as a `type` for a `CommandLineTool` input with no `inputBinding` set. `stdin` must not be specified at the `CommandLineTool` @@ -26422,7 +26510,7 @@ def save( stdin: ${inputs.an_input_name.path} ``` """ -stdoutLoader = _EnumLoader(("stdout",), "stdout") +stdoutLoader: Final = _EnumLoader(("stdout",), "stdout") """ Only valid as a `type` for a `CommandLineTool` output with no `outputBinding` set. @@ -26466,7 +26554,7 @@ def save( stdout: random_stdout_filenameABCDEFG ``` """ -stderrLoader = _EnumLoader(("stderr",), "stderr") +stderrLoader: Final = _EnumLoader(("stderr",), "stderr") """ Only valid as a `type` for a `CommandLineTool` output with no `outputBinding` set. @@ -26510,15 +26598,15 @@ def save( stderr: random_stderr_filenameABCDEFG ``` """ -CommandLineToolLoader = _RecordLoader(CommandLineTool, None, None) -SoftwarePackageLoader = _RecordLoader(SoftwarePackage, None, None) -DirentLoader = _RecordLoader(Dirent, None, None) -ExpressionToolOutputParameterLoader = _RecordLoader( +CommandLineToolLoader: Final = _RecordLoader(CommandLineTool, None, None) +SoftwarePackageLoader: Final = _RecordLoader(SoftwarePackage, None, None) +DirentLoader: Final = _RecordLoader(Dirent, None, None) +ExpressionToolOutputParameterLoader: Final = _RecordLoader( ExpressionToolOutputParameter, None, None ) -WorkflowInputParameterLoader = _RecordLoader(WorkflowInputParameter, None, None) -ExpressionToolLoader = _RecordLoader(ExpressionTool, None, None) -LinkMergeMethodLoader = _EnumLoader( +WorkflowInputParameterLoader: Final = _RecordLoader(WorkflowInputParameter, None, None) +ExpressionToolLoader: Final = _RecordLoader(ExpressionTool, None, None) +LinkMergeMethodLoader: Final = _EnumLoader( ( "merge_nested", "merge_flattened", @@ -26528,10 +26616,12 @@ def save( """ The input link merge method, described in [WorkflowStepInput](#WorkflowStepInput). """ -WorkflowOutputParameterLoader = _RecordLoader(WorkflowOutputParameter, None, None) -WorkflowStepInputLoader = _RecordLoader(WorkflowStepInput, None, None) -WorkflowStepOutputLoader = _RecordLoader(WorkflowStepOutput, None, None) -ScatterMethodLoader = _EnumLoader( +WorkflowOutputParameterLoader: Final = _RecordLoader( + WorkflowOutputParameter, None, None +) +WorkflowStepInputLoader: Final = _RecordLoader(WorkflowStepInput, None, None) +WorkflowStepOutputLoader: Final = _RecordLoader(WorkflowStepOutput, None, None) +ScatterMethodLoader: Final = _EnumLoader( ( "dotproduct", "nested_crossproduct", @@ -26542,19 +26632,21 @@ def save( """ The scatter method, as described in [workflow step scatter](#WorkflowStep). """ -WorkflowStepLoader = _RecordLoader(WorkflowStep, None, None) -WorkflowLoader = _RecordLoader(Workflow, None, None) -ProcessGeneratorLoader = _RecordLoader(ProcessGenerator, None, None) -array_of_strtype = _ArrayLoader(strtype) -union_of_None_type_or_strtype_or_array_of_strtype = _UnionLoader( +WorkflowStepLoader: Final = _RecordLoader(WorkflowStep, None, None) +WorkflowLoader: Final = _RecordLoader(Workflow, None, None) +ProcessGeneratorLoader: Final = _RecordLoader(ProcessGenerator, None, None) +array_of_strtype: Final = _ArrayLoader(strtype) +union_of_None_type_or_strtype_or_array_of_strtype: Final = _UnionLoader( ( None_type, strtype, array_of_strtype, ) ) -uri_strtype_True_False_None_None = _URILoader(strtype, True, False, None, None) -union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype = _UnionLoader( +uri_strtype_True_False_None_None: Final = _URILoader(strtype, True, False, None, None) +union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype: ( + Final +) = _UnionLoader( ( PrimitiveTypeLoader, RecordSchemaLoader, @@ -26565,10 +26657,14 @@ def save( strtype, ) ) -array_of_union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype = _ArrayLoader( +array_of_union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype: ( + Final +) = _ArrayLoader( 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( +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: ( + Final +) = _UnionLoader( ( PrimitiveTypeLoader, RecordSchemaLoader, @@ -26580,51 +26676,57 @@ def save( array_of_union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype, ) ) -typedsl_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_2 = _TypeDSLLoader( +typedsl_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_2: ( + Final +) = _TypeDSLLoader( 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, 2, "v1.1", ) -array_of_RecordFieldLoader = _ArrayLoader(RecordFieldLoader) -union_of_None_type_or_array_of_RecordFieldLoader = _UnionLoader( +array_of_RecordFieldLoader: Final = _ArrayLoader(RecordFieldLoader) +union_of_None_type_or_array_of_RecordFieldLoader: Final = _UnionLoader( ( None_type, array_of_RecordFieldLoader, ) ) -idmap_fields_union_of_None_type_or_array_of_RecordFieldLoader = _IdMapLoader( +idmap_fields_union_of_None_type_or_array_of_RecordFieldLoader: Final = _IdMapLoader( union_of_None_type_or_array_of_RecordFieldLoader, "name", "type" ) -Record_nameLoader = _EnumLoader(("record",), "Record_name") -typedsl_Record_nameLoader_2 = _TypeDSLLoader(Record_nameLoader, 2, "v1.1") -union_of_None_type_or_strtype = _UnionLoader( +Record_nameLoader: Final = _EnumLoader(("record",), "Record_name") +typedsl_Record_nameLoader_2: Final = _TypeDSLLoader(Record_nameLoader, 2, "v1.1") +union_of_None_type_or_strtype: Final = _UnionLoader( ( None_type, strtype, ) ) -uri_union_of_None_type_or_strtype_True_False_None_None = _URILoader( +uri_union_of_None_type_or_strtype_True_False_None_None: Final = _URILoader( union_of_None_type_or_strtype, True, False, None, None ) -uri_array_of_strtype_True_False_None_None = _URILoader( +uri_array_of_strtype_True_False_None_None: Final = _URILoader( array_of_strtype, True, False, None, None ) -Enum_nameLoader = _EnumLoader(("enum",), "Enum_name") -typedsl_Enum_nameLoader_2 = _TypeDSLLoader(Enum_nameLoader, 2, "v1.1") -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( +Enum_nameLoader: Final = _EnumLoader(("enum",), "Enum_name") +typedsl_Enum_nameLoader_2: Final = _TypeDSLLoader(Enum_nameLoader, 2, "v1.1") +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: ( + Final +) = _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, True, 2, None, ) -Array_nameLoader = _EnumLoader(("array",), "Array_name") -typedsl_Array_nameLoader_2 = _TypeDSLLoader(Array_nameLoader, 2, "v1.1") -Map_nameLoader = _EnumLoader(("map",), "Map_name") -typedsl_Map_nameLoader_2 = _TypeDSLLoader(Map_nameLoader, 2, "v1.1") -Union_nameLoader = _EnumLoader(("union",), "Union_name") -typedsl_Union_nameLoader_2 = _TypeDSLLoader(Union_nameLoader, 2, "v1.1") -union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype = _UnionLoader( +Array_nameLoader: Final = _EnumLoader(("array",), "Array_name") +typedsl_Array_nameLoader_2: Final = _TypeDSLLoader(Array_nameLoader, 2, "v1.1") +Map_nameLoader: Final = _EnumLoader(("map",), "Map_name") +typedsl_Map_nameLoader_2: Final = _TypeDSLLoader(Map_nameLoader, 2, "v1.1") +Union_nameLoader: Final = _EnumLoader(("union",), "Union_name") +typedsl_Union_nameLoader_2: Final = _TypeDSLLoader(Union_nameLoader, 2, "v1.1") +union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype: ( + Final +) = _UnionLoader( ( PrimitiveTypeLoader, CWLRecordSchemaLoader, @@ -26633,10 +26735,14 @@ def save( strtype, ) ) -array_of_union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype = _ArrayLoader( +array_of_union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype: ( + Final +) = _ArrayLoader( 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( +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: ( + Final +) = _UnionLoader( ( PrimitiveTypeLoader, CWLRecordSchemaLoader, @@ -26646,57 +26752,66 @@ def save( array_of_union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype, ) ) -uri_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_False_True_2_None = _URILoader( +uri_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_False_True_2_None: ( + Final +) = _URILoader( 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, False, True, 2, None, ) -typedsl_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_2 = _TypeDSLLoader( +typedsl_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_2: ( + Final +) = _TypeDSLLoader( 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, 2, "v1.1", ) -array_of_CWLRecordFieldLoader = _ArrayLoader(CWLRecordFieldLoader) -union_of_None_type_or_array_of_CWLRecordFieldLoader = _UnionLoader( +array_of_CWLRecordFieldLoader: Final = _ArrayLoader(CWLRecordFieldLoader) +union_of_None_type_or_array_of_CWLRecordFieldLoader: Final = _UnionLoader( ( None_type, array_of_CWLRecordFieldLoader, ) ) -idmap_fields_union_of_None_type_or_array_of_CWLRecordFieldLoader = _IdMapLoader( +idmap_fields_union_of_None_type_or_array_of_CWLRecordFieldLoader: Final = _IdMapLoader( union_of_None_type_or_array_of_CWLRecordFieldLoader, "name", "type" ) -File_classLoader = _EnumLoader(("File",), "File_class") -uri_File_classLoader_False_True_None_None = _URILoader( +File_classLoader: Final = _EnumLoader(("File",), "File_class") +uri_File_classLoader_False_True_None_None: Final = _URILoader( File_classLoader, False, True, None, None ) -uri_union_of_None_type_or_strtype_False_False_None_None = _URILoader( +uri_union_of_None_type_or_strtype_False_False_None_None: Final = _URILoader( union_of_None_type_or_strtype, False, False, None, None ) -union_of_None_type_or_inttype = _UnionLoader( +union_of_None_type_or_inttype_or_inttype: Final = _UnionLoader( ( None_type, inttype, + inttype, ) ) -union_of_FileLoader_or_DirectoryLoader = _UnionLoader( +union_of_FileLoader_or_DirectoryLoader: Final = _UnionLoader( ( FileLoader, DirectoryLoader, ) ) -array_of_union_of_FileLoader_or_DirectoryLoader = _ArrayLoader( +array_of_union_of_FileLoader_or_DirectoryLoader: Final = _ArrayLoader( union_of_FileLoader_or_DirectoryLoader ) -union_of_None_type_or_array_of_union_of_FileLoader_or_DirectoryLoader = _UnionLoader( - ( - None_type, - array_of_union_of_FileLoader_or_DirectoryLoader, +union_of_None_type_or_array_of_union_of_FileLoader_or_DirectoryLoader: Final = ( + _UnionLoader( + ( + None_type, + array_of_union_of_FileLoader_or_DirectoryLoader, + ) ) ) -secondaryfilesdsl_union_of_None_type_or_array_of_union_of_FileLoader_or_DirectoryLoader = _UnionLoader( +secondaryfilesdsl_union_of_None_type_or_array_of_union_of_FileLoader_or_DirectoryLoader: ( + Final +) = _UnionLoader( ( _SecondaryDSLLoader( union_of_None_type_or_array_of_union_of_FileLoader_or_DirectoryLoader @@ -26704,34 +26819,38 @@ def save( union_of_None_type_or_array_of_union_of_FileLoader_or_DirectoryLoader, ) ) -uri_union_of_None_type_or_strtype_True_False_None_True = _URILoader( +uri_union_of_None_type_or_strtype_True_False_None_True: Final = _URILoader( union_of_None_type_or_strtype, True, False, None, True ) -Directory_classLoader = _EnumLoader(("Directory",), "Directory_class") -uri_Directory_classLoader_False_True_None_None = _URILoader( +Directory_classLoader: Final = _EnumLoader(("Directory",), "Directory_class") +uri_Directory_classLoader_False_True_None_None: Final = _URILoader( Directory_classLoader, False, True, None, None ) -union_of_None_type_or_booltype = _UnionLoader( +union_of_None_type_or_booltype: Final = _UnionLoader( ( None_type, booltype, ) ) -union_of_None_type_or_LoadListingEnumLoader = _UnionLoader( +union_of_None_type_or_LoadListingEnumLoader: Final = _UnionLoader( ( None_type, LoadListingEnumLoader, ) ) -array_of_SecondaryFileSchemaLoader = _ArrayLoader(SecondaryFileSchemaLoader) -union_of_None_type_or_SecondaryFileSchemaLoader_or_array_of_SecondaryFileSchemaLoader = _UnionLoader( +array_of_SecondaryFileSchemaLoader: Final = _ArrayLoader(SecondaryFileSchemaLoader) +union_of_None_type_or_SecondaryFileSchemaLoader_or_array_of_SecondaryFileSchemaLoader: ( + Final +) = _UnionLoader( ( None_type, SecondaryFileSchemaLoader, array_of_SecondaryFileSchemaLoader, ) ) -secondaryfilesdsl_union_of_None_type_or_SecondaryFileSchemaLoader_or_array_of_SecondaryFileSchemaLoader = _UnionLoader( +secondaryfilesdsl_union_of_None_type_or_SecondaryFileSchemaLoader_or_array_of_SecondaryFileSchemaLoader: ( + Final +) = _UnionLoader( ( _SecondaryDSLLoader( union_of_None_type_or_SecondaryFileSchemaLoader_or_array_of_SecondaryFileSchemaLoader @@ -26739,32 +26858,40 @@ def save( union_of_None_type_or_SecondaryFileSchemaLoader_or_array_of_SecondaryFileSchemaLoader, ) ) -union_of_None_type_or_strtype_or_array_of_strtype_or_ExpressionLoader = _UnionLoader( - ( - None_type, - strtype, - array_of_strtype, - ExpressionLoader, +union_of_None_type_or_strtype_or_array_of_strtype_or_ExpressionLoader: Final = ( + _UnionLoader( + ( + None_type, + strtype, + array_of_strtype, + ExpressionLoader, + ) ) ) -uri_union_of_None_type_or_strtype_or_array_of_strtype_or_ExpressionLoader_True_False_None_True = _URILoader( +uri_union_of_None_type_or_strtype_or_array_of_strtype_or_ExpressionLoader_True_False_None_True: ( + Final +) = _URILoader( union_of_None_type_or_strtype_or_array_of_strtype_or_ExpressionLoader, True, False, None, True, ) -union_of_None_type_or_strtype_or_ExpressionLoader = _UnionLoader( +union_of_None_type_or_strtype_or_ExpressionLoader: Final = _UnionLoader( ( None_type, strtype, ExpressionLoader, ) ) -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 +uri_union_of_None_type_or_strtype_or_ExpressionLoader_True_False_None_True: Final = ( + _URILoader( + union_of_None_type_or_strtype_or_ExpressionLoader, True, False, None, True + ) ) -union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype = _UnionLoader( +union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype: ( + Final +) = _UnionLoader( ( CWLTypeLoader, InputRecordSchemaLoader, @@ -26773,10 +26900,14 @@ def save( strtype, ) ) -array_of_union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype = _ArrayLoader( +array_of_union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype: ( + Final +) = _ArrayLoader( 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( +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: ( + Final +) = _UnionLoader( ( CWLTypeLoader, InputRecordSchemaLoader, @@ -26786,29 +26917,35 @@ def save( array_of_union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype, ) ) -typedsl_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_2 = _TypeDSLLoader( +typedsl_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_2: ( + Final +) = _TypeDSLLoader( 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, 2, "v1.1", ) -array_of_InputRecordFieldLoader = _ArrayLoader(InputRecordFieldLoader) -union_of_None_type_or_array_of_InputRecordFieldLoader = _UnionLoader( +array_of_InputRecordFieldLoader: Final = _ArrayLoader(InputRecordFieldLoader) +union_of_None_type_or_array_of_InputRecordFieldLoader: Final = _UnionLoader( ( None_type, array_of_InputRecordFieldLoader, ) ) -idmap_fields_union_of_None_type_or_array_of_InputRecordFieldLoader = _IdMapLoader( - union_of_None_type_or_array_of_InputRecordFieldLoader, "name", "type" +idmap_fields_union_of_None_type_or_array_of_InputRecordFieldLoader: Final = ( + _IdMapLoader(union_of_None_type_or_array_of_InputRecordFieldLoader, "name", "type") ) -uri_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_False_True_2_None = _URILoader( +uri_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_False_True_2_None: ( + Final +) = _URILoader( 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, False, True, 2, None, ) -union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype = _UnionLoader( +union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype: ( + Final +) = _UnionLoader( ( CWLTypeLoader, OutputRecordSchemaLoader, @@ -26817,10 +26954,14 @@ def save( strtype, ) ) -array_of_union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype = _ArrayLoader( +array_of_union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype: ( + Final +) = _ArrayLoader( 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( +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: ( + Final +) = _UnionLoader( ( CWLTypeLoader, OutputRecordSchemaLoader, @@ -26830,69 +26971,89 @@ def save( array_of_union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype, ) ) -typedsl_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_2 = _TypeDSLLoader( +typedsl_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_2: ( + Final +) = _TypeDSLLoader( 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, 2, "v1.1", ) -array_of_OutputRecordFieldLoader = _ArrayLoader(OutputRecordFieldLoader) -union_of_None_type_or_array_of_OutputRecordFieldLoader = _UnionLoader( +array_of_OutputRecordFieldLoader: Final = _ArrayLoader(OutputRecordFieldLoader) +union_of_None_type_or_array_of_OutputRecordFieldLoader: Final = _UnionLoader( ( None_type, array_of_OutputRecordFieldLoader, ) ) -idmap_fields_union_of_None_type_or_array_of_OutputRecordFieldLoader = _IdMapLoader( - union_of_None_type_or_array_of_OutputRecordFieldLoader, "name", "type" +idmap_fields_union_of_None_type_or_array_of_OutputRecordFieldLoader: Final = ( + _IdMapLoader(union_of_None_type_or_array_of_OutputRecordFieldLoader, "name", "type") ) -uri_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_False_True_2_None = _URILoader( +uri_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_False_True_2_None: ( + Final +) = _URILoader( 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, False, True, 2, None, ) -union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader = _UnionLoader( - ( - CommandInputParameterLoader, - WorkflowInputParameterLoader, +union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader: Final = ( + _UnionLoader( + ( + CommandInputParameterLoader, + WorkflowInputParameterLoader, + ) ) ) -array_of_union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader = ( +array_of_union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader: Final = ( _ArrayLoader(union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader) ) -idmap_inputs_array_of_union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader = _IdMapLoader( +idmap_inputs_array_of_union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader: ( + Final +) = _IdMapLoader( array_of_union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader, "id", "type", ) -union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader = _UnionLoader( +union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader: ( + Final +) = _UnionLoader( ( CommandOutputParameterLoader, ExpressionToolOutputParameterLoader, WorkflowOutputParameterLoader, ) ) -array_of_union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader = _ArrayLoader( +array_of_union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader: ( + Final +) = _ArrayLoader( union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader ) -idmap_outputs_array_of_union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader = _IdMapLoader( +idmap_outputs_array_of_union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader: ( + Final +) = _IdMapLoader( array_of_union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader, "id", "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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader = _UnionLoader( +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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader: ( + Final +) = _UnionLoader( ( None_type, 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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader, ) ) -idmap_requirements_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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader = _IdMapLoader( +idmap_requirements_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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader: ( + Final +) = _IdMapLoader( 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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader, "class", "None", ) -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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader_or_Any_type = _UnionLoader( +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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader_or_Any_type: ( + Final +) = _UnionLoader( ( InlineJavascriptRequirementLoader, SchemaDefRequirementLoader, @@ -26918,104 +27079,118 @@ def save( Any_type, ) ) -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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader_or_Any_type = _ArrayLoader( +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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader_or_Any_type: ( + Final +) = _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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader_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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader_or_Any_type = _UnionLoader( +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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader_or_Any_type: ( + Final +) = _UnionLoader( ( None_type, 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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader_or_Any_type, ) ) -idmap_hints_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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader_or_Any_type = _IdMapLoader( +idmap_hints_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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader_or_Any_type: ( + Final +) = _IdMapLoader( 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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_ShmSizeLoader_or_Any_type, "class", "None", ) -union_of_None_type_or_CWLVersionLoader = _UnionLoader( +union_of_None_type_or_CWLVersionLoader: Final = _UnionLoader( ( None_type, CWLVersionLoader, ) ) -uri_union_of_None_type_or_CWLVersionLoader_False_True_None_None = _URILoader( +uri_union_of_None_type_or_CWLVersionLoader_False_True_None_None: Final = _URILoader( union_of_None_type_or_CWLVersionLoader, False, True, None, None ) -InlineJavascriptRequirement_classLoader = _EnumLoader( +InlineJavascriptRequirement_classLoader: Final = _EnumLoader( ("InlineJavascriptRequirement",), "InlineJavascriptRequirement_class" ) -uri_InlineJavascriptRequirement_classLoader_False_True_None_None = _URILoader( +uri_InlineJavascriptRequirement_classLoader_False_True_None_None: Final = _URILoader( InlineJavascriptRequirement_classLoader, False, True, None, None ) -union_of_None_type_or_array_of_strtype = _UnionLoader( +union_of_None_type_or_array_of_strtype: Final = _UnionLoader( ( None_type, array_of_strtype, ) ) -SchemaDefRequirement_classLoader = _EnumLoader( +SchemaDefRequirement_classLoader: Final = _EnumLoader( ("SchemaDefRequirement",), "SchemaDefRequirement_class" ) -uri_SchemaDefRequirement_classLoader_False_True_None_None = _URILoader( +uri_SchemaDefRequirement_classLoader_False_True_None_None: Final = _URILoader( SchemaDefRequirement_classLoader, False, True, None, None ) -union_of_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader = _UnionLoader( +union_of_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader: ( + Final +) = _UnionLoader( ( CommandInputRecordSchemaLoader, CommandInputEnumSchemaLoader, CommandInputArraySchemaLoader, ) ) -array_of_union_of_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader = _ArrayLoader( +array_of_union_of_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader: ( + Final +) = _ArrayLoader( union_of_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader ) -union_of_strtype_or_ExpressionLoader = _UnionLoader( +union_of_strtype_or_ExpressionLoader: Final = _UnionLoader( ( strtype, ExpressionLoader, ) ) -union_of_None_type_or_booltype_or_ExpressionLoader = _UnionLoader( +union_of_None_type_or_booltype_or_ExpressionLoader: Final = _UnionLoader( ( None_type, booltype, ExpressionLoader, ) ) -LoadListingRequirement_classLoader = _EnumLoader( +LoadListingRequirement_classLoader: Final = _EnumLoader( ("LoadListingRequirement",), "LoadListingRequirement_class" ) -uri_LoadListingRequirement_classLoader_False_True_None_None = _URILoader( +uri_LoadListingRequirement_classLoader_False_True_None_None: Final = _URILoader( LoadListingRequirement_classLoader, False, True, None, None ) -union_of_None_type_or_inttype_or_ExpressionLoader = _UnionLoader( +union_of_None_type_or_inttype_or_ExpressionLoader: Final = _UnionLoader( ( None_type, inttype, ExpressionLoader, ) ) -union_of_None_type_or_strtype_or_ExpressionLoader_or_array_of_strtype = _UnionLoader( - ( - None_type, - strtype, - ExpressionLoader, - array_of_strtype, +union_of_None_type_or_strtype_or_ExpressionLoader_or_array_of_strtype: Final = ( + _UnionLoader( + ( + None_type, + strtype, + ExpressionLoader, + array_of_strtype, + ) ) ) -union_of_None_type_or_ExpressionLoader = _UnionLoader( +union_of_None_type_or_ExpressionLoader: Final = _UnionLoader( ( None_type, ExpressionLoader, ) ) -union_of_None_type_or_CommandLineBindingLoader = _UnionLoader( +union_of_None_type_or_CommandLineBindingLoader: Final = _UnionLoader( ( None_type, CommandLineBindingLoader, ) ) -union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype = _UnionLoader( +union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype: ( + Final +) = _UnionLoader( ( CWLTypeLoader, CommandInputRecordSchemaLoader, @@ -27024,10 +27199,14 @@ def save( strtype, ) ) -array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype = _ArrayLoader( +array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype: ( + Final +) = _ArrayLoader( 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( +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: ( + Final +) = _UnionLoader( ( CWLTypeLoader, CommandInputRecordSchemaLoader, @@ -27037,31 +27216,39 @@ def save( array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype, ) ) -typedsl_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_2 = _TypeDSLLoader( +typedsl_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_2: ( + Final +) = _TypeDSLLoader( 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, 2, "v1.1", ) -array_of_CommandInputRecordFieldLoader = _ArrayLoader(CommandInputRecordFieldLoader) -union_of_None_type_or_array_of_CommandInputRecordFieldLoader = _UnionLoader( +array_of_CommandInputRecordFieldLoader: Final = _ArrayLoader( + CommandInputRecordFieldLoader +) +union_of_None_type_or_array_of_CommandInputRecordFieldLoader: Final = _UnionLoader( ( None_type, array_of_CommandInputRecordFieldLoader, ) ) -idmap_fields_union_of_None_type_or_array_of_CommandInputRecordFieldLoader = ( +idmap_fields_union_of_None_type_or_array_of_CommandInputRecordFieldLoader: Final = ( _IdMapLoader( union_of_None_type_or_array_of_CommandInputRecordFieldLoader, "name", "type" ) ) -uri_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_False_True_2_None = _URILoader( +uri_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_False_True_2_None: ( + Final +) = _URILoader( 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, False, True, 2, None, ) -union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype = _UnionLoader( +union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype: ( + Final +) = _UnionLoader( ( CWLTypeLoader, CommandOutputRecordSchemaLoader, @@ -27070,10 +27257,14 @@ def save( strtype, ) ) -array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype = _ArrayLoader( +array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype: ( + Final +) = _ArrayLoader( 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( +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: ( + Final +) = _UnionLoader( ( CWLTypeLoader, CommandOutputRecordSchemaLoader, @@ -27083,37 +27274,45 @@ def save( array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype, ) ) -typedsl_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_2 = _TypeDSLLoader( +typedsl_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_2: ( + Final +) = _TypeDSLLoader( 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, 2, "v1.1", ) -union_of_None_type_or_CommandOutputBindingLoader = _UnionLoader( +union_of_None_type_or_CommandOutputBindingLoader: Final = _UnionLoader( ( None_type, CommandOutputBindingLoader, ) ) -array_of_CommandOutputRecordFieldLoader = _ArrayLoader(CommandOutputRecordFieldLoader) -union_of_None_type_or_array_of_CommandOutputRecordFieldLoader = _UnionLoader( +array_of_CommandOutputRecordFieldLoader: Final = _ArrayLoader( + CommandOutputRecordFieldLoader +) +union_of_None_type_or_array_of_CommandOutputRecordFieldLoader: Final = _UnionLoader( ( None_type, array_of_CommandOutputRecordFieldLoader, ) ) -idmap_fields_union_of_None_type_or_array_of_CommandOutputRecordFieldLoader = ( +idmap_fields_union_of_None_type_or_array_of_CommandOutputRecordFieldLoader: Final = ( _IdMapLoader( union_of_None_type_or_array_of_CommandOutputRecordFieldLoader, "name", "type" ) ) -uri_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_False_True_2_None = _URILoader( +uri_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_False_True_2_None: ( + Final +) = _URILoader( 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, False, True, 2, None, ) -union_of_CWLTypeLoader_or_stdinLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype = _UnionLoader( +union_of_CWLTypeLoader_or_stdinLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype: ( + Final +) = _UnionLoader( ( CWLTypeLoader, stdinLoader, @@ -27124,12 +27323,16 @@ def save( array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype, ) ) -typedsl_union_of_CWLTypeLoader_or_stdinLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype_2 = _TypeDSLLoader( +typedsl_union_of_CWLTypeLoader_or_stdinLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype_2: ( + Final +) = _TypeDSLLoader( union_of_CWLTypeLoader_or_stdinLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype, 2, "v1.1", ) -union_of_CWLTypeLoader_or_stdoutLoader_or_stderrLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype = _UnionLoader( +union_of_CWLTypeLoader_or_stdoutLoader_or_stderrLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype: ( + Final +) = _UnionLoader( ( CWLTypeLoader, stdoutLoader, @@ -27141,72 +27344,82 @@ def save( array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype, ) ) -typedsl_union_of_CWLTypeLoader_or_stdoutLoader_or_stderrLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype_2 = _TypeDSLLoader( +typedsl_union_of_CWLTypeLoader_or_stdoutLoader_or_stderrLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype_2: ( + Final +) = _TypeDSLLoader( union_of_CWLTypeLoader_or_stdoutLoader_or_stderrLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype, 2, "v1.1", ) -CommandLineTool_classLoader = _EnumLoader(("CommandLineTool",), "CommandLineTool_class") -uri_CommandLineTool_classLoader_False_True_None_None = _URILoader( +CommandLineTool_classLoader: Final = _EnumLoader( + ("CommandLineTool",), "CommandLineTool_class" +) +uri_CommandLineTool_classLoader_False_True_None_None: Final = _URILoader( CommandLineTool_classLoader, False, True, None, None ) -array_of_CommandInputParameterLoader = _ArrayLoader(CommandInputParameterLoader) -idmap_inputs_array_of_CommandInputParameterLoader = _IdMapLoader( +array_of_CommandInputParameterLoader: Final = _ArrayLoader(CommandInputParameterLoader) +idmap_inputs_array_of_CommandInputParameterLoader: Final = _IdMapLoader( array_of_CommandInputParameterLoader, "id", "type" ) -array_of_CommandOutputParameterLoader = _ArrayLoader(CommandOutputParameterLoader) -idmap_outputs_array_of_CommandOutputParameterLoader = _IdMapLoader( +array_of_CommandOutputParameterLoader: Final = _ArrayLoader( + CommandOutputParameterLoader +) +idmap_outputs_array_of_CommandOutputParameterLoader: Final = _IdMapLoader( array_of_CommandOutputParameterLoader, "id", "type" ) -union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader = _UnionLoader( +union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader: Final = _UnionLoader( ( strtype, ExpressionLoader, CommandLineBindingLoader, ) ) -array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader = ( +array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader: Final = ( _ArrayLoader(union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader) ) -union_of_None_type_or_array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader = _UnionLoader( +union_of_None_type_or_array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader: ( + Final +) = _UnionLoader( ( None_type, array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader, ) ) -array_of_inttype = _ArrayLoader(inttype) -union_of_None_type_or_array_of_inttype = _UnionLoader( +array_of_inttype: Final = _ArrayLoader(inttype) +union_of_None_type_or_array_of_inttype: Final = _UnionLoader( ( None_type, array_of_inttype, ) ) -DockerRequirement_classLoader = _EnumLoader( +DockerRequirement_classLoader: Final = _EnumLoader( ("DockerRequirement",), "DockerRequirement_class" ) -uri_DockerRequirement_classLoader_False_True_None_None = _URILoader( +uri_DockerRequirement_classLoader_False_True_None_None: Final = _URILoader( DockerRequirement_classLoader, False, True, None, None ) -SoftwareRequirement_classLoader = _EnumLoader( +SoftwareRequirement_classLoader: Final = _EnumLoader( ("SoftwareRequirement",), "SoftwareRequirement_class" ) -uri_SoftwareRequirement_classLoader_False_True_None_None = _URILoader( +uri_SoftwareRequirement_classLoader_False_True_None_None: Final = _URILoader( SoftwareRequirement_classLoader, False, True, None, None ) -array_of_SoftwarePackageLoader = _ArrayLoader(SoftwarePackageLoader) -idmap_packages_array_of_SoftwarePackageLoader = _IdMapLoader( +array_of_SoftwarePackageLoader: Final = _ArrayLoader(SoftwarePackageLoader) +idmap_packages_array_of_SoftwarePackageLoader: Final = _IdMapLoader( array_of_SoftwarePackageLoader, "package", "specs" ) -uri_union_of_None_type_or_array_of_strtype_False_False_None_True = _URILoader( +uri_union_of_None_type_or_array_of_strtype_False_False_None_True: Final = _URILoader( union_of_None_type_or_array_of_strtype, False, False, None, True ) -InitialWorkDirRequirement_classLoader = _EnumLoader( +InitialWorkDirRequirement_classLoader: Final = _EnumLoader( ("InitialWorkDirRequirement",), "InitialWorkDirRequirement_class" ) -uri_InitialWorkDirRequirement_classLoader_False_True_None_None = _URILoader( +uri_InitialWorkDirRequirement_classLoader_False_True_None_None: Final = _URILoader( InitialWorkDirRequirement_classLoader, False, True, None, None ) -union_of_None_type_or_FileLoader_or_array_of_union_of_FileLoader_or_DirectoryLoader_or_DirectoryLoader_or_DirentLoader_or_ExpressionLoader = _UnionLoader( +union_of_None_type_or_FileLoader_or_array_of_union_of_FileLoader_or_DirectoryLoader_or_DirectoryLoader_or_DirentLoader_or_ExpressionLoader: ( + Final +) = _UnionLoader( ( None_type, FileLoader, @@ -27216,133 +27429,158 @@ def save( ExpressionLoader, ) ) -array_of_union_of_None_type_or_FileLoader_or_array_of_union_of_FileLoader_or_DirectoryLoader_or_DirectoryLoader_or_DirentLoader_or_ExpressionLoader = _ArrayLoader( +array_of_union_of_None_type_or_FileLoader_or_array_of_union_of_FileLoader_or_DirectoryLoader_or_DirectoryLoader_or_DirentLoader_or_ExpressionLoader: ( + Final +) = _ArrayLoader( 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( +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: ( + Final +) = _UnionLoader( ( array_of_union_of_None_type_or_FileLoader_or_array_of_union_of_FileLoader_or_DirectoryLoader_or_DirectoryLoader_or_DirentLoader_or_ExpressionLoader, ExpressionLoader, ) ) -EnvVarRequirement_classLoader = _EnumLoader( +EnvVarRequirement_classLoader: Final = _EnumLoader( ("EnvVarRequirement",), "EnvVarRequirement_class" ) -uri_EnvVarRequirement_classLoader_False_True_None_None = _URILoader( +uri_EnvVarRequirement_classLoader_False_True_None_None: Final = _URILoader( EnvVarRequirement_classLoader, False, True, None, None ) -array_of_EnvironmentDefLoader = _ArrayLoader(EnvironmentDefLoader) -idmap_envDef_array_of_EnvironmentDefLoader = _IdMapLoader( +array_of_EnvironmentDefLoader: Final = _ArrayLoader(EnvironmentDefLoader) +idmap_envDef_array_of_EnvironmentDefLoader: Final = _IdMapLoader( array_of_EnvironmentDefLoader, "envName", "envValue" ) -ShellCommandRequirement_classLoader = _EnumLoader( +ShellCommandRequirement_classLoader: Final = _EnumLoader( ("ShellCommandRequirement",), "ShellCommandRequirement_class" ) -uri_ShellCommandRequirement_classLoader_False_True_None_None = _URILoader( +uri_ShellCommandRequirement_classLoader_False_True_None_None: Final = _URILoader( ShellCommandRequirement_classLoader, False, True, None, None ) -ResourceRequirement_classLoader = _EnumLoader( +ResourceRequirement_classLoader: Final = _EnumLoader( ("ResourceRequirement",), "ResourceRequirement_class" ) -uri_ResourceRequirement_classLoader_False_True_None_None = _URILoader( +uri_ResourceRequirement_classLoader_False_True_None_None: Final = _URILoader( ResourceRequirement_classLoader, False, True, None, None ) -WorkReuse_classLoader = _EnumLoader(("WorkReuse",), "WorkReuse_class") -uri_WorkReuse_classLoader_False_True_None_None = _URILoader( +union_of_None_type_or_inttype_or_inttype_or_ExpressionLoader: Final = _UnionLoader( + ( + None_type, + inttype, + inttype, + ExpressionLoader, + ) +) +WorkReuse_classLoader: Final = _EnumLoader(("WorkReuse",), "WorkReuse_class") +uri_WorkReuse_classLoader_False_True_None_None: Final = _URILoader( WorkReuse_classLoader, False, True, None, None ) -union_of_booltype_or_ExpressionLoader = _UnionLoader( +union_of_booltype_or_ExpressionLoader: Final = _UnionLoader( ( booltype, ExpressionLoader, ) ) -NetworkAccess_classLoader = _EnumLoader(("NetworkAccess",), "NetworkAccess_class") -uri_NetworkAccess_classLoader_False_True_None_None = _URILoader( +NetworkAccess_classLoader: Final = _EnumLoader( + ("NetworkAccess",), "NetworkAccess_class" +) +uri_NetworkAccess_classLoader_False_True_None_None: Final = _URILoader( NetworkAccess_classLoader, False, True, None, None ) -InplaceUpdateRequirement_classLoader = _EnumLoader( +InplaceUpdateRequirement_classLoader: Final = _EnumLoader( ("InplaceUpdateRequirement",), "InplaceUpdateRequirement_class" ) -uri_InplaceUpdateRequirement_classLoader_False_True_None_None = _URILoader( +uri_InplaceUpdateRequirement_classLoader_False_True_None_None: Final = _URILoader( InplaceUpdateRequirement_classLoader, False, True, None, None ) -ToolTimeLimit_classLoader = _EnumLoader(("ToolTimeLimit",), "ToolTimeLimit_class") -uri_ToolTimeLimit_classLoader_False_True_None_None = _URILoader( +ToolTimeLimit_classLoader: Final = _EnumLoader( + ("ToolTimeLimit",), "ToolTimeLimit_class" +) +uri_ToolTimeLimit_classLoader_False_True_None_None: Final = _URILoader( ToolTimeLimit_classLoader, False, True, None, None ) -union_of_inttype_or_ExpressionLoader = _UnionLoader( +union_of_inttype_or_inttype_or_ExpressionLoader: Final = _UnionLoader( ( + inttype, inttype, ExpressionLoader, ) ) -union_of_None_type_or_InputBindingLoader = _UnionLoader( +union_of_None_type_or_InputBindingLoader: Final = _UnionLoader( ( None_type, InputBindingLoader, ) ) -ExpressionTool_classLoader = _EnumLoader(("ExpressionTool",), "ExpressionTool_class") -uri_ExpressionTool_classLoader_False_True_None_None = _URILoader( +ExpressionTool_classLoader: Final = _EnumLoader( + ("ExpressionTool",), "ExpressionTool_class" +) +uri_ExpressionTool_classLoader_False_True_None_None: Final = _URILoader( ExpressionTool_classLoader, False, True, None, None ) -array_of_WorkflowInputParameterLoader = _ArrayLoader(WorkflowInputParameterLoader) -idmap_inputs_array_of_WorkflowInputParameterLoader = _IdMapLoader( +array_of_WorkflowInputParameterLoader: Final = _ArrayLoader( + WorkflowInputParameterLoader +) +idmap_inputs_array_of_WorkflowInputParameterLoader: Final = _IdMapLoader( array_of_WorkflowInputParameterLoader, "id", "type" ) -array_of_ExpressionToolOutputParameterLoader = _ArrayLoader( +array_of_ExpressionToolOutputParameterLoader: Final = _ArrayLoader( ExpressionToolOutputParameterLoader ) -idmap_outputs_array_of_ExpressionToolOutputParameterLoader = _IdMapLoader( +idmap_outputs_array_of_ExpressionToolOutputParameterLoader: Final = _IdMapLoader( array_of_ExpressionToolOutputParameterLoader, "id", "type" ) -uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_1_None = _URILoader( - union_of_None_type_or_strtype_or_array_of_strtype, False, False, 1, None +uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_1_None: Final = ( + _URILoader(union_of_None_type_or_strtype_or_array_of_strtype, False, False, 1, None) ) -union_of_None_type_or_LinkMergeMethodLoader = _UnionLoader( +union_of_None_type_or_LinkMergeMethodLoader: Final = _UnionLoader( ( None_type, LinkMergeMethodLoader, ) ) -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 +uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_2_None: Final = ( + _URILoader(union_of_None_type_or_strtype_or_array_of_strtype, False, False, 2, None) ) -array_of_WorkflowStepInputLoader = _ArrayLoader(WorkflowStepInputLoader) -idmap_in__array_of_WorkflowStepInputLoader = _IdMapLoader( +array_of_WorkflowStepInputLoader: Final = _ArrayLoader(WorkflowStepInputLoader) +idmap_in__array_of_WorkflowStepInputLoader: Final = _IdMapLoader( array_of_WorkflowStepInputLoader, "id", "source" ) -union_of_strtype_or_WorkflowStepOutputLoader = _UnionLoader( +union_of_strtype_or_WorkflowStepOutputLoader: Final = _UnionLoader( ( strtype, WorkflowStepOutputLoader, ) ) -array_of_union_of_strtype_or_WorkflowStepOutputLoader = _ArrayLoader( +array_of_union_of_strtype_or_WorkflowStepOutputLoader: Final = _ArrayLoader( union_of_strtype_or_WorkflowStepOutputLoader ) -union_of_array_of_union_of_strtype_or_WorkflowStepOutputLoader = _UnionLoader( +union_of_array_of_union_of_strtype_or_WorkflowStepOutputLoader: Final = _UnionLoader( (array_of_union_of_strtype_or_WorkflowStepOutputLoader,) ) -uri_union_of_array_of_union_of_strtype_or_WorkflowStepOutputLoader_True_False_None_None = _URILoader( +uri_union_of_array_of_union_of_strtype_or_WorkflowStepOutputLoader_True_False_None_None: ( + Final +) = _URILoader( union_of_array_of_union_of_strtype_or_WorkflowStepOutputLoader, True, False, None, None, ) -array_of_Any_type = _ArrayLoader(Any_type) -union_of_None_type_or_array_of_Any_type = _UnionLoader( +array_of_Any_type: Final = _ArrayLoader(Any_type) +union_of_None_type_or_array_of_Any_type: Final = _UnionLoader( ( None_type, array_of_Any_type, ) ) -idmap_hints_union_of_None_type_or_array_of_Any_type = _IdMapLoader( +idmap_hints_union_of_None_type_or_array_of_Any_type: Final = _IdMapLoader( union_of_None_type_or_array_of_Any_type, "class", "None" ) -union_of_strtype_or_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader = _UnionLoader( +union_of_strtype_or_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader: ( + Final +) = _UnionLoader( ( strtype, CommandLineToolLoader, @@ -27351,73 +27589,87 @@ def save( ProcessGeneratorLoader, ) ) -uri_union_of_strtype_or_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader_False_False_None_None = _URILoader( +uri_union_of_strtype_or_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader_False_False_None_None: ( + Final +) = _URILoader( union_of_strtype_or_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader, False, False, None, None, ) -uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_0_None = _URILoader( - union_of_None_type_or_strtype_or_array_of_strtype, False, False, 0, None +uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_0_None: Final = ( + _URILoader(union_of_None_type_or_strtype_or_array_of_strtype, False, False, 0, None) ) -union_of_None_type_or_ScatterMethodLoader = _UnionLoader( +union_of_None_type_or_ScatterMethodLoader: Final = _UnionLoader( ( None_type, ScatterMethodLoader, ) ) -uri_union_of_None_type_or_ScatterMethodLoader_False_True_None_None = _URILoader( +uri_union_of_None_type_or_ScatterMethodLoader_False_True_None_None: Final = _URILoader( union_of_None_type_or_ScatterMethodLoader, False, True, None, None ) -Workflow_classLoader = _EnumLoader(("Workflow",), "Workflow_class") -uri_Workflow_classLoader_False_True_None_None = _URILoader( +Workflow_classLoader: Final = _EnumLoader(("Workflow",), "Workflow_class") +uri_Workflow_classLoader_False_True_None_None: Final = _URILoader( Workflow_classLoader, False, True, None, None ) -array_of_WorkflowOutputParameterLoader = _ArrayLoader(WorkflowOutputParameterLoader) -idmap_outputs_array_of_WorkflowOutputParameterLoader = _IdMapLoader( +array_of_WorkflowOutputParameterLoader: Final = _ArrayLoader( + WorkflowOutputParameterLoader +) +idmap_outputs_array_of_WorkflowOutputParameterLoader: Final = _IdMapLoader( array_of_WorkflowOutputParameterLoader, "id", "type" ) -array_of_WorkflowStepLoader = _ArrayLoader(WorkflowStepLoader) -union_of_array_of_WorkflowStepLoader = _UnionLoader((array_of_WorkflowStepLoader,)) -idmap_steps_union_of_array_of_WorkflowStepLoader = _IdMapLoader( +array_of_WorkflowStepLoader: Final = _ArrayLoader(WorkflowStepLoader) +union_of_array_of_WorkflowStepLoader: Final = _UnionLoader( + (array_of_WorkflowStepLoader,) +) +idmap_steps_union_of_array_of_WorkflowStepLoader: Final = _IdMapLoader( union_of_array_of_WorkflowStepLoader, "id", "None" ) -SubworkflowFeatureRequirement_classLoader = _EnumLoader( +SubworkflowFeatureRequirement_classLoader: Final = _EnumLoader( ("SubworkflowFeatureRequirement",), "SubworkflowFeatureRequirement_class" ) -uri_SubworkflowFeatureRequirement_classLoader_False_True_None_None = _URILoader( +uri_SubworkflowFeatureRequirement_classLoader_False_True_None_None: Final = _URILoader( SubworkflowFeatureRequirement_classLoader, False, True, None, None ) -ScatterFeatureRequirement_classLoader = _EnumLoader( +ScatterFeatureRequirement_classLoader: Final = _EnumLoader( ("ScatterFeatureRequirement",), "ScatterFeatureRequirement_class" ) -uri_ScatterFeatureRequirement_classLoader_False_True_None_None = _URILoader( +uri_ScatterFeatureRequirement_classLoader_False_True_None_None: Final = _URILoader( ScatterFeatureRequirement_classLoader, False, True, None, None ) -MultipleInputFeatureRequirement_classLoader = _EnumLoader( +MultipleInputFeatureRequirement_classLoader: Final = _EnumLoader( ("MultipleInputFeatureRequirement",), "MultipleInputFeatureRequirement_class" ) -uri_MultipleInputFeatureRequirement_classLoader_False_True_None_None = _URILoader( - MultipleInputFeatureRequirement_classLoader, False, True, None, None +uri_MultipleInputFeatureRequirement_classLoader_False_True_None_None: Final = ( + _URILoader(MultipleInputFeatureRequirement_classLoader, False, True, None, None) ) -StepInputExpressionRequirement_classLoader = _EnumLoader( +StepInputExpressionRequirement_classLoader: Final = _EnumLoader( ("StepInputExpressionRequirement",), "StepInputExpressionRequirement_class" ) -uri_StepInputExpressionRequirement_classLoader_False_True_None_None = _URILoader( +uri_StepInputExpressionRequirement_classLoader_False_True_None_None: Final = _URILoader( StepInputExpressionRequirement_classLoader, False, True, None, None ) -uri_strtype_False_True_None_None = _URILoader(strtype, False, True, None, None) -uri_array_of_strtype_False_False_0_None = _URILoader( +uri_strtype_False_True_None_None: Final = _URILoader(strtype, False, True, None, None) +uri_array_of_strtype_False_False_0_None: Final = _URILoader( array_of_strtype, False, False, 0, None ) -union_of_strtype_or_array_of_strtype = _UnionLoader( +union_of_inttype_or_ExpressionLoader: Final = _UnionLoader( + ( + inttype, + ExpressionLoader, + ) +) +union_of_strtype_or_array_of_strtype: Final = _UnionLoader( ( strtype, array_of_strtype, ) ) -union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader = _UnionLoader( +union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader: ( + Final +) = _UnionLoader( ( CommandLineToolLoader, ExpressionToolLoader, @@ -27425,10 +27677,14 @@ def save( ProcessGeneratorLoader, ) ) -array_of_union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader = _ArrayLoader( +array_of_union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader: ( + Final +) = _ArrayLoader( union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader ) -union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader_or_array_of_union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader = _UnionLoader( +union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader_or_array_of_union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader: ( + Final +) = _UnionLoader( ( CommandLineToolLoader, ExpressionToolLoader, @@ -27442,6 +27698,7 @@ def save( ( booltype, inttype, + longtype, floattype, strtype, FileLoader, @@ -27450,12 +27707,15 @@ def save( map_of_union_of_None_type_or_CWLObjectTypeLoader, ) ) +CWLObjectType: TypeAlias = ( + "Directory | File | Mapping[str, CWLObjectType | None] | Sequence[CWLObjectType | None] | bool | float | i32 | i64 | str" +) def load_document( doc: Any, - baseuri: Optional[str] = None, - loadingOptions: Optional[LoadingOptions] = None, + baseuri: str | None = None, + loadingOptions: LoadingOptions | None = None, ) -> Any: if baseuri is None: baseuri = file_uri(os.getcwd()) + "/" @@ -27472,9 +27732,9 @@ def load_document( def load_document_with_metadata( doc: Any, - baseuri: Optional[str] = None, - loadingOptions: Optional[LoadingOptions] = None, - addl_metadata_fields: Optional[MutableSequence[str]] = None, + baseuri: str | None = None, + loadingOptions: LoadingOptions | None = None, + addl_metadata_fields: MutableSequence[str] | None = None, ) -> Any: if baseuri is None: baseuri = file_uri(os.getcwd()) + "/" @@ -27492,7 +27752,7 @@ def load_document_with_metadata( def load_document_by_string( string: Any, uri: str, - loadingOptions: Optional[LoadingOptions] = None, + loadingOptions: LoadingOptions | None = None, ) -> Any: yaml = yaml_no_ts() result = yaml.load(string) @@ -27513,7 +27773,7 @@ def load_document_by_string( def load_document_by_yaml( yaml: Any, uri: str, - loadingOptions: Optional[LoadingOptions] = None, + loadingOptions: LoadingOptions | None = None, ) -> Any: """ Shortcut to load via a YAML object. diff --git a/cwl_utils/parser/cwl_v1_1_utils.py b/cwl_utils/parser/cwl_v1_1_utils.py index 79ce337b..eaa21dc5 100644 --- a/cwl_utils/parser/cwl_v1_1_utils.py +++ b/cwl_utils/parser/cwl_v1_1_utils.py @@ -2,10 +2,10 @@ import hashlib import logging from collections import namedtuple -from collections.abc import MutableMapping, MutableSequence +from collections.abc import MutableMapping, MutableSequence, Sequence from io import StringIO from pathlib import Path -from typing import Any, IO, cast +from typing import IO, Any, Literal, TypeAlias, TypeVar, cast from urllib.parse import urldefrag from schema_salad.exceptions import ValidationException @@ -16,6 +16,7 @@ import cwl_utils.parser.cwl_v1_1 as cwl import cwl_utils.parser.utils from cwl_utils.errors import WorkflowException +from cwl_utils.types import is_sequence from cwl_utils.utils import yaml_dumps CONTENT_LIMIT: int = 64 * 1024 @@ -24,6 +25,142 @@ SrcSink = namedtuple("SrcSink", ["src", "sink", "linkMerge", "message"]) +BasicInputTypeSchemas: TypeAlias = ( + cwl.InputArraySchema + | cwl.InputEnumSchema + | cwl.InputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] +) +InputTypeSchemas: TypeAlias = ( + BasicInputTypeSchemas | Literal["stdin"] | Sequence[BasicInputTypeSchemas] +) +BasicCommandInputTypeSchemas: TypeAlias = ( + cwl.CommandInputArraySchema + | cwl.CommandInputEnumSchema + | cwl.CommandInputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] +) +CommandInputTypeSchemas: TypeAlias = ( + BasicCommandInputTypeSchemas + | Literal["stdin"] + | Sequence[BasicCommandInputTypeSchemas] +) +BasicOutputTypeSchemas: TypeAlias = ( + cwl.OutputArraySchema + | cwl.OutputEnumSchema + | cwl.OutputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] +) +OutputTypeSchemas: TypeAlias = ( + BasicOutputTypeSchemas + | Literal["stderr", "stdout"] + | Sequence[BasicOutputTypeSchemas] +) +BasicCommandOutputTypeSchemas: TypeAlias = ( + cwl.CommandOutputArraySchema + | cwl.CommandOutputEnumSchema + | cwl.CommandOutputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] +) +CommandOutputTypeSchemas: TypeAlias = ( + BasicCommandOutputTypeSchemas + | Literal["stderr", "stdout"] + | Sequence[BasicCommandOutputTypeSchemas] +) +AnyTypeSchema = TypeVar( + "AnyTypeSchema", bound=InputTypeSchemas | CommandOutputTypeSchemas +) + + +def _in_output_type_schema_to_output_type_schema( + schema_type: BasicInputTypeSchemas | BasicOutputTypeSchemas, + loading_options: cwl.LoadingOptions, +) -> BasicOutputTypeSchemas: + match schema_type: + case cwl.ArraySchema(): + return cwl.OutputArraySchema.fromDoc( + schema_type.save(), + loading_options.baseuri, + loading_options, + ) + case cwl.EnumSchema(): + return cwl.OutputEnumSchema.fromDoc( + schema_type.save(), + loading_options.baseuri, + loading_options, + ) + case cwl.RecordSchema(): + return cwl.OutputRecordSchema.fromDoc( + schema_type.save(), + loading_options.baseuri, + loading_options, + ) + case str(): + return schema_type + raise WorkflowException(f"Unexpected output type: {schema_type}.") + + +def in_output_type_schema_to_output_type_schema( + schema_type: ( + BasicInputTypeSchemas + | BasicOutputTypeSchemas + | Sequence[BasicInputTypeSchemas | BasicOutputTypeSchemas] + ), + loading_options: cwl.LoadingOptions, +) -> OutputTypeSchemas: + if is_sequence(schema_type): + return [ + _in_output_type_schema_to_output_type_schema( + schema_type_item, loading_options + ) + for schema_type_item in schema_type + ] + return _in_output_type_schema_to_output_type_schema(schema_type, loading_options) + def _compare_records( src: cwl.RecordSchema, sink: cwl.RecordSchema, strict: bool = False @@ -181,7 +318,7 @@ def can_assign_src_to_sink(src: Any, sink: Any, strict: bool = False) -> bool: def check_all_types( src_dict: dict[str, Any], - sinks: MutableSequence[cwl.WorkflowStepInput | cwl.WorkflowOutputParameter], + sinks: Sequence[cwl.WorkflowStepInput | cwl.WorkflowOutputParameter], type_dict: dict[str, Any], ) -> dict[str, list[SrcSink]]: """Given a list of sinks, check if their types match with the types of their sources.""" @@ -195,23 +332,23 @@ def check_all_types( sourceName = "source" sourceField = sink.source case _: - continue + raise WorkflowException(f"Invalid sink type {sink.__class__.__name__}") if sourceField is not None: - if isinstance(sourceField, MutableSequence): - linkMerge = sink.linkMerge or ( - "merge_nested" if len(sourceField) > 1 else None - ) - srcs_of_sink = [] - for parm_id in sourceField: - srcs_of_sink += [src_dict[parm_id]] - else: - parm_id = cast(str, sourceField) + if isinstance(sourceField, str): + parm_id = sourceField if parm_id not in src_dict: raise SourceLine(sink, sourceName, ValidationException).makeError( f"{sourceName} not found: {parm_id}" ) srcs_of_sink = [src_dict[parm_id]] linkMerge = None + else: + linkMerge = sink.linkMerge or ( + "merge_nested" if len(sourceField) > 1 else None + ) + srcs_of_sink = [] + for parm_id in sourceField: + srcs_of_sink += [src_dict[parm_id]] for src in srcs_of_sink: check_result = check_types( type_dict[cast(str, src.id)], @@ -307,8 +444,7 @@ def convert_stdstreams_to_files(clt: cwl.CommandLineTool) -> None: ) else: clt.stdin = ( - "$(inputs.%s.path)" - % cast(str, inp.id).rpartition("#")[2].split("/")[-1] + "$(inputs.%s.path)" % inp.id.rpartition("#")[2].split("/")[-1] ) inp.type_ = "File" @@ -380,48 +516,62 @@ def merge_flatten_type(src: Any) -> Any: return cwl.ArraySchema(type_="array", items=src) +def to_input_array(type_: InputTypeSchemas) -> cwl.InputArraySchema: + return cwl.InputArraySchema(type_="array", items=type_) + + +def to_output_array(type_: OutputTypeSchemas) -> cwl.OutputArraySchema: + return cwl.OutputArraySchema(type_="array", items=type_) + + def type_for_step_input( step: cwl.WorkflowStep, in_: cwl.WorkflowStepInput, -) -> Any: +) -> cwl_utils.parser.utils.InputTypeSchemas | None: """Determine the type for the given step input.""" if in_.valueFrom is not None: return "Any" step_run = cwl_utils.parser.utils.load_step(step) cwl_utils.parser.utils.convert_stdstreams_to_files(step_run) - if step_run and step_run.inputs: - for step_input in step_run.inputs: - if cast(str, step_input.id).split("#")[-1] == in_.id.split("#")[-1]: - 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") - return input_type + for step_input in step_run.inputs: + if step_input.id.split("#")[-1] == in_.id.split("#")[-1]: + input_type = step_input.type_ + if ( + input_type is not None + and step.scatter is not None + and in_.id in aslist(step.scatter) + ): + input_type = cwl_utils.parser.utils.to_input_array( + input_type, step_run.cwlVersion or "v1.1" + ) + return input_type return "Any" def type_for_step_output( step: cwl.WorkflowStep, sourcename: str, -) -> Any: +) -> cwl_utils.parser.utils.OutputTypeSchemas | None: """Determine the type for the given step output.""" step_run = cwl_utils.parser.utils.load_step(step) cwl_utils.parser.utils.convert_stdstreams_to_files(step_run) - if step_run and step_run.outputs: - for output in step_run.outputs: - if ( - output.id.split("#")[-1].split("/")[-1] - == sourcename.split("#")[-1].split("/")[-1] - ): - 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" - ) - else: - output_type = cwl.ArraySchema(items=output_type, type_="array") - return output_type + for output in step_run.outputs: + if ( + output.id.split("#")[-1].split("/")[-1] + == sourcename.split("#")[-1].split("/")[-1] + ): + output_type = output.type_ + if output_type is not None and step.scatter is not None: + if step.scatterMethod == "nested_crossproduct": + for _ in range(len(aslist(step.scatter))): + output_type = cwl_utils.parser.utils.to_output_array( + output_type, step_run.cwlVersion or "v1.1" + ) + else: + output_type = cwl_utils.parser.utils.to_output_array( + output_type, step_run.cwlVersion or "v1.1" + ) + return output_type raise ValidationException( "param {} not found in {}.".format( sourcename, @@ -431,33 +581,52 @@ def type_for_step_output( def type_for_source( - process: cwl.CommandLineTool | cwl.Workflow | cwl.ExpressionTool, - sourcenames: str | list[str], + process: cwl.Process, + sourcenames: str | Sequence[str], parent: cwl.Workflow | None = None, linkMerge: str | None = None, -) -> Any: +) -> ( + MutableSequence[InputTypeSchemas | OutputTypeSchemas] + | InputTypeSchemas + | OutputTypeSchemas +): """Determine the type for the given sourcenames.""" scatter_context: list[tuple[int, str] | None] = [] params = param_for_source_id(process, sourcenames, parent, scatter_context) if not isinstance(params, MutableSequence): - new_type = params.type_ + new_type: InputTypeSchemas | OutputTypeSchemas = 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.OutputArraySchema( + items=in_output_type_schema_to_output_type_schema( + new_type, process.loadingOptions # type: ignore[attr-defined] + ), + type_="array", + ) else: - new_type = cwl.ArraySchema(items=new_type, type_="array") + new_type = cwl.OutputArraySchema( + items=in_output_type_schema_to_output_type_schema( + new_type, process.loadingOptions # type: ignore[attr-defined] + ), + type_="array", + ) if linkMerge == "merge_nested": - new_type = cwl.ArraySchema(items=new_type, type_="array") + new_type = cwl.OutputArraySchema( + items=in_output_type_schema_to_output_type_schema( + new_type, process.loadingOptions # type: ignore[attr-defined] + ), + type_="array", + ) elif linkMerge == "merge_flattened": new_type = merge_flatten_type(new_type) return new_type - new_type = [] + new_types: MutableSequence[InputTypeSchemas | OutputTypeSchemas] = [] for p, sc in zip(params, scatter_context): - if isinstance(p, str) and not any(_compare_type(t, p) for t in new_type): + if isinstance(p, str) and not any(_compare_type(t, p) for t in new_types): cur_type = p elif hasattr(p, "type_") and not any( - _compare_type(t, p.type_) for t in new_type + _compare_type(t, p.type_) for t in new_types ): cur_type = p.type_ else: @@ -466,44 +635,77 @@ def type_for_source( 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.OutputArraySchema( + items=in_output_type_schema_to_output_type_schema( + cur_type, process.loadingOptions # type: ignore[attr-defined] + ), + type_="array", + ) else: - cur_type = cwl.ArraySchema(items=cur_type, type_="array") - new_type.append(cur_type) - if len(new_type) == 1: - new_type = new_type[0] + cur_type = cwl.OutputArraySchema( + items=in_output_type_schema_to_output_type_schema( + cur_type, process.loadingOptions # type: ignore[attr-defined] + ), + type_="array", + ) + new_types.append(cur_type) + if len(new_types) == 1: + final_type: ( + MutableSequence[InputTypeSchemas | OutputTypeSchemas] + | InputTypeSchemas + | OutputTypeSchemas + ) = new_types[0] + else: + final_type = new_types if linkMerge == "merge_nested": - return cwl.ArraySchema(items=new_type, type_="array") + final_type = cwl.OutputArraySchema( + items=final_type, + type_="array", + ) elif linkMerge == "merge_flattened": - return merge_flatten_type(new_type) + final_type = merge_flatten_type(final_type) elif isinstance(sourcenames, list) and len(sourcenames) > 1: - return cwl.ArraySchema(items=new_type, type_="array") - else: - return new_type + return cwl.OutputArraySchema( + items=final_type, + type_="array", + ) + return final_type def param_for_source_id( - process: cwl.CommandLineTool | cwl.Workflow | cwl.ExpressionTool, - sourcenames: str | list[str], + process: cwl.Process, + sourcenames: str | Sequence[str], parent: cwl.Workflow | None = None, scatter_context: list[tuple[int, str] | None] | None = None, ) -> ( - cwl.CommandInputParameter - | cwl.CommandOutputParameter - | cwl.WorkflowInputParameter + cwl_utils.parser.CommandInputParameter + | cwl_utils.parser.CommandOutputParameter + | cwl_utils.parser.ExpressionToolOutputParameter + | cwl_utils.parser.OperationInputParameter + | cwl_utils.parser.OperationOutputParameter + | cwl_utils.parser.WorkflowInputParameter + | cwl_utils.parser.WorkflowOutputParameter | MutableSequence[ - cwl.CommandInputParameter - | cwl.CommandOutputParameter - | cwl.WorkflowInputParameter + cwl_utils.parser.CommandInputParameter + | cwl_utils.parser.CommandOutputParameter + | cwl_utils.parser.ExpressionToolOutputParameter + | cwl_utils.parser.OperationInputParameter + | cwl_utils.parser.OperationOutputParameter + | cwl_utils.parser.WorkflowInputParameter + | cwl_utils.parser.WorkflowOutputParameter ] ): """Find the process input parameter that matches one of the given sourcenames.""" if isinstance(sourcenames, str): sourcenames = [sourcenames] params: MutableSequence[ - cwl.CommandInputParameter - | cwl.CommandOutputParameter - | cwl.WorkflowInputParameter + cwl_utils.parser.CommandInputParameter + | cwl_utils.parser.CommandOutputParameter + | cwl_utils.parser.ExpressionToolOutputParameter + | cwl_utils.parser.OperationInputParameter + | cwl_utils.parser.OperationOutputParameter + | cwl_utils.parser.WorkflowInputParameter + | cwl_utils.parser.WorkflowOutputParameter ] = [] for sourcename in sourcenames: if not isinstance(process, cwl.Workflow): @@ -544,8 +746,8 @@ def param_for_source_id( ): params.append(output) if scatter_context is not None: - if scatter_context is not None: - if isinstance(step.scatter, str): + match step.scatter: + case str(): scatter_context.append( ( 1, @@ -553,9 +755,7 @@ def param_for_source_id( or "dotproduct", ) ) - elif isinstance( - step.scatter, MutableSequence - ): + case Sequence(): scatter_context.append( ( len(step.scatter), @@ -563,7 +763,7 @@ def param_for_source_id( or "dotproduct", ) ) - else: + case _: scatter_context.append(None) if len(params) == 1: return params[0] diff --git a/cwl_utils/parser/cwl_v1_2.py b/cwl_utils/parser/cwl_v1_2.py index 85f744fc..be96ca70 100644 --- a/cwl_utils/parser/cwl_v1_2.py +++ b/cwl_utils/parser/cwl_v1_2.py @@ -3,18 +3,24 @@ # The code itself is released under the Apache 2.0 license and the help text is # subject to the license of the original schema. +from __future__ import annotations + import copy import logging import os import pathlib +import sys import tempfile import uuid as _uuid__ # pylint: disable=unused-import # noqa: F401 import xml.sax # nosec -from abc import ABC, abstractmethod +from abc import ABCMeta, abstractmethod from collections.abc import MutableMapping, MutableSequence, Sequence +from collections.abc import Collection # pylint: disable=unused-import # noqa: F401 from io import StringIO from itertools import chain -from typing import Any, Final, Optional, Union, cast +from mypy_extensions import i32, i64, trait +from typing import Any, Final, Generic, TypeAlias, TypeVar, cast +from typing import ClassVar, Literal, Mapping # pylint: disable=unused-import # noqa: F401 from urllib.parse import quote, urldefrag, urlparse, urlsplit, urlunsplit from urllib.request import pathname2url @@ -27,22 +33,28 @@ from schema_salad.sourceline import SourceLine, add_lc_filename from schema_salad.utils import CacheType, yaml_no_ts # requires schema-salad v8.2+ -_vocab: dict[str, str] = {} -_rvocab: dict[str, str] = {} +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + +_vocab: Final[dict[str, str]] = {} +_rvocab: Final[dict[str, str]] = {} _logger: Final = logging.getLogger("salad") -IdxType = MutableMapping[str, tuple[Any, "LoadingOptions"]] +IdxType: TypeAlias = MutableMapping[str, tuple[Any, "LoadingOptions"]] +S = TypeVar("S", bound="Saveable") class LoadingOptions: idx: Final[IdxType] - fileuri: Final[Optional[str]] + fileuri: Final[str | None] baseuri: Final[str] namespaces: Final[MutableMapping[str, str]] schemas: Final[MutableSequence[str]] - original_doc: Final[Optional[Any]] + original_doc: Final[Any | None] addl_metadata: Final[MutableMapping[str, Any]] fetcher: Final[Fetcher] vocab: Final[dict[str, str]] @@ -50,24 +62,24 @@ class LoadingOptions: cache: Final[CacheType] imports: Final[list[str]] includes: Final[list[str]] - no_link_check: Final[Optional[bool]] - container: Final[Optional[str]] + no_link_check: Final[bool | None] + container: Final[str | None] def __init__( self, - fetcher: Optional[Fetcher] = None, - namespaces: Optional[dict[str, str]] = None, - schemas: Optional[list[str]] = None, - fileuri: Optional[str] = None, - copyfrom: Optional["LoadingOptions"] = None, - original_doc: Optional[Any] = None, - addl_metadata: Optional[dict[str, str]] = None, - baseuri: Optional[str] = None, - idx: Optional[IdxType] = None, - imports: Optional[list[str]] = None, - includes: Optional[list[str]] = None, - no_link_check: Optional[bool] = None, - container: Optional[str] = None, + fetcher: Fetcher | None = None, + namespaces: dict[str, str] | None = None, + schemas: list[str] | None = None, + fileuri: str | None = None, + copyfrom: LoadingOptions | None = None, + original_doc: Any | None = None, + addl_metadata: dict[str, str] | None = None, + baseuri: str | None = None, + idx: IdxType | None = None, + imports: list[str] | None = None, + includes: list[str] | None = None, + no_link_check: bool | None = None, + container: str | None = None, ) -> None: """Create a LoadingOptions object.""" self.original_doc = original_doc @@ -79,7 +91,7 @@ def __init__( self.idx = temp_idx if fileuri is not None: - temp_fileuri: Optional[str] = fileuri + temp_fileuri: str | None = fileuri else: temp_fileuri = copyfrom.fileuri if copyfrom is not None else None self.fileuri = temp_fileuri @@ -121,13 +133,13 @@ def __init__( self.includes = temp_includes if no_link_check is not None: - temp_no_link_check: Optional[bool] = no_link_check + temp_no_link_check: bool | None = no_link_check else: temp_no_link_check = copyfrom.no_link_check if copyfrom is not None else False self.no_link_check = temp_no_link_check if container is not None: - temp_container: Optional[str] = container + temp_container: str | None = container else: temp_container = copyfrom.container if copyfrom is not None else None self.container = temp_container @@ -201,7 +213,8 @@ def graph(self) -> Graph: return graph -class Saveable(ABC): +@trait +class Saveable(metaclass=ABCMeta): """Mark classes than have a save() and fromDoc() function.""" @classmethod @@ -211,8 +224,8 @@ def fromDoc( _doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - ) -> "Saveable": + docRoot: str | None = None, + ) -> Self: """Construct this object from the result of yaml.load().""" @abstractmethod @@ -223,11 +236,11 @@ def save( def load_field( - val: Union[str, dict[str, str]], + val: Any | None, fieldtype: "_Loader", baseuri: str, loadingOptions: LoadingOptions, - lc: Optional[list[Any]] = None, + lc: Any | None = None, ) -> Any: """Load field.""" if isinstance(val, MutableMapping): @@ -251,7 +264,9 @@ def load_field( return fieldtype.load(val, baseuri, loadingOptions, lc=lc) -save_type = Optional[Union[MutableMapping[str, Any], MutableSequence[Any], int, float, bool, str]] +save_type: TypeAlias = ( + None | MutableMapping[str, Any] | MutableSequence[Any] | i32 | i64 | float | bool | str +) def extract_type(val_type: type[Any]) -> str: @@ -328,7 +343,7 @@ def save( for key in val: newdict[key] = save(val[key], top=False, base_url=base_url, relative_uris=relative_uris) return newdict - if val is None or isinstance(val, (int, float, bool, str)): + if val is None or isinstance(val, (i32, i64, float, bool, str)): return val raise Exception("Not Saveable: %s" % type(val)) @@ -367,7 +382,7 @@ def expand_url( loadingOptions: LoadingOptions, scoped_id: bool = False, vocab_term: bool = False, - scoped_ref: Optional[int] = None, + scoped_ref: int | None = None, ) -> str: if url in ("@id", "@type"): return url @@ -434,9 +449,9 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, - ) -> Any: + docRoot: str | None = None, + lc: Any | None = None, + ) -> Any | None: pass @@ -446,8 +461,8 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, + docRoot: str | None = None, + lc: Any | None = None, ) -> Any: if doc is not None: return doc @@ -455,7 +470,7 @@ def load( class _PrimitiveLoader(_Loader): - def __init__(self, tp: Union[type, tuple[type[str], type[str]]]) -> None: + def __init__(self, tp: type | tuple[type[str], type[str]]) -> None: self.tp: Final = tp def load( @@ -463,8 +478,8 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, + docRoot: str | None = None, + lc: Any | None = None, ) -> Any: if not isinstance(doc, self.tp): raise ValidationException(f"Expected a {self.tp} but got {doc.__class__.__name__}") @@ -483,9 +498,9 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, - ) -> Any: + docRoot: str | None = None, + lc: Any | None = None, + ) -> list[Any]: if not isinstance(doc, MutableSequence): raise ValidationException( f"Value is a {convert_typing(extract_type(type(doc)))}, " @@ -535,9 +550,9 @@ class _MapLoader(_Loader): def __init__( self, values: _Loader, - name: Optional[str] = None, - container: Optional[str] = None, - no_link_check: Optional[bool] = None, + name: str | None = None, + container: str | None = None, + no_link_check: bool | None = None, ) -> None: self.values: Final = values self.name: Final = name @@ -549,9 +564,9 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, - ) -> Any: + docRoot: str | None = None, + lc: Any | None = None, + ) -> dict[str, 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: @@ -584,11 +599,11 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, - ) -> Any: + docRoot: str | None = None, + lc: Any | None = None, + ) -> str: if doc in self.symbols: - return doc + return cast(str, doc) raise ValidationException(f"Expected one of {self.symbols}") def __repr__(self) -> str: @@ -604,75 +619,76 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, + docRoot: str | None = None, + lc: Any | None = None, ) -> Any: r: Final[list[dict[str, Any]]] = [] - if isinstance(doc, MutableSequence): - for d in doc: - if isinstance(d, str): - if d.endswith("?"): - r.append({"pattern": d[:-1], "required": False}) - else: - r.append({"pattern": d}) - elif isinstance(d, dict): - new_dict1: dict[str, Any] = {} - dict_copy = copy.deepcopy(d) - if "pattern" in dict_copy: - new_dict1["pattern"] = dict_copy.pop("pattern") - else: - raise ValidationException( - f"Missing pattern in secondaryFiles specification entry: {d}" + match doc: + case MutableSequence() as dlist: + for d in dlist: + if isinstance(d, str): + if d.endswith("?"): + r.append({"pattern": d[:-1], "required": False}) + else: + r.append({"pattern": d}) + elif isinstance(d, dict): + new_dict1: dict[str, Any] = {} + dict_copy = copy.deepcopy(d) + if "pattern" in dict_copy: + new_dict1["pattern"] = dict_copy.pop("pattern") + else: + raise ValidationException( + f"Missing pattern in secondaryFiles specification entry: {d}" + ) + new_dict1["required"] = ( + dict_copy.pop("required") if "required" in dict_copy else None ) - new_dict1["required"] = ( - dict_copy.pop("required") if "required" in dict_copy else None - ) - if len(dict_copy): - raise ValidationException( - "Unallowed values in secondaryFiles specification entry: {}".format( - dict_copy + if len(dict_copy): + raise ValidationException( + "Unallowed values in secondaryFiles specification entry: {}".format( + dict_copy + ) ) - ) - r.append(new_dict1) + r.append(new_dict1) + else: + raise ValidationException( + "Expected a string or sequence of (strings or mappings)." + ) + case MutableMapping() as decl: + new_dict2 = {} + doc_copy = copy.deepcopy(decl) + if "pattern" in doc_copy: + new_dict2["pattern"] = doc_copy.pop("pattern") else: raise ValidationException( - "Expected a string or sequence of (strings or mappings)." + f"Missing pattern in secondaryFiles specification entry: {decl}" ) - elif isinstance(doc, MutableMapping): - new_dict2: Final = {} - doc_copy: Final = copy.deepcopy(doc) - if "pattern" in doc_copy: - new_dict2["pattern"] = doc_copy.pop("pattern") - else: - raise ValidationException( - f"Missing pattern in secondaryFiles specification entry: {doc}" - ) - new_dict2["required"] = doc_copy.pop("required") if "required" in doc_copy else None + new_dict2["required"] = doc_copy.pop("required") if "required" in doc_copy else None - if len(doc_copy): - raise ValidationException( - f"Unallowed values in secondaryFiles specification entry: {doc_copy}" - ) - r.append(new_dict2) + if len(doc_copy): + raise ValidationException( + f"Unallowed values in secondaryFiles specification entry: {doc_copy}" + ) + r.append(new_dict2) - elif isinstance(doc, str): - if doc.endswith("?"): - r.append({"pattern": doc[:-1], "required": False}) - else: - r.append({"pattern": doc}) - else: - raise ValidationException("Expected str or sequence of str") + case str(decl): + if decl.endswith("?"): + r.append({"pattern": decl[:-1], "required": False}) + else: + r.append({"pattern": decl}) + case _: + raise ValidationException("Expected str or sequence of str") return self.inner.load(r, baseuri, loadingOptions, docRoot, lc=lc) -class _RecordLoader(_Loader): +class _RecordLoader(_Loader, Generic[S]): def __init__( self, - classtype: type[Saveable], - container: Optional[str] = None, - no_link_check: Optional[bool] = None, + classtype: type[S], + container: str | None = None, + no_link_check: bool | None = None, ) -> None: self.classtype: Final = classtype self.container: Final = container @@ -683,9 +699,9 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, - ) -> Any: + docRoot: str | None = None, + lc: Any | None = None, + ) -> S: if not isinstance(doc, MutableMapping): raise ValidationException( f"Value is a {convert_typing(extract_type(type(doc)))}, " @@ -710,19 +726,20 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, - ) -> Any: + docRoot: str | None = None, + lc: Any | None = None, + ) -> str: if not isinstance(doc, str): raise ValidationException( f"Value is a {convert_typing(extract_type(type(doc)))}, " f"but valid type for this field is a str." ) - return doc + else: + return doc class _UnionLoader(_Loader): - def __init__(self, alternates: Sequence[_Loader], name: Optional[str] = None) -> None: + def __init__(self, alternates: Sequence[_Loader], name: str | None = None) -> None: self.alternates = alternates self.name: Final = name @@ -734,8 +751,8 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, + docRoot: str | None = None, + lc: Any | None = None, ) -> Any: errors: Final = [] @@ -817,8 +834,8 @@ def __init__( inner: _Loader, scoped_id: bool, vocab_term: bool, - scoped_ref: Optional[int], - no_link_check: Optional[bool], + scoped_ref: int | None, + no_link_check: bool | None, ) -> None: self.inner: Final = inner self.scoped_id: Final = scoped_id @@ -831,39 +848,40 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, + docRoot: str | None = None, + lc: Any | None = None, ) -> Any: if self.no_link_check is not None: loadingOptions = LoadingOptions( copyfrom=loadingOptions, no_link_check=self.no_link_check ) - if isinstance(doc, MutableSequence): - newdoc: Final = [] - for i in doc: - if isinstance(i, str): - newdoc.append( - expand_url( - i, - baseuri, - loadingOptions, - self.scoped_id, - self.vocab_term, - self.scoped_ref, - ) - ) - else: - newdoc.append(i) - doc = newdoc - elif isinstance(doc, str): - doc = expand_url( - doc, - baseuri, - loadingOptions, - self.scoped_id, - self.vocab_term, - self.scoped_ref, - ) + match doc: + case MutableSequence() as decl: + newdoc: Final = [] + for i in decl: + if isinstance(i, str): + newdoc.append( + expand_url( + i, + baseuri, + loadingOptions, + self.scoped_id, + self.vocab_term, + self.scoped_ref, + ) + ) + else: + newdoc.append(i) + doc = newdoc + case str(decl): + doc = expand_url( + decl, + baseuri, + loadingOptions, + self.scoped_id, + self.vocab_term, + self.scoped_ref, + ) if isinstance(doc, str): if not loadingOptions.no_link_check: errors: Final = [] @@ -880,7 +898,7 @@ def load( class _TypeDSLLoader(_Loader): - def __init__(self, inner: _Loader, refScope: Optional[int], salad_version: str) -> None: + def __init__(self, inner: _Loader, refScope: int | None, salad_version: str) -> None: self.inner: Final = inner self.refScope: Final = refScope self.salad_version: Final = salad_version @@ -890,7 +908,7 @@ def resolve( doc: str, baseuri: str, loadingOptions: LoadingOptions, - ) -> Union[list[Union[dict[str, Any], str]], dict[str, Any], str]: + ) -> list[dict[str, Any] | str] | dict[str, Any] | str: doc_ = doc optional = False if doc_.endswith("?"): @@ -899,7 +917,7 @@ def resolve( if doc_.endswith("[]"): salad_versions: Final = [int(v) for v in self.salad_version[1:].split(".")] - items: Union[list[Union[dict[str, Any], str]], dict[str, Any], str] = "" + items: list[dict[str, Any] | str] | dict[str, Any] | str = "" rest: Final = doc_[0:-2] if salad_versions < [1, 3]: if rest.endswith("[]"): @@ -911,7 +929,7 @@ def resolve( items = self.resolve(rest, baseuri, loadingOptions) if isinstance(items, str): items = expand_url(items, baseuri, loadingOptions, False, True, self.refScope) - expanded: Union[dict[str, Any], str] = {"type": "array", "items": items} + expanded: dict[str, Any] | str = {"type": "array", "items": items} else: expanded = expand_url(doc_, baseuri, loadingOptions, False, True, self.refScope) @@ -925,8 +943,8 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, + docRoot: str | None = None, + lc: Any | None = None, ) -> Any: if isinstance(doc, MutableSequence): r: Final[list[Any]] = [] @@ -950,7 +968,7 @@ def load( class _IdMapLoader(_Loader): - def __init__(self, inner: _Loader, mapSubject: str, mapPredicate: Optional[str]) -> None: + def __init__(self, inner: _Loader, mapSubject: str, mapPredicate: str | None) -> None: self.inner: Final = inner self.mapSubject: Final = mapSubject self.mapPredicate: Final = mapPredicate @@ -960,8 +978,8 @@ def load( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None, - lc: Optional[list[Any]] = None, + docRoot: str | None = None, + lc: Any | None = None, ) -> Any: if isinstance(doc, MutableMapping): r: Final[list[Any]] = [] @@ -990,10 +1008,10 @@ def load( def _document_load( loader: _Loader, - doc: Union[str, MutableMapping[str, Any], MutableSequence[Any]], + doc: str | MutableMapping[str, Any] | MutableSequence[Any], baseuri: str, loadingOptions: LoadingOptions, - addl_metadata_fields: Optional[MutableSequence[str]] = None, + addl_metadata_fields: MutableSequence[str] | None = None, ) -> tuple[Any, LoadingOptions]: if isinstance(doc, str): return _document_load_by_url( @@ -1062,7 +1080,7 @@ def _document_load_by_url( loader: _Loader, url: str, loadingOptions: LoadingOptions, - addl_metadata_fields: Optional[MutableSequence[str]] = None, + addl_metadata_fields: MutableSequence[str] | None = None, ) -> tuple[Any, LoadingOptions]: if url in loadingOptions.idx: return loadingOptions.idx[url] @@ -1117,7 +1135,7 @@ def save_relative_uri( uri: Any, base_url: str, scoped_id: bool, - ref_scope: Optional[int], + ref_scope: int | None, relative_uris: bool, ) -> Any: """Convert any URI to a relative one, obeying the scoping rules.""" @@ -1168,8 +1186,9 @@ def parser_info() -> str: return "org.w3id.cwl.v1_2" -class Documented(Saveable): - pass +@trait +class Documented(Saveable, metaclass=ABCMeta): + doc: None | Sequence[str] | str class RecordField(Documented): @@ -1179,26 +1198,6 @@ class RecordField(Documented): name: str - def __init__( - self, - name: Any, - type_: Any, - doc: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.type_ = type_ - def __eq__(self, other: Any) -> bool: if isinstance(other, RecordField): return bool( @@ -1217,8 +1216,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "RecordField": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -1376,7 +1375,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -1401,8 +1400,8 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), doc=doc, - name=name, type_=type_, extension_fields=extension_fields, loadingOptions=loadingOptions, @@ -1441,16 +1440,13 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["doc", "name", "type"]) - - -class RecordSchema(Saveable): def __init__( self, - type_: Any, - fields: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + name: str, + type_: ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | Sequence[ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | UnionSchema | str] | UnionSchema | str, + doc: None | Sequence[str] | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -1460,9 +1456,14 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields = fields - self.type_ = type_ + self.doc: None | Sequence[str] | str = doc + self.name: str = name + self.type_: ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | Sequence[ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | UnionSchema | str] | UnionSchema | str = type_ + + attrs: ClassVar[Collection[str]] = frozenset(["doc", "name", "type"]) + +class RecordSchema(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, RecordSchema): return bool(self.fields == other.fields and self.type_ == other.type_) @@ -1477,8 +1478,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "RecordSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -1580,7 +1581,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -1640,24 +1641,12 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["fields", "type"]) - - -class EnumSchema(Saveable): - """ - Define an enumerated type. - - """ - - name: str - def __init__( self, - symbols: Any, - type_: Any, - name: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + type_: Literal["record"], + fields: None | Sequence[RecordField] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -1667,9 +1656,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.symbols = symbols - self.type_ = type_ + self.fields: None | Sequence[RecordField] = fields + self.type_: Literal["record"] = type_ + + attrs: ClassVar[Collection[str]] = frozenset(["fields", "type"]) + + +class EnumSchema(Saveable): + """ + Define an enumerated type. + + """ + + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, EnumSchema): @@ -1689,8 +1688,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "EnumSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -1849,7 +1848,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -1874,7 +1873,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=name, + name=cast(str, name), symbols=symbols, type_=type_, extension_fields=extension_fields, @@ -1913,16 +1912,13 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["name", "symbols", "type"]) - - -class ArraySchema(Saveable): def __init__( self, - items: Any, - type_: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + symbols: Sequence[str], + type_: Literal["enum"], + name: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -1932,9 +1928,14 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items - self.type_ = type_ + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols: Sequence[str] = symbols + self.type_: Literal["enum"] = type_ + + attrs: ClassVar[Collection[str]] = frozenset(["name", "symbols", "type"]) + +class ArraySchema(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, ArraySchema): return bool(self.items == other.items and self.type_ == other.type_) @@ -1949,8 +1950,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "ArraySchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -2053,7 +2054,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -2112,16 +2113,12 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["items", "type"]) - - -class MapSchema(Saveable): def __init__( self, - type_: Any, - values: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + items: ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | Sequence[ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | UnionSchema | str] | UnionSchema | str, + type_: Literal["array"], + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -2131,9 +2128,13 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.type_ = type_ - self.values = values + self.items: ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | Sequence[ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | UnionSchema | str] | UnionSchema | str = items + self.type_: Literal["array"] = type_ + + attrs: ClassVar[Collection[str]] = frozenset(["items", "type"]) + +class MapSchema(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, MapSchema): return bool(self.type_ == other.type_ and self.values == other.values) @@ -2148,8 +2149,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "MapSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -2252,7 +2253,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -2311,16 +2312,12 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["type", "values"]) - - -class UnionSchema(Saveable): def __init__( self, - names: Any, - type_: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + type_: Literal["map"], + values: ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | Sequence[ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | UnionSchema | str] | UnionSchema | str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -2330,9 +2327,13 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.names = names - self.type_ = type_ + self.type_: Literal["map"] = type_ + self.values: ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | Sequence[ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | UnionSchema | str] | UnionSchema | str = values + + attrs: ClassVar[Collection[str]] = frozenset(["type", "values"]) + +class UnionSchema(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, UnionSchema): return bool(self.names == other.names and self.type_ == other.type_) @@ -2347,8 +2348,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "UnionSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -2451,7 +2452,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -2510,16 +2511,12 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["names", "type"]) - - -class CWLArraySchema(ArraySchema): def __init__( self, - items: Any, - type_: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + names: ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | Sequence[ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | UnionSchema | str] | UnionSchema | str, + type_: Literal["union"], + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -2529,9 +2526,13 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items - self.type_ = type_ + self.names: ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | Sequence[ArraySchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema | RecordSchema | UnionSchema | str] | UnionSchema | str = names + self.type_: Literal["union"] = type_ + + attrs: ClassVar[Collection[str]] = frozenset(["names", "type"]) + +class CWLArraySchema(ArraySchema): def __eq__(self, other: Any) -> bool: if isinstance(other, CWLArraySchema): return bool(self.items == other.items and self.type_ == other.type_) @@ -2546,8 +2547,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CWLArraySchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -2650,7 +2651,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -2709,19 +2710,12 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["items", "type"]) - - -class CWLRecordField(RecordField): - name: str - def __init__( self, - name: Any, - type_: Any, - doc: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + items: CWLArraySchema | CWLRecordSchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | Sequence[CWLArraySchema | CWLRecordSchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | str] | str, + type_: Literal["array"], + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -2731,9 +2725,14 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.type_ = type_ + self.items: CWLArraySchema | CWLRecordSchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | Sequence[CWLArraySchema | CWLRecordSchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | str] | str = items + self.type_: Literal["array"] = type_ + + attrs: ClassVar[Collection[str]] = frozenset(["items", "type"]) + + +class CWLRecordField(RecordField): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, CWLRecordField): @@ -2753,8 +2752,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CWLRecordField": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -2912,7 +2911,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -2937,8 +2936,8 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), doc=doc, - name=name, type_=type_, extension_fields=extension_fields, loadingOptions=loadingOptions, @@ -2977,16 +2976,13 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["doc", "name", "type"]) - - -class CWLRecordSchema(RecordSchema): def __init__( self, - type_: Any, - fields: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + name: str, + type_: CWLArraySchema | CWLRecordSchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | Sequence[CWLArraySchema | CWLRecordSchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | str] | str, + doc: None | Sequence[str] | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -2996,9 +2992,14 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields = fields - self.type_ = type_ + self.doc: None | Sequence[str] | str = doc + self.name: str = name + self.type_: CWLArraySchema | CWLRecordSchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | Sequence[CWLArraySchema | CWLRecordSchema | EnumSchema | Literal["null", "boolean", "int", "long", "float", "double", "string"] | str] | str = type_ + + attrs: ClassVar[Collection[str]] = frozenset(["doc", "name", "type"]) + +class CWLRecordSchema(RecordSchema): def __eq__(self, other: Any) -> bool: if isinstance(other, CWLRecordSchema): return bool(self.fields == other.fields and self.type_ == other.type_) @@ -3013,8 +3014,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CWLRecordSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -3116,7 +3117,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -3176,7 +3177,25 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["fields", "type"]) + def __init__( + self, + type_: Literal["record"], + fields: None | Sequence[CWLRecordField] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.fields: None | Sequence[CWLRecordField] = fields + self.type_: Literal["record"] = type_ + + attrs: ClassVar[Collection[str]] = frozenset(["fields", "type"]) class File(Saveable): @@ -3250,43 +3269,6 @@ class File(Saveable): """ - def __init__( - self, - location: Optional[Any] = None, - path: Optional[Any] = None, - basename: Optional[Any] = None, - dirname: Optional[Any] = None, - nameroot: Optional[Any] = None, - nameext: Optional[Any] = None, - checksum: Optional[Any] = None, - size: Optional[Any] = None, - secondaryFiles: Optional[Any] = None, - format: Optional[Any] = None, - contents: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "File" - self.location = location - self.path = path - self.basename = basename - self.dirname = dirname - self.nameroot = nameroot - self.nameext = nameext - self.checksum = checksum - self.size = size - self.secondaryFiles = secondaryFiles - self.format = format - self.contents = contents - def __eq__(self, other: Any) -> bool: if isinstance(other, File): return bool( @@ -3329,8 +3311,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "File": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -3687,7 +3669,7 @@ def fromDoc( try: size = load_field( _doc.get("size"), - union_of_None_type_or_inttype, + union_of_None_type_or_inttype_or_inttype, baseuri, loadingOptions, lc=_doc.get("size") @@ -3870,7 +3852,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -3983,7 +3965,44 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + location: None | str = None, + path: None | str = None, + basename: None | str = None, + dirname: None | str = None, + nameroot: None | str = None, + nameext: None | str = None, + checksum: None | str = None, + size: None | i32 = None, + secondaryFiles: None | Sequence[Directory | File] = None, + format: None | str = None, + contents: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "File" + self.location: None | str = location + self.path: None | str = path + self.basename: None | str = basename + self.dirname: None | str = dirname + self.nameroot: None | str = nameroot + self.nameext: None | str = nameext + self.checksum: None | str = checksum + self.size: None | i32 = size + self.secondaryFiles: None | Sequence[Directory | File] = secondaryFiles + self.format: None | str = format + self.contents: None | str = contents + + attrs: ClassVar[Collection[str]] = frozenset( [ "class", "location", @@ -4049,29 +4068,6 @@ class Directory(Saveable): """ - def __init__( - self, - location: Optional[Any] = None, - path: Optional[Any] = None, - basename: Optional[Any] = None, - listing: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "Directory" - self.location = location - self.path = path - self.basename = basename - self.listing = listing - def __eq__(self, other: Any) -> bool: if isinstance(other, Directory): return bool( @@ -4094,8 +4090,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "Directory": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -4306,7 +4302,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -4382,63 +4378,87 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "location", "path", "basename", "listing"]) + def __init__( + self, + location: None | str = None, + path: None | str = None, + basename: None | str = None, + listing: None | Sequence[Directory | File] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "Directory" + self.location: None | str = location + self.path: None | str = path + self.basename: None | str = basename + self.listing: None | Sequence[Directory | File] = listing + + attrs: ClassVar[Collection[str]] = frozenset( + ["class", "location", "path", "basename", "listing"] + ) -class Labeled(Saveable): - pass +@trait +class Labeled(Saveable, metaclass=ABCMeta): + label: None | str -class Identified(Saveable): - pass +@trait +class Identified(Saveable, metaclass=ABCMeta): + id: None | str -class IdentifierRequired(Identified): - pass +@trait +class IdentifierRequired(Identified, metaclass=ABCMeta): + id: str -class LoadContents(Saveable): - pass +@trait +class LoadContents(Saveable, metaclass=ABCMeta): + loadContents: None | bool + loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None -class FieldBase(Labeled): - pass +@trait +class FieldBase(Labeled, metaclass=ABCMeta): + label: None | str + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] + streamable: None | bool -class InputFormat(Saveable): - pass +@trait +class InputFormat(Saveable, metaclass=ABCMeta): + format: None | Sequence[str] | str -class OutputFormat(Saveable): - pass +@trait +class OutputFormat(Saveable, metaclass=ABCMeta): + format: None | str -class Parameter(FieldBase, Documented, IdentifierRequired): +@trait +class Parameter(FieldBase, Documented, IdentifierRequired, metaclass=ABCMeta): """ Define an input or output parameter to a process. """ - pass + label: None | str + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] + streamable: None | bool + doc: None | Sequence[str] | str + id: str class InputBinding(Saveable): - def __init__( - self, - loadContents: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.loadContents = loadContents - def __eq__(self, other: Any) -> bool: if isinstance(other, InputBinding): return bool(self.loadContents == other.loadContents) @@ -4453,8 +4473,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "InputBinding": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -4508,7 +4528,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -4566,37 +4586,11 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["loadContents"]) - - -class IOSchema(Labeled, Documented): - pass - - -class InputSchema(IOSchema): - pass - - -class OutputSchema(IOSchema): - pass - - -class InputRecordField(CWLRecordField, FieldBase, InputFormat, LoadContents): - name: str - def __init__( self, - name: Any, - type_: Any, - doc: Optional[Any] = None, - label: Optional[Any] = None, - secondaryFiles: Optional[Any] = None, - streamable: Optional[Any] = None, - format: Optional[Any] = None, - loadContents: Optional[Any] = None, - loadListing: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + loadContents: None | bool = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -4606,15 +4600,34 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.type_ = type_ - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.format = format - self.loadContents = loadContents - self.loadListing = loadListing + self.loadContents: None | bool = loadContents + + attrs: ClassVar[Collection[str]] = frozenset(["loadContents"]) + + +@trait +class IOSchema(Labeled, Documented, metaclass=ABCMeta): + label: None | str + doc: None | Sequence[str] | str + name: None | str + + +@trait +class InputSchema(IOSchema, metaclass=ABCMeta): + label: None | str + doc: None | Sequence[str] | str + name: None | str + + +@trait +class OutputSchema(IOSchema, metaclass=ABCMeta): + label: None | str + doc: None | Sequence[str] | str + name: None | str + + +class InputRecordField(CWLRecordField, FieldBase, InputFormat, LoadContents): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, InputRecordField): @@ -4652,8 +4665,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "InputRecordField": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -5093,7 +5106,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -5118,8 +5131,8 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), doc=doc, - name=name, type_=type_, label=label, secondaryFiles=secondaryFiles, @@ -5199,7 +5212,39 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + name: str, + type_: InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str, + doc: None | Sequence[str] | str = None, + label: None | str = None, + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = None, + streamable: None | bool = None, + format: None | Sequence[str] | str = None, + loadContents: None | bool = None, + loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.doc: None | Sequence[str] | str = doc + self.name: str = name + self.type_: InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str = type_ + self.label: None | str = label + self.secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = secondaryFiles + self.streamable: None | bool = streamable + self.format: None | Sequence[str] | str = format + self.loadContents: None | bool = loadContents + self.loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = loadListing + + attrs: ClassVar[Collection[str]] = frozenset( [ "doc", "name", @@ -5217,30 +5262,6 @@ def save( class InputRecordSchema(CWLRecordSchema, InputSchema): name: str - def __init__( - self, - type_: Any, - fields: Optional[Any] = None, - label: Optional[Any] = None, - doc: Optional[Any] = None, - name: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.fields = fields - self.type_ = type_ - self.label = label - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - def __eq__(self, other: Any) -> bool: if isinstance(other, InputRecordSchema): return bool( @@ -5261,8 +5282,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "InputRecordSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -5514,7 +5535,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -5539,11 +5560,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), fields=fields, type_=type_, label=label, doc=doc, - name=name, extension_fields=extension_fields, loadingOptions=loadingOptions, ) @@ -5589,21 +5610,15 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["fields", "type", "label", "doc", "name"]) - - -class InputEnumSchema(EnumSchema, InputSchema): - name: str - def __init__( self, - symbols: Any, - type_: Any, - name: Optional[Any] = None, - label: Optional[Any] = None, - doc: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + type_: Literal["record"], + fields: None | Sequence[InputRecordField] = None, + label: None | str = None, + doc: None | Sequence[str] | str = None, + name: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -5613,11 +5628,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.symbols = symbols - self.type_ = type_ - self.label = label - self.doc = doc + self.fields: None | Sequence[InputRecordField] = fields + self.type_: Literal["record"] = type_ + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + + attrs: ClassVar[Collection[str]] = frozenset( + ["fields", "type", "label", "doc", "name"] + ) + + +class InputEnumSchema(EnumSchema, InputSchema): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, InputEnumSchema): @@ -5639,8 +5662,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "InputEnumSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -5893,7 +5916,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -5918,7 +5941,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=name, + name=cast(str, name), symbols=symbols, type_=type_, label=label, @@ -5967,21 +5990,15 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["name", "symbols", "type", "label", "doc"]) - - -class InputArraySchema(CWLArraySchema, InputSchema): - name: str - def __init__( self, - items: Any, - type_: Any, - label: Optional[Any] = None, - doc: Optional[Any] = None, - name: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + symbols: Sequence[str], + type_: Literal["enum"], + name: None | str = None, + label: None | str = None, + doc: None | Sequence[str] | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -5991,11 +6008,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items - self.type_ = type_ - self.label = label - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols: Sequence[str] = symbols + self.type_: Literal["enum"] = type_ + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + + attrs: ClassVar[Collection[str]] = frozenset( + ["name", "symbols", "type", "label", "doc"] + ) + + +class InputArraySchema(CWLArraySchema, InputSchema): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, InputArraySchema): @@ -6017,8 +6042,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "InputArraySchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -6271,7 +6296,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -6296,11 +6321,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), items=items, type_=type_, label=label, doc=doc, - name=name, extension_fields=extension_fields, loadingOptions=loadingOptions, ) @@ -6345,23 +6370,15 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["items", "type", "label", "doc", "name"]) - - -class OutputRecordField(CWLRecordField, FieldBase, OutputFormat): - name: str - def __init__( self, - name: Any, - type_: Any, - doc: Optional[Any] = None, - label: Optional[Any] = None, - secondaryFiles: Optional[Any] = None, - streamable: Optional[Any] = None, - format: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + items: InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str, + type_: Literal["array"], + label: None | str = None, + doc: None | Sequence[str] | str = None, + name: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -6371,13 +6388,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.type_ = type_ - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.format = format + self.items: InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str = items + self.type_: Literal["array"] = type_ + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + + attrs: ClassVar[Collection[str]] = frozenset( + ["items", "type", "label", "doc", "name"] + ) + + +class OutputRecordField(CWLRecordField, FieldBase, OutputFormat): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, OutputRecordField): @@ -6411,8 +6434,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "OutputRecordField": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -6758,7 +6781,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -6783,8 +6806,8 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), doc=doc, - name=name, type_=type_, label=label, secondaryFiles=secondaryFiles, @@ -6848,23 +6871,17 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( - ["doc", "name", "type", "label", "secondaryFiles", "streamable", "format"] - ) - - -class OutputRecordSchema(CWLRecordSchema, OutputSchema): - name: str - def __init__( self, - type_: Any, - fields: Optional[Any] = None, - label: Optional[Any] = None, - doc: Optional[Any] = None, - name: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + name: str, + type_: Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str, + doc: None | Sequence[str] | str = None, + label: None | str = None, + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = None, + streamable: None | bool = None, + format: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -6874,11 +6891,21 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields = fields - self.type_ = type_ - self.label = label - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.doc: None | Sequence[str] | str = doc + self.name: str = name + self.type_: Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str = type_ + self.label: None | str = label + self.secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = secondaryFiles + self.streamable: None | bool = streamable + self.format: None | str = format + + attrs: ClassVar[Collection[str]] = frozenset( + ["doc", "name", "type", "label", "secondaryFiles", "streamable", "format"] + ) + + +class OutputRecordSchema(CWLRecordSchema, OutputSchema): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, OutputRecordSchema): @@ -6900,8 +6927,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "OutputRecordSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -7153,7 +7180,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -7178,11 +7205,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), fields=fields, type_=type_, label=label, doc=doc, - name=name, extension_fields=extension_fields, loadingOptions=loadingOptions, ) @@ -7228,21 +7255,15 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["fields", "type", "label", "doc", "name"]) - - -class OutputEnumSchema(EnumSchema, OutputSchema): - name: str - def __init__( self, - symbols: Any, - type_: Any, - name: Optional[Any] = None, - label: Optional[Any] = None, - doc: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + type_: Literal["record"], + fields: None | Sequence[OutputRecordField] = None, + label: None | str = None, + doc: None | Sequence[str] | str = None, + name: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -7252,11 +7273,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.symbols = symbols - self.type_ = type_ - self.label = label - self.doc = doc + self.fields: None | Sequence[OutputRecordField] = fields + self.type_: Literal["record"] = type_ + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + + attrs: ClassVar[Collection[str]] = frozenset( + ["fields", "type", "label", "doc", "name"] + ) + + +class OutputEnumSchema(EnumSchema, OutputSchema): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, OutputEnumSchema): @@ -7278,8 +7307,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "OutputEnumSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -7532,7 +7561,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -7557,7 +7586,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=name, + name=cast(str, name), symbols=symbols, type_=type_, label=label, @@ -7606,21 +7635,15 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["name", "symbols", "type", "label", "doc"]) - - -class OutputArraySchema(CWLArraySchema, OutputSchema): - name: str - def __init__( self, - items: Any, - type_: Any, - label: Optional[Any] = None, - doc: Optional[Any] = None, - name: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + symbols: Sequence[str], + type_: Literal["enum"], + name: None | str = None, + label: None | str = None, + doc: None | Sequence[str] | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -7630,11 +7653,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items - self.type_ = type_ - self.label = label - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols: Sequence[str] = symbols + self.type_: Literal["enum"] = type_ + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + + attrs: ClassVar[Collection[str]] = frozenset( + ["name", "symbols", "type", "label", "doc"] + ) + + +class OutputArraySchema(CWLArraySchema, OutputSchema): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, OutputArraySchema): @@ -7656,8 +7687,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "OutputArraySchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -7910,7 +7941,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -7935,11 +7966,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), items=items, type_=type_, label=label, doc=doc, - name=name, extension_fields=extension_fields, loadingOptions=loadingOptions, ) @@ -7984,18 +8015,60 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["items", "type", "label", "doc", "name"]) - - -class InputParameter(Parameter, InputFormat, LoadContents): - pass + def __init__( + self, + items: Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str, + type_: Literal["array"], + label: None | str = None, + doc: None | Sequence[str] | str = None, + name: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.items: Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str = items + self.type_: Literal["array"] = type_ + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + + attrs: ClassVar[Collection[str]] = frozenset( + ["items", "type", "label", "doc", "name"] + ) -class OutputParameter(Parameter, OutputFormat): - pass +@trait +class InputParameter(Parameter, InputFormat, LoadContents, metaclass=ABCMeta): + label: None | str + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] + streamable: None | bool + doc: None | Sequence[str] | str + id: str + format: None | Sequence[str] | str + loadContents: None | bool + loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None + default: CWLObjectType | None + + +@trait +class OutputParameter(Parameter, OutputFormat, metaclass=ABCMeta): + label: None | str + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] + streamable: None | bool + doc: None | Sequence[str] | str + id: str + format: None | str -class ProcessRequirement(Saveable): +@trait +class ProcessRequirement(Saveable, metaclass=ABCMeta): """ A process requirement declares a prerequisite that may or must be fulfilled before executing a process. See [`Process.hints`](#process) and @@ -8009,7 +8082,8 @@ class ProcessRequirement(Saveable): pass -class Process(Identified, Labeled, Documented): +@trait +class Process(Identified, Labeled, Documented, metaclass=ABCMeta): """ The base executable type in CWL is the `Process` object defined by the @@ -8018,7 +8092,15 @@ class Process(Identified, Labeled, Documented): """ - pass + id: None | str + label: None | str + doc: None | Sequence[str] | str + inputs: Sequence[CommandInputParameter | OperationInputParameter | WorkflowInputParameter] + outputs: Sequence[CommandOutputParameter | ExpressionToolOutputParameter | OperationOutputParameter | WorkflowOutputParameter] + requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | Loop | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] + hints: None | Sequence[Any | CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | Loop | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] + cwlVersion: Literal["v1.2"] | None + intent: None | Sequence[str] class InlineJavascriptRequirement(ProcessRequirement): @@ -8029,23 +8111,6 @@ class InlineJavascriptRequirement(ProcessRequirement): """ - def __init__( - self, - expressionLib: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "InlineJavascriptRequirement" - self.expressionLib = expressionLib - def __eq__(self, other: Any) -> bool: if isinstance(other, InlineJavascriptRequirement): return bool( @@ -8063,8 +8128,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "InlineJavascriptRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -8134,7 +8199,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -8200,10 +8265,28 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "expressionLib"]) + def __init__( + self, + expressionLib: None | Sequence[str] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "InlineJavascriptRequirement" + self.expressionLib: None | Sequence[str] = expressionLib + + attrs: ClassVar[Collection[str]] = frozenset(["class", "expressionLib"]) -class CommandInputSchema(Saveable): +@trait +class CommandInputSchema(Saveable, metaclass=ABCMeta): pass @@ -8224,23 +8307,6 @@ class SchemaDefRequirement(ProcessRequirement): """ - def __init__( - self, - types: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "SchemaDefRequirement" - self.types = types - def __eq__(self, other: Any) -> bool: if isinstance(other, SchemaDefRequirement): return bool(self.class_ == other.class_ and self.types == other.types) @@ -8255,8 +8321,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "SchemaDefRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -8327,7 +8393,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -8390,7 +8456,24 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "types"]) + def __init__( + self, + types: Sequence[CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema], + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "SchemaDefRequirement" + self.types: Sequence[CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema] = types + + attrs: ClassVar[Collection[str]] = frozenset(["class", "types"]) class SecondaryFileSchema(Saveable): @@ -8411,24 +8494,6 @@ class SecondaryFileSchema(Saveable): """ - def __init__( - self, - pattern: Any, - required: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.pattern = pattern - self.required = required - def __eq__(self, other: Any) -> bool: if isinstance(other, SecondaryFileSchema): return bool( @@ -8445,8 +8510,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "SecondaryFileSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -8548,7 +8613,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -8608,21 +8673,12 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["pattern", "required"]) - - -class LoadListingRequirement(ProcessRequirement): - """ - Specify the desired behavior for loading the `listing` field of - a Directory object for use by expressions. - - """ - def __init__( self, - loadListing: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + pattern: str, + required: None | bool | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -8632,8 +8688,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "LoadListingRequirement" - self.loadListing = loadListing + self.pattern: str = pattern + self.required: None | bool | str = required + + attrs: ClassVar[Collection[str]] = frozenset(["pattern", "required"]) + + +class LoadListingRequirement(ProcessRequirement): + """ + Specify the desired behavior for loading the `listing` field of + a Directory object for use by expressions. + + """ def __eq__(self, other: Any) -> bool: if isinstance(other, LoadListingRequirement): @@ -8651,8 +8717,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "LoadListingRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -8722,7 +8788,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -8788,23 +8854,11 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "loadListing"]) - - -class EnvironmentDef(Saveable): - """ - Define an environment variable that will be set in the runtime environment - by the workflow platform when executing the command line tool. May be the - result of executing an expression, such as getting a parameter from input. - - """ - def __init__( self, - envName: Any, - envValue: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -8814,8 +8868,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.envName = envName - self.envValue = envValue + self.class_: Final[str] = "LoadListingRequirement" + self.loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = loadListing + + attrs: ClassVar[Collection[str]] = frozenset(["class", "loadListing"]) + + +class EnvironmentDef(Saveable): + """ + Define an environment variable that will be set in the runtime environment + by the workflow platform when executing the command line tool. May be the + result of executing an expression, such as getting a parameter from input. + + """ def __eq__(self, other: Any) -> bool: if isinstance(other, EnvironmentDef): @@ -8833,8 +8898,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "EnvironmentDef": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -8937,7 +9002,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -8997,7 +9062,25 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["envName", "envValue"]) + def __init__( + self, + envName: str, + envValue: str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.envName: str = envName + self.envValue: str = envValue + + attrs: ClassVar[Collection[str]] = frozenset(["envName", "envValue"]) class CommandLineBinding(InputBinding): @@ -9040,34 +9123,6 @@ class CommandLineBinding(InputBinding): """ - def __init__( - self, - loadContents: Optional[Any] = None, - position: Optional[Any] = None, - prefix: Optional[Any] = None, - separate: Optional[Any] = None, - itemSeparator: Optional[Any] = None, - valueFrom: Optional[Any] = None, - shellQuote: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.loadContents = loadContents - self.position = position - self.prefix = prefix - self.separate = separate - self.itemSeparator = itemSeparator - self.valueFrom = valueFrom - self.shellQuote = shellQuote - def __eq__(self, other: Any) -> bool: if isinstance(other, CommandLineBinding): return bool( @@ -9100,8 +9155,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandLineBinding": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -9437,7 +9492,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -9534,7 +9589,35 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + loadContents: None | bool = None, + position: None | i32 | str = None, + prefix: None | str = None, + separate: None | bool = None, + itemSeparator: None | str = None, + valueFrom: None | str = None, + shellQuote: None | bool = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.loadContents: None | bool = loadContents + self.position: None | i32 | str = position + self.prefix: None | str = prefix + self.separate: None | bool = separate + self.itemSeparator: None | str = itemSeparator + self.valueFrom: None | str = valueFrom + self.shellQuote: None | bool = shellQuote + + attrs: ClassVar[Collection[str]] = frozenset( [ "loadContents", "position", @@ -9562,28 +9645,6 @@ class CommandOutputBinding(LoadContents): """ - def __init__( - self, - loadContents: Optional[Any] = None, - loadListing: Optional[Any] = None, - glob: Optional[Any] = None, - outputEval: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.loadContents = loadContents - self.loadListing = loadListing - self.glob = glob - self.outputEval = outputEval - def __eq__(self, other: Any) -> bool: if isinstance(other, CommandOutputBinding): return bool( @@ -9603,8 +9664,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandOutputBinding": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -9799,7 +9860,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -9878,30 +9939,14 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["loadContents", "loadListing", "glob", "outputEval"]) - - -class CommandLineBindable(Saveable): - pass - - -class CommandInputRecordField(InputRecordField, CommandLineBindable): - name: str - def __init__( self, - name: Any, - type_: Any, - doc: Optional[Any] = None, - label: Optional[Any] = None, - secondaryFiles: Optional[Any] = None, - streamable: Optional[Any] = None, - format: Optional[Any] = None, - loadContents: Optional[Any] = None, - loadListing: Optional[Any] = None, - inputBinding: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + loadContents: None | bool = None, + loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = None, + glob: None | Sequence[str] | str = None, + outputEval: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -9911,16 +9956,23 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.type_ = type_ - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.format = format - self.loadContents = loadContents - self.loadListing = loadListing - self.inputBinding = inputBinding + self.loadContents: None | bool = loadContents + self.loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = loadListing + self.glob: None | Sequence[str] | str = glob + self.outputEval: None | str = outputEval + + attrs: ClassVar[Collection[str]] = frozenset( + ["loadContents", "loadListing", "glob", "outputEval"] + ) + + +@trait +class CommandLineBindable(Saveable, metaclass=ABCMeta): + inputBinding: CommandLineBinding | None + + +class CommandInputRecordField(InputRecordField, CommandLineBindable): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, CommandInputRecordField): @@ -9960,8 +10012,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandInputRecordField": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -10448,7 +10500,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -10473,8 +10525,8 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), doc=doc, - name=name, type_=type_, label=label, secondaryFiles=secondaryFiles, @@ -10562,7 +10614,41 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + name: str, + type_: CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str, + doc: None | Sequence[str] | str = None, + label: None | str = None, + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = None, + streamable: None | bool = None, + format: None | Sequence[str] | str = None, + loadContents: None | bool = None, + loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = None, + inputBinding: CommandLineBinding | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.doc: None | Sequence[str] | str = doc + self.name: str = name + self.type_: CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str = type_ + self.label: None | str = label + self.secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = secondaryFiles + self.streamable: None | bool = streamable + self.format: None | Sequence[str] | str = format + self.loadContents: None | bool = loadContents + self.loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = loadListing + self.inputBinding: CommandLineBinding | None = inputBinding + + attrs: ClassVar[Collection[str]] = frozenset( [ "doc", "name", @@ -10583,32 +10669,6 @@ class CommandInputRecordSchema( ): name: str - def __init__( - self, - type_: Any, - fields: Optional[Any] = None, - label: Optional[Any] = None, - doc: Optional[Any] = None, - name: Optional[Any] = None, - inputBinding: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.fields = fields - self.type_ = type_ - self.label = label - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.inputBinding = inputBinding - def __eq__(self, other: Any) -> bool: if isinstance(other, CommandInputRecordSchema): return bool( @@ -10639,8 +10699,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandInputRecordSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -10939,7 +10999,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -10964,11 +11024,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), fields=fields, type_=type_, label=label, doc=doc, - name=name, inputBinding=inputBinding, extension_fields=extension_fields, loadingOptions=loadingOptions, @@ -11022,22 +11082,16 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["fields", "type", "label", "doc", "name", "inputBinding"]) - - -class CommandInputEnumSchema(InputEnumSchema, CommandInputSchema, CommandLineBindable): - name: str - def __init__( self, - symbols: Any, - type_: Any, - name: Optional[Any] = None, - label: Optional[Any] = None, - doc: Optional[Any] = None, - inputBinding: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + type_: Literal["record"], + fields: None | Sequence[CommandInputRecordField] = None, + label: None | str = None, + doc: None | Sequence[str] | str = None, + name: None | str = None, + inputBinding: CommandLineBinding | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -11047,12 +11101,20 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.symbols = symbols - self.type_ = type_ - self.label = label - self.doc = doc - self.inputBinding = inputBinding + self.fields: None | Sequence[CommandInputRecordField] = fields + self.type_: Literal["record"] = type_ + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.inputBinding: CommandLineBinding | None = inputBinding + + attrs: ClassVar[Collection[str]] = frozenset( + ["fields", "type", "label", "doc", "name", "inputBinding"] + ) + + +class CommandInputEnumSchema(InputEnumSchema, CommandInputSchema, CommandLineBindable): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, CommandInputEnumSchema): @@ -11084,8 +11146,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandInputEnumSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -11385,7 +11447,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -11410,7 +11472,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=name, + name=cast(str, name), symbols=symbols, type_=type_, label=label, @@ -11467,24 +11529,16 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["name", "symbols", "type", "label", "doc", "inputBinding"]) - - -class CommandInputArraySchema( - InputArraySchema, CommandInputSchema, CommandLineBindable -): - name: str - def __init__( self, - items: Any, - type_: Any, - label: Optional[Any] = None, - doc: Optional[Any] = None, - name: Optional[Any] = None, - inputBinding: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + symbols: Sequence[str], + type_: Literal["enum"], + name: None | str = None, + label: None | str = None, + doc: None | Sequence[str] | str = None, + inputBinding: CommandLineBinding | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -11494,12 +11548,22 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items - self.type_ = type_ - self.label = label - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.inputBinding = inputBinding + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols: Sequence[str] = symbols + self.type_: Literal["enum"] = type_ + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + self.inputBinding: CommandLineBinding | None = inputBinding + + attrs: ClassVar[Collection[str]] = frozenset( + ["name", "symbols", "type", "label", "doc", "inputBinding"] + ) + + +class CommandInputArraySchema( + InputArraySchema, CommandInputSchema, CommandLineBindable +): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, CommandInputArraySchema): @@ -11524,8 +11588,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandInputArraySchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -11825,7 +11889,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -11850,11 +11914,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), items=items, type_=type_, label=label, doc=doc, - name=name, inputBinding=inputBinding, extension_fields=extension_fields, loadingOptions=loadingOptions, @@ -11907,24 +11971,16 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["items", "type", "label", "doc", "name", "inputBinding"]) - - -class CommandOutputRecordField(OutputRecordField): - name: str - def __init__( self, - name: Any, - type_: Any, - doc: Optional[Any] = None, - label: Optional[Any] = None, - secondaryFiles: Optional[Any] = None, - streamable: Optional[Any] = None, - format: Optional[Any] = None, - outputBinding: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + items: CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str, + type_: Literal["array"], + label: None | str = None, + doc: None | Sequence[str] | str = None, + name: None | str = None, + inputBinding: CommandLineBinding | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -11934,14 +11990,20 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.type_ = type_ - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.format = format - self.outputBinding = outputBinding + self.items: CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str = items + self.type_: Literal["array"] = type_ + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.inputBinding: CommandLineBinding | None = inputBinding + + attrs: ClassVar[Collection[str]] = frozenset( + ["items", "type", "label", "doc", "name", "inputBinding"] + ) + + +class CommandOutputRecordField(OutputRecordField): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, CommandOutputRecordField): @@ -11977,8 +12039,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandOutputRecordField": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -12371,7 +12433,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -12396,8 +12458,8 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), doc=doc, - name=name, type_=type_, label=label, secondaryFiles=secondaryFiles, @@ -12469,7 +12531,37 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + name: str, + type_: CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str, + doc: None | Sequence[str] | str = None, + label: None | str = None, + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = None, + streamable: None | bool = None, + format: None | str = None, + outputBinding: CommandOutputBinding | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.doc: None | Sequence[str] | str = doc + self.name: str = name + self.type_: CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str = type_ + self.label: None | str = label + self.secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = secondaryFiles + self.streamable: None | bool = streamable + self.format: None | str = format + self.outputBinding: CommandOutputBinding | None = outputBinding + + attrs: ClassVar[Collection[str]] = frozenset( [ "doc", "name", @@ -12486,30 +12578,6 @@ def save( class CommandOutputRecordSchema(OutputRecordSchema): name: str - def __init__( - self, - type_: Any, - fields: Optional[Any] = None, - label: Optional[Any] = None, - doc: Optional[Any] = None, - name: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.fields = fields - self.type_ = type_ - self.label = label - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - def __eq__(self, other: Any) -> bool: if isinstance(other, CommandOutputRecordSchema): return bool( @@ -12530,8 +12598,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandOutputRecordSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -12783,7 +12851,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -12808,11 +12876,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), fields=fields, type_=type_, label=label, doc=doc, - name=name, extension_fields=extension_fields, loadingOptions=loadingOptions, ) @@ -12858,21 +12926,15 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["fields", "type", "label", "doc", "name"]) - - -class CommandOutputEnumSchema(OutputEnumSchema): - name: str - def __init__( self, - symbols: Any, - type_: Any, - name: Optional[Any] = None, - label: Optional[Any] = None, - doc: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + type_: Literal["record"], + fields: None | Sequence[CommandOutputRecordField] = None, + label: None | str = None, + doc: None | Sequence[str] | str = None, + name: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -12882,11 +12944,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.symbols = symbols - self.type_ = type_ - self.label = label - self.doc = doc + self.fields: None | Sequence[CommandOutputRecordField] = fields + self.type_: Literal["record"] = type_ + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + + attrs: ClassVar[Collection[str]] = frozenset( + ["fields", "type", "label", "doc", "name"] + ) + + +class CommandOutputEnumSchema(OutputEnumSchema): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, CommandOutputEnumSchema): @@ -12908,8 +12978,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandOutputEnumSchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -13162,7 +13232,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -13187,7 +13257,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=name, + name=cast(str, name), symbols=symbols, type_=type_, label=label, @@ -13236,21 +13306,15 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["name", "symbols", "type", "label", "doc"]) - - -class CommandOutputArraySchema(OutputArraySchema): - name: str - def __init__( self, - items: Any, - type_: Any, - label: Optional[Any] = None, - doc: Optional[Any] = None, - name: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + symbols: Sequence[str], + type_: Literal["enum"], + name: None | str = None, + label: None | str = None, + doc: None | Sequence[str] | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -13260,11 +13324,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items - self.type_ = type_ - self.label = label - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols: Sequence[str] = symbols + self.type_: Literal["enum"] = type_ + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + + attrs: ClassVar[Collection[str]] = frozenset( + ["name", "symbols", "type", "label", "doc"] + ) + + +class CommandOutputArraySchema(OutputArraySchema): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, CommandOutputArraySchema): @@ -13286,8 +13358,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandOutputArraySchema": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -13540,7 +13612,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -13565,11 +13637,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + name=cast(str, name), items=items, type_=type_, label=label, doc=doc, - name=name, extension_fields=extension_fields, loadingOptions=loadingOptions, ) @@ -13614,31 +13686,15 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["items", "type", "label", "doc", "name"]) - - -class CommandInputParameter(InputParameter): - """ - An input parameter for a CommandLineTool. - """ - - id: str - def __init__( self, - id: Any, - type_: Any, - label: Optional[Any] = None, - secondaryFiles: Optional[Any] = None, - streamable: Optional[Any] = None, - doc: Optional[Any] = None, - format: Optional[Any] = None, - loadContents: Optional[Any] = None, - loadListing: Optional[Any] = None, - default: Optional[Any] = None, - inputBinding: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + items: CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str, + type_: Literal["array"], + label: None | str = None, + doc: None | Sequence[str] | str = None, + name: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -13648,17 +13704,23 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.format = format - self.loadContents = loadContents - self.loadListing = loadListing - self.default = default - self.type_ = type_ - self.inputBinding = inputBinding + self.items: CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str = items + self.type_: Literal["array"] = type_ + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) + + attrs: ClassVar[Collection[str]] = frozenset( + ["items", "type", "label", "doc", "name"] + ) + + +class CommandInputParameter(InputParameter): + """ + An input parameter for a CommandLineTool. + """ + + id: str def __eq__(self, other: Any) -> bool: if isinstance(other, CommandInputParameter): @@ -13700,8 +13762,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandInputParameter": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -14235,7 +14297,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -14260,11 +14322,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + id=cast(str, id), label=label, secondaryFiles=secondaryFiles, streamable=streamable, doc=doc, - id=id, format=format, loadContents=loadContents, loadListing=loadListing, @@ -14354,7 +14416,43 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + id: str, + type_: CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Literal["stdin"] | Sequence[CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str, + label: None | str = None, + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = None, + streamable: None | bool = None, + doc: None | Sequence[str] | str = None, + format: None | Sequence[str] | str = None, + loadContents: None | bool = None, + loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = None, + default: CWLObjectType | None = None, + inputBinding: CommandLineBinding | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.label: None | str = label + self.secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = secondaryFiles + self.streamable: None | bool = streamable + self.doc: None | Sequence[str] | str = doc + self.id: str = id + self.format: None | Sequence[str] | str = format + self.loadContents: None | bool = loadContents + self.loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = loadListing + self.default: CWLObjectType | None = default + self.type_: CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Literal["stdin"] | Sequence[CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str = type_ + self.inputBinding: CommandLineBinding | None = inputBinding + + attrs: ClassVar[Collection[str]] = frozenset( [ "label", "secondaryFiles", @@ -14378,36 +14476,6 @@ class CommandOutputParameter(OutputParameter): id: str - def __init__( - self, - id: Any, - type_: Any, - label: Optional[Any] = None, - secondaryFiles: Optional[Any] = None, - streamable: Optional[Any] = None, - doc: Optional[Any] = None, - format: Optional[Any] = None, - outputBinding: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.format = format - self.type_ = type_ - self.outputBinding = outputBinding - def __eq__(self, other: Any) -> bool: if isinstance(other, CommandOutputParameter): return bool( @@ -14442,8 +14510,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandOutputParameter": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -14836,7 +14904,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -14861,11 +14929,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + id=cast(str, id), label=label, secondaryFiles=secondaryFiles, streamable=streamable, doc=doc, - id=id, format=format, type_=type_, outputBinding=outputBinding, @@ -14934,7 +15002,37 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + id: str, + type_: CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Literal["stderr"] | Literal["stdout"] | Sequence[CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str, + label: None | str = None, + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = None, + streamable: None | bool = None, + doc: None | Sequence[str] | str = None, + format: None | str = None, + outputBinding: CommandOutputBinding | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.label: None | str = label + self.secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = secondaryFiles + self.streamable: None | bool = streamable + self.doc: None | Sequence[str] | str = doc + self.id: str = id + self.format: None | str = format + self.type_: CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Literal["stderr"] | Literal["stdout"] | Sequence[CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str = type_ + self.outputBinding: CommandOutputBinding | None = outputBinding + + attrs: ClassVar[Collection[str]] = frozenset( [ "label", "secondaryFiles", @@ -14956,55 +15054,6 @@ class CommandLineTool(Process): id: str - def __init__( - self, - inputs: Any, - outputs: Any, - id: Optional[Any] = None, - label: Optional[Any] = None, - doc: Optional[Any] = None, - requirements: Optional[Any] = None, - hints: Optional[Any] = None, - cwlVersion: Optional[Any] = None, - intent: Optional[Any] = None, - baseCommand: Optional[Any] = None, - arguments: Optional[Any] = None, - stdin: Optional[Any] = None, - stderr: Optional[Any] = None, - stdout: Optional[Any] = None, - successCodes: Optional[Any] = None, - temporaryFailCodes: Optional[Any] = None, - permanentFailCodes: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.label = label - self.doc = doc - self.inputs = inputs - self.outputs = outputs - self.requirements = requirements - self.hints = hints - self.cwlVersion = cwlVersion - self.intent = intent - self.class_ = "CommandLineTool" - self.baseCommand = baseCommand - self.arguments = arguments - self.stdin = stdin - self.stderr = stderr - self.stdout = stdout - self.successCodes = successCodes - self.temporaryFailCodes = temporaryFailCodes - self.permanentFailCodes = permanentFailCodes - def __eq__(self, other: Any) -> bool: if isinstance(other, CommandLineTool): return bool( @@ -15059,8 +15108,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CommandLineTool": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -15893,7 +15942,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -15918,7 +15967,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=id, + id=cast(str, id), label=label, doc=doc, inputs=inputs, @@ -16049,7 +16098,56 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + inputs: Sequence[CommandInputParameter], + outputs: Sequence[CommandOutputParameter], + id: None | str = None, + label: None | str = None, + doc: None | Sequence[str] | str = None, + requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | Loop | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = None, + hints: None | Sequence[Any | CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | Loop | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = None, + cwlVersion: Literal["v1.2"] | None = None, + intent: None | Sequence[str] = None, + baseCommand: None | Sequence[str] | str = None, + arguments: None | Sequence[CommandLineBinding | str] = None, + stdin: None | str = None, + stderr: None | str = None, + stdout: None | str = None, + successCodes: None | Sequence[i32] = None, + temporaryFailCodes: None | Sequence[i32] = None, + permanentFailCodes: None | Sequence[i32] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.id: str = id if id is not None else "_:" + str(_uuid__.uuid4()) + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + self.inputs: Sequence[CommandInputParameter] = inputs + self.outputs: Sequence[CommandOutputParameter] = outputs + self.requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | Loop | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = requirements + self.hints: None | Sequence[Any | CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | Loop | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = hints + self.cwlVersion: Literal["v1.2"] | None = cwlVersion + self.intent: None | Sequence[str] = intent + self.class_: Final[str] = "CommandLineTool" + self.baseCommand: None | Sequence[str] | str = baseCommand + self.arguments: None | Sequence[CommandLineBinding | str] = arguments + self.stdin: None | str = stdin + self.stderr: None | str = stderr + self.stdout: None | str = stdout + self.successCodes: None | Sequence[i32] = successCodes + self.temporaryFailCodes: None | Sequence[i32] = temporaryFailCodes + self.permanentFailCodes: None | Sequence[i32] = permanentFailCodes + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "label", @@ -16129,33 +16227,6 @@ class DockerRequirement(ProcessRequirement): """ - def __init__( - self, - dockerPull: Optional[Any] = None, - dockerLoad: Optional[Any] = None, - dockerFile: Optional[Any] = None, - dockerImport: Optional[Any] = None, - dockerImageId: Optional[Any] = None, - dockerOutputDirectory: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "DockerRequirement" - self.dockerPull = dockerPull - self.dockerLoad = dockerLoad - self.dockerFile = dockerFile - self.dockerImport = dockerImport - self.dockerImageId = dockerImageId - self.dockerOutputDirectory = dockerOutputDirectory - def __eq__(self, other: Any) -> bool: if isinstance(other, DockerRequirement): return bool( @@ -16188,8 +16259,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "DockerRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -16494,7 +16565,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -16600,7 +16671,34 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + dockerPull: None | str = None, + dockerLoad: None | str = None, + dockerFile: None | str = None, + dockerImport: None | str = None, + dockerImageId: None | str = None, + dockerOutputDirectory: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "DockerRequirement" + self.dockerPull: None | str = dockerPull + self.dockerLoad: None | str = dockerLoad + self.dockerFile: None | str = dockerFile + self.dockerImport: None | str = dockerImport + self.dockerImageId: None | str = dockerImageId + self.dockerOutputDirectory: None | str = dockerOutputDirectory + + attrs: ClassVar[Collection[str]] = frozenset( [ "class", "dockerPull", @@ -16620,23 +16718,6 @@ class SoftwareRequirement(ProcessRequirement): """ - def __init__( - self, - packages: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "SoftwareRequirement" - self.packages = packages - def __eq__(self, other: Any) -> bool: if isinstance(other, SoftwareRequirement): return bool(self.class_ == other.class_ and self.packages == other.packages) @@ -16651,8 +16732,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "SoftwareRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -16723,7 +16804,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -16786,17 +16867,11 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "packages"]) - - -class SoftwarePackage(Saveable): def __init__( self, - package: Any, - version: Optional[Any] = None, - specs: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + packages: Sequence[SoftwarePackage], + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -16806,10 +16881,13 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.package = package - self.version = version - self.specs = specs + self.class_: Final[str] = "SoftwareRequirement" + self.packages: Sequence[SoftwarePackage] = packages + attrs: ClassVar[Collection[str]] = frozenset(["class", "packages"]) + + +class SoftwarePackage(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, SoftwarePackage): return bool( @@ -16828,8 +16906,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "SoftwarePackage": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -16978,7 +17056,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -17042,7 +17120,27 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["package", "version", "specs"]) + def __init__( + self, + package: str, + version: None | Sequence[str] = None, + specs: None | Sequence[str] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.package: str = package + self.version: None | Sequence[str] = version + self.specs: None | Sequence[str] = specs + + attrs: ClassVar[Collection[str]] = frozenset(["package", "version", "specs"]) class Dirent(Saveable): @@ -17058,26 +17156,6 @@ class Dirent(Saveable): """ - def __init__( - self, - entry: Any, - entryname: Optional[Any] = None, - writable: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.entryname = entryname - self.entry = entry - self.writable = writable - def __eq__(self, other: Any) -> bool: if isinstance(other, Dirent): return bool( @@ -17096,8 +17174,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "Dirent": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -17246,7 +17324,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -17314,20 +17392,13 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["entryname", "entry", "writable"]) - - -class InitialWorkDirRequirement(ProcessRequirement): - """ - Define a list of files and subdirectories that must be staged by the workflow platform prior to executing the command line tool. - Normally files are staged within the designated output directory. However, when running inside containers, files may be staged at arbitrary locations, see discussion for [`Dirent.entryname`](#Dirent). Together with `DockerRequirement.dockerOutputDirectory` it is possible to control the locations of both input and output files when running in containers. - """ - def __init__( self, - listing: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + entry: str, + entryname: None | str = None, + writable: None | bool = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -17337,8 +17408,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "InitialWorkDirRequirement" - self.listing = listing + self.entryname: None | str = entryname + self.entry: str = entry + self.writable: None | bool = writable + + attrs: ClassVar[Collection[str]] = frozenset(["entryname", "entry", "writable"]) + + +class InitialWorkDirRequirement(ProcessRequirement): + """ + Define a list of files and subdirectories that must be staged by the workflow platform prior to executing the command line tool. + Normally files are staged within the designated output directory. However, when running inside containers, files may be staged at arbitrary locations, see discussion for [`Dirent.entryname`](#Dirent). Together with `DockerRequirement.dockerOutputDirectory` it is possible to control the locations of both input and output files when running in containers. + """ def __eq__(self, other: Any) -> bool: if isinstance(other, InitialWorkDirRequirement): @@ -17354,8 +17435,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "InitialWorkDirRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -17426,7 +17507,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -17489,21 +17570,11 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "listing"]) - - -class EnvVarRequirement(ProcessRequirement): - """ - Define a list of environment variables which will be set in the - execution environment of the tool. See `EnvironmentDef` for details. - - """ - def __init__( self, - envDef: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + listing: Sequence[Directory | Dirent | File | None | Sequence[Directory | File] | str] | str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -17513,8 +17584,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "EnvVarRequirement" - self.envDef = envDef + self.class_: Final[str] = "InitialWorkDirRequirement" + self.listing: Sequence[Directory | Dirent | File | None | Sequence[Directory | File] | str] | str = listing + + attrs: ClassVar[Collection[str]] = frozenset(["class", "listing"]) + + +class EnvVarRequirement(ProcessRequirement): + """ + Define a list of environment variables which will be set in the + execution environment of the tool. See `EnvironmentDef` for details. + + """ def __eq__(self, other: Any) -> bool: if isinstance(other, EnvVarRequirement): @@ -17530,8 +17611,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "EnvVarRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -17602,7 +17683,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -17665,7 +17746,24 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "envDef"]) + def __init__( + self, + envDef: Sequence[EnvironmentDef], + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "EnvVarRequirement" + self.envDef: Sequence[EnvironmentDef] = envDef + + attrs: ClassVar[Collection[str]] = frozenset(["class", "envDef"]) class ShellCommandRequirement(ProcessRequirement): @@ -17680,21 +17778,6 @@ class ShellCommandRequirement(ProcessRequirement): """ - def __init__( - self, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "ShellCommandRequirement" - def __eq__(self, other: Any) -> bool: if isinstance(other, ShellCommandRequirement): return bool(self.class_ == other.class_) @@ -17709,8 +17792,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "ShellCommandRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -17733,7 +17816,7 @@ def fromDoc( raise ValidationException(f"tried `{cls.__name__}` but") except ValidationException as e: raise e - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -17789,7 +17872,22 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class"]) + def __init__( + self, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "ShellCommandRequirement" + + attrs: ClassVar[Collection[str]] = frozenset(["class"]) class ResourceRequirement(ProcessRequirement): @@ -17822,37 +17920,6 @@ class ResourceRequirement(ProcessRequirement): """ - def __init__( - self, - coresMin: Optional[Any] = None, - coresMax: Optional[Any] = None, - ramMin: Optional[Any] = None, - ramMax: Optional[Any] = None, - tmpdirMin: Optional[Any] = None, - tmpdirMax: Optional[Any] = None, - outdirMin: Optional[Any] = None, - outdirMax: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "ResourceRequirement" - self.coresMin = coresMin - self.coresMax = coresMax - self.ramMin = ramMin - self.ramMax = ramMax - self.tmpdirMin = tmpdirMin - self.tmpdirMax = tmpdirMax - self.outdirMin = outdirMin - self.outdirMax = outdirMax - def __eq__(self, other: Any) -> bool: if isinstance(other, ResourceRequirement): return bool( @@ -17889,8 +17956,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "ResourceRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -17918,7 +17985,7 @@ def fromDoc( try: coresMin = load_field( _doc.get("coresMin"), - union_of_None_type_or_inttype_or_floattype_or_ExpressionLoader, + union_of_None_type_or_inttype_or_inttype_or_floattype_or_ExpressionLoader, baseuri, loadingOptions, lc=_doc.get("coresMin") @@ -17965,7 +18032,7 @@ def fromDoc( try: coresMax = load_field( _doc.get("coresMax"), - union_of_None_type_or_inttype_or_floattype_or_ExpressionLoader, + union_of_None_type_or_inttype_or_inttype_or_floattype_or_ExpressionLoader, baseuri, loadingOptions, lc=_doc.get("coresMax") @@ -18012,7 +18079,7 @@ def fromDoc( try: ramMin = load_field( _doc.get("ramMin"), - union_of_None_type_or_inttype_or_floattype_or_ExpressionLoader, + union_of_None_type_or_inttype_or_inttype_or_floattype_or_ExpressionLoader, baseuri, loadingOptions, lc=_doc.get("ramMin") @@ -18059,7 +18126,7 @@ def fromDoc( try: ramMax = load_field( _doc.get("ramMax"), - union_of_None_type_or_inttype_or_floattype_or_ExpressionLoader, + union_of_None_type_or_inttype_or_inttype_or_floattype_or_ExpressionLoader, baseuri, loadingOptions, lc=_doc.get("ramMax") @@ -18106,7 +18173,7 @@ def fromDoc( try: tmpdirMin = load_field( _doc.get("tmpdirMin"), - union_of_None_type_or_inttype_or_floattype_or_ExpressionLoader, + union_of_None_type_or_inttype_or_inttype_or_floattype_or_ExpressionLoader, baseuri, loadingOptions, lc=_doc.get("tmpdirMin") @@ -18153,7 +18220,7 @@ def fromDoc( try: tmpdirMax = load_field( _doc.get("tmpdirMax"), - union_of_None_type_or_inttype_or_floattype_or_ExpressionLoader, + union_of_None_type_or_inttype_or_inttype_or_floattype_or_ExpressionLoader, baseuri, loadingOptions, lc=_doc.get("tmpdirMax") @@ -18200,7 +18267,7 @@ def fromDoc( try: outdirMin = load_field( _doc.get("outdirMin"), - union_of_None_type_or_inttype_or_floattype_or_ExpressionLoader, + union_of_None_type_or_inttype_or_inttype_or_floattype_or_ExpressionLoader, baseuri, loadingOptions, lc=_doc.get("outdirMin") @@ -18247,7 +18314,7 @@ def fromDoc( try: outdirMax = load_field( _doc.get("outdirMax"), - union_of_None_type_or_inttype_or_floattype_or_ExpressionLoader, + union_of_None_type_or_inttype_or_inttype_or_floattype_or_ExpressionLoader, baseuri, loadingOptions, lc=_doc.get("outdirMax") @@ -18289,7 +18356,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -18399,7 +18466,38 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + coresMin: None | float | i32 | str = None, + coresMax: None | float | i32 | str = None, + ramMin: None | float | i32 | str = None, + ramMax: None | float | i32 | str = None, + tmpdirMin: None | float | i32 | str = None, + tmpdirMax: None | float | i32 | str = None, + outdirMin: None | float | i32 | str = None, + outdirMax: None | float | i32 | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "ResourceRequirement" + self.coresMin: None | float | i32 | str = coresMin + self.coresMax: None | float | i32 | str = coresMax + self.ramMin: None | float | i32 | str = ramMin + self.ramMax: None | float | i32 | str = ramMax + self.tmpdirMin: None | float | i32 | str = tmpdirMin + self.tmpdirMax: None | float | i32 | str = tmpdirMax + self.outdirMin: None | float | i32 | str = outdirMin + self.outdirMax: None | float | i32 | str = outdirMax + + attrs: ClassVar[Collection[str]] = frozenset( [ "class", "coresMin", @@ -18428,23 +18526,6 @@ class WorkReuse(ProcessRequirement): """ - def __init__( - self, - enableReuse: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "WorkReuse" - self.enableReuse = enableReuse - def __eq__(self, other: Any) -> bool: if isinstance(other, WorkReuse): return bool( @@ -18461,8 +18542,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "WorkReuse": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -18533,7 +18614,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -18599,7 +18680,24 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "enableReuse"]) + def __init__( + self, + enableReuse: bool | str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "WorkReuse" + self.enableReuse: bool | str = enableReuse + + attrs: ClassVar[Collection[str]] = frozenset(["class", "enableReuse"]) class NetworkAccess(ProcessRequirement): @@ -18622,23 +18720,6 @@ class NetworkAccess(ProcessRequirement): """ - def __init__( - self, - networkAccess: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "NetworkAccess" - self.networkAccess = networkAccess - def __eq__(self, other: Any) -> bool: if isinstance(other, NetworkAccess): return bool( @@ -18656,8 +18737,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "NetworkAccess": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -18728,7 +18809,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -18794,7 +18875,24 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "networkAccess"]) + def __init__( + self, + networkAccess: bool | str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "NetworkAccess" + self.networkAccess: bool | str = networkAccess + + attrs: ClassVar[Collection[str]] = frozenset(["class", "networkAccess"]) class InplaceUpdateRequirement(ProcessRequirement): @@ -18832,23 +18930,6 @@ class InplaceUpdateRequirement(ProcessRequirement): """ - def __init__( - self, - inplaceUpdate: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "InplaceUpdateRequirement" - self.inplaceUpdate = inplaceUpdate - def __eq__(self, other: Any) -> bool: if isinstance(other, InplaceUpdateRequirement): return bool( @@ -18866,8 +18947,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "InplaceUpdateRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -18938,7 +19019,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -19004,26 +19085,11 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "inplaceUpdate"]) - - -class ToolTimeLimit(ProcessRequirement): - """ - Set an upper limit on the execution time of a CommandLineTool. - A CommandLineTool whose execution duration exceeds the time - limit may be preemptively terminated and considered failed. - May also be used by batch systems to make scheduling decisions. - The execution duration excludes external operations, such as - staging of files, pulling a docker image etc, and only counts - wall-time for the execution of the command line itself. - - """ - def __init__( self, - timelimit: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + inplaceUpdate: bool, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -19033,8 +19099,23 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "ToolTimeLimit" - self.timelimit = timelimit + self.class_: Final[str] = "InplaceUpdateRequirement" + self.inplaceUpdate: bool = inplaceUpdate + + attrs: ClassVar[Collection[str]] = frozenset(["class", "inplaceUpdate"]) + + +class ToolTimeLimit(ProcessRequirement): + """ + Set an upper limit on the execution time of a CommandLineTool. + A CommandLineTool whose execution duration exceeds the time + limit may be preemptively terminated and considered failed. + May also be used by batch systems to make scheduling decisions. + The execution duration excludes external operations, such as + staging of files, pulling a docker image etc, and only counts + wall-time for the execution of the command line itself. + + """ def __eq__(self, other: Any) -> bool: if isinstance(other, ToolTimeLimit): @@ -19052,8 +19133,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "ToolTimeLimit": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -19082,7 +19163,7 @@ def fromDoc( timelimit = load_field( _doc.get("timelimit"), - union_of_inttype_or_ExpressionLoader, + union_of_inttype_or_inttype_or_ExpressionLoader, baseuri, loadingOptions, lc=_doc.get("timelimit") @@ -19124,7 +19205,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -19190,23 +19271,11 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "timelimit"]) - - -class ExpressionToolOutputParameter(OutputParameter): - id: str - def __init__( self, - id: Any, - type_: Any, - label: Optional[Any] = None, - secondaryFiles: Optional[Any] = None, - streamable: Optional[Any] = None, - doc: Optional[Any] = None, - format: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + timelimit: i32 | str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -19216,13 +19285,14 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.format = format - self.type_ = type_ + self.class_: Final[str] = "ToolTimeLimit" + self.timelimit: i32 | str = timelimit + + attrs: ClassVar[Collection[str]] = frozenset(["class", "timelimit"]) + + +class ExpressionToolOutputParameter(OutputParameter): + id: str def __eq__(self, other: Any) -> bool: if isinstance(other, ExpressionToolOutputParameter): @@ -19256,8 +19326,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "ExpressionToolOutputParameter": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -19603,7 +19673,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -19628,11 +19698,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + id=cast(str, id), label=label, secondaryFiles=secondaryFiles, streamable=streamable, doc=doc, - id=id, format=format, type_=type_, extension_fields=extension_fields, @@ -19693,29 +19763,17 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( - ["label", "secondaryFiles", "streamable", "doc", "id", "format", "type"] - ) - - -class WorkflowInputParameter(InputParameter): - id: str - def __init__( self, - id: Any, - type_: Any, - label: Optional[Any] = None, - secondaryFiles: Optional[Any] = None, - streamable: Optional[Any] = None, - doc: Optional[Any] = None, - format: Optional[Any] = None, - loadContents: Optional[Any] = None, - loadListing: Optional[Any] = None, - default: Optional[Any] = None, - inputBinding: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + id: str, + type_: Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str, + label: None | str = None, + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = None, + streamable: None | bool = None, + doc: None | Sequence[str] | str = None, + format: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -19725,17 +19783,21 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.format = format - self.loadContents = loadContents - self.loadListing = loadListing - self.default = default - self.type_ = type_ - self.inputBinding = inputBinding + self.label: None | str = label + self.secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = secondaryFiles + self.streamable: None | bool = streamable + self.doc: None | Sequence[str] | str = doc + self.id: str = id + self.format: None | str = format + self.type_: Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str = type_ + + attrs: ClassVar[Collection[str]] = frozenset( + ["label", "secondaryFiles", "streamable", "doc", "id", "format", "type"] + ) + + +class WorkflowInputParameter(InputParameter): + id: str def __eq__(self, other: Any) -> bool: if isinstance(other, WorkflowInputParameter): @@ -19777,8 +19839,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "WorkflowInputParameter": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -20312,7 +20374,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -20337,11 +20399,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + id=cast(str, id), label=label, secondaryFiles=secondaryFiles, streamable=streamable, doc=doc, - id=id, format=format, loadContents=loadContents, loadListing=loadListing, @@ -20431,7 +20493,43 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + id: str, + type_: InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str, + label: None | str = None, + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = None, + streamable: None | bool = None, + doc: None | Sequence[str] | str = None, + format: None | Sequence[str] | str = None, + loadContents: None | bool = None, + loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = None, + default: CWLObjectType | None = None, + inputBinding: InputBinding | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.label: None | str = label + self.secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = secondaryFiles + self.streamable: None | bool = streamable + self.doc: None | Sequence[str] | str = doc + self.id: str = id + self.format: None | Sequence[str] | str = format + self.loadContents: None | bool = loadContents + self.loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = loadListing + self.default: CWLObjectType | None = default + self.type_: InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str = type_ + self.inputBinding: InputBinding | None = inputBinding + + attrs: ClassVar[Collection[str]] = frozenset( [ "label", "secondaryFiles", @@ -20462,41 +20560,6 @@ class ExpressionTool(Process): id: str - def __init__( - self, - inputs: Any, - outputs: Any, - expression: Any, - id: Optional[Any] = None, - label: Optional[Any] = None, - doc: Optional[Any] = None, - requirements: Optional[Any] = None, - hints: Optional[Any] = None, - cwlVersion: Optional[Any] = None, - intent: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.label = label - self.doc = doc - self.inputs = inputs - self.outputs = outputs - self.requirements = requirements - self.hints = hints - self.cwlVersion = cwlVersion - self.intent = intent - self.class_ = "ExpressionTool" - self.expression = expression - def __eq__(self, other: Any) -> bool: if isinstance(other, ExpressionTool): return bool( @@ -20537,8 +20600,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "ExpressionTool": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -21043,7 +21106,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -21068,7 +21131,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=id, + id=cast(str, id), label=label, doc=doc, inputs=inputs, @@ -21155,7 +21218,42 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + inputs: Sequence[WorkflowInputParameter], + outputs: Sequence[ExpressionToolOutputParameter], + expression: str, + id: None | str = None, + label: None | str = None, + doc: None | Sequence[str] | str = None, + requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | Loop | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = None, + hints: None | Sequence[Any | CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | Loop | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = None, + cwlVersion: Literal["v1.2"] | None = None, + intent: None | Sequence[str] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.id: str = id if id is not None else "_:" + str(_uuid__.uuid4()) + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + self.inputs: Sequence[WorkflowInputParameter] = inputs + self.outputs: Sequence[ExpressionToolOutputParameter] = outputs + self.requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | Loop | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = requirements + self.hints: None | Sequence[Any | CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | Loop | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = hints + self.cwlVersion: Literal["v1.2"] | None = cwlVersion + self.intent: None | Sequence[str] = intent + self.class_: Final[str] = "ExpressionTool" + self.expression: str = expression + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "label", @@ -21186,40 +21284,6 @@ class WorkflowOutputParameter(OutputParameter): id: str - def __init__( - self, - id: Any, - type_: Any, - label: Optional[Any] = None, - secondaryFiles: Optional[Any] = None, - streamable: Optional[Any] = None, - doc: Optional[Any] = None, - format: Optional[Any] = None, - outputSource: Optional[Any] = None, - linkMerge: Optional[Any] = None, - pickValue: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.format = format - self.outputSource = outputSource - self.linkMerge = linkMerge - self.pickValue = pickValue - self.type_ = type_ - def __eq__(self, other: Any) -> bool: if isinstance(other, WorkflowOutputParameter): return bool( @@ -21258,8 +21322,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "WorkflowOutputParameter": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -21746,7 +21810,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -21771,11 +21835,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + id=cast(str, id), label=label, secondaryFiles=secondaryFiles, streamable=streamable, doc=doc, - id=id, format=format, outputSource=outputSource, linkMerge=linkMerge, @@ -21850,7 +21914,41 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + id: str, + type_: Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str, + label: None | str = None, + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = None, + streamable: None | bool = None, + doc: None | Sequence[str] | str = None, + format: None | str = None, + outputSource: None | Sequence[str] | str = None, + linkMerge: Literal["merge_nested", "merge_flattened"] | None = None, + pickValue: Literal["first_non_null", "the_only_non_null", "all_non_null"] | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.label: None | str = label + self.secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = secondaryFiles + self.streamable: None | bool = streamable + self.doc: None | Sequence[str] | str = doc + self.id: str = id + self.format: None | str = format + self.outputSource: None | Sequence[str] | str = outputSource + self.linkMerge: Literal["merge_nested", "merge_flattened"] | None = linkMerge + self.pickValue: Literal["first_non_null", "the_only_non_null", "all_non_null"] | None = pickValue + self.type_: Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str = type_ + + attrs: ClassVar[Collection[str]] = frozenset( [ "label", "secondaryFiles", @@ -21866,8 +21964,11 @@ def save( ) -class Sink(Saveable): - pass +@trait +class Sink(Saveable, metaclass=ABCMeta): + source: None | Sequence[str] | str + linkMerge: Literal["merge_nested", "merge_flattened"] | None + pickValue: Literal["first_non_null", "the_only_non_null", "all_non_null"] | None class WorkflowStepInput(IdentifierRequired, Sink, LoadContents, Labeled): @@ -21985,38 +22086,6 @@ class WorkflowStepInput(IdentifierRequired, Sink, LoadContents, Labeled): id: str - def __init__( - self, - id: Any, - source: Optional[Any] = None, - linkMerge: Optional[Any] = None, - pickValue: Optional[Any] = None, - loadContents: Optional[Any] = None, - loadListing: Optional[Any] = None, - label: Optional[Any] = None, - default: Optional[Any] = None, - valueFrom: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.source = source - self.linkMerge = linkMerge - self.pickValue = pickValue - self.loadContents = loadContents - self.loadListing = loadListing - self.label = label - self.default = default - self.valueFrom = valueFrom - def __eq__(self, other: Any) -> bool: if isinstance(other, WorkflowStepInput): return bool( @@ -22053,8 +22122,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "WorkflowStepInput": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -22493,7 +22562,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -22518,7 +22587,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=id, + id=cast(str, id), source=source, linkMerge=linkMerge, pickValue=pickValue, @@ -22593,7 +22662,39 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + id: str, + source: None | Sequence[str] | str = None, + linkMerge: Literal["merge_nested", "merge_flattened"] | None = None, + pickValue: Literal["first_non_null", "the_only_non_null", "all_non_null"] | None = None, + loadContents: None | bool = None, + loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = None, + label: None | str = None, + default: CWLObjectType | None = None, + valueFrom: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.id: str = id + self.source: None | Sequence[str] | str = source + self.linkMerge: Literal["merge_nested", "merge_flattened"] | None = linkMerge + self.pickValue: Literal["first_non_null", "the_only_non_null", "all_non_null"] | None = pickValue + self.loadContents: None | bool = loadContents + self.loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = loadListing + self.label: None | str = label + self.default: CWLObjectType | None = default + self.valueFrom: None | str = valueFrom + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "source", @@ -22623,22 +22724,6 @@ class WorkflowStepOutput(IdentifierRequired): id: str - def __init__( - self, - id: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - def __eq__(self, other: Any) -> bool: if isinstance(other, WorkflowStepOutput): return bool(self.id == other.id) @@ -22653,8 +22738,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "WorkflowStepOutput": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -22717,7 +22802,7 @@ def fromDoc( _errors__.append(ValidationException("missing id")) if not __original_id_is_none: baseuri = cast(str, id) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -22740,7 +22825,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=id, + id=cast(str, id), extension_fields=extension_fields, loadingOptions=loadingOptions, ) @@ -22770,7 +22855,23 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["id"]) + def __init__( + self, + id: str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.id: str = id + + attrs: ClassVar[Collection[str]] = frozenset(["id"]) class WorkflowStep(IdentifierRequired, Labeled, Documented): @@ -22859,42 +22960,6 @@ class WorkflowStep(IdentifierRequired, Labeled, Documented): id: str - def __init__( - self, - id: Any, - in_: Any, - out: Any, - run: Any, - label: Optional[Any] = None, - doc: Optional[Any] = None, - requirements: Optional[Any] = None, - hints: Optional[Any] = None, - when: Optional[Any] = None, - scatter: Optional[Any] = None, - scatterMethod: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.label = label - self.doc = doc - self.in_ = in_ - self.out = out - self.requirements = requirements - self.hints = hints - self.run = run - self.when = when - self.scatter = scatter - self.scatterMethod = scatterMethod - def __eq__(self, other: Any) -> bool: if isinstance(other, WorkflowStep): return bool( @@ -22935,8 +23000,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "WorkflowStep": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -23474,7 +23539,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -23499,7 +23564,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=id, + id=cast(str, id), label=label, doc=doc, in_=in_, @@ -23580,7 +23645,43 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + id: str, + in_: Sequence[WorkflowStepInput], + out: Sequence[WorkflowStepOutput | str], + run: CommandLineTool | ExpressionTool | Operation | ProcessGenerator | Workflow | str, + label: None | str = None, + doc: None | Sequence[str] | str = None, + requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | Loop | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = None, + hints: None | Sequence[Any] = None, + when: None | str = None, + scatter: None | Sequence[str] | str = None, + scatterMethod: Literal["dotproduct", "nested_crossproduct", "flat_crossproduct"] | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.id: str = id + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + self.in_: Sequence[WorkflowStepInput] = in_ + self.out: Sequence[WorkflowStepOutput | str] = out + self.requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | Loop | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = requirements + self.hints: None | Sequence[Any] = hints + self.run: CommandLineTool | ExpressionTool | Operation | ProcessGenerator | Workflow | str = run + self.when: None | str = when + self.scatter: None | Sequence[str] | str = scatter + self.scatterMethod: Literal["dotproduct", "nested_crossproduct", "flat_crossproduct"] | None = scatterMethod + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "label", @@ -23655,41 +23756,6 @@ class Workflow(Process): id: str - def __init__( - self, - inputs: Any, - outputs: Any, - steps: Any, - id: Optional[Any] = None, - label: Optional[Any] = None, - doc: Optional[Any] = None, - requirements: Optional[Any] = None, - hints: Optional[Any] = None, - cwlVersion: Optional[Any] = None, - intent: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.label = label - self.doc = doc - self.inputs = inputs - self.outputs = outputs - self.requirements = requirements - self.hints = hints - self.cwlVersion = cwlVersion - self.intent = intent - self.class_ = "Workflow" - self.steps = steps - def __eq__(self, other: Any) -> bool: if isinstance(other, Workflow): return bool( @@ -23730,8 +23796,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "Workflow": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -24236,7 +24302,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -24261,7 +24327,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=id, + id=cast(str, id), label=label, doc=doc, inputs=inputs, @@ -24345,7 +24411,42 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + inputs: Sequence[WorkflowInputParameter], + outputs: Sequence[WorkflowOutputParameter], + steps: Sequence[WorkflowStep], + id: None | str = None, + label: None | str = None, + doc: None | Sequence[str] | str = None, + requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | Loop | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = None, + hints: None | Sequence[Any | CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | Loop | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = None, + cwlVersion: Literal["v1.2"] | None = None, + intent: None | Sequence[str] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.id: str = id if id is not None else "_:" + str(_uuid__.uuid4()) + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + self.inputs: Sequence[WorkflowInputParameter] = inputs + self.outputs: Sequence[WorkflowOutputParameter] = outputs + self.requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | Loop | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = requirements + self.hints: None | Sequence[Any | CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | Loop | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = hints + self.cwlVersion: Literal["v1.2"] | None = cwlVersion + self.intent: None | Sequence[str] = intent + self.class_: Final[str] = "Workflow" + self.steps: Sequence[WorkflowStep] = steps + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "label", @@ -24369,21 +24470,6 @@ class SubworkflowFeatureRequirement(ProcessRequirement): """ - def __init__( - self, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "SubworkflowFeatureRequirement" - def __eq__(self, other: Any) -> bool: if isinstance(other, SubworkflowFeatureRequirement): return bool(self.class_ == other.class_) @@ -24398,8 +24484,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "SubworkflowFeatureRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -24422,7 +24508,7 @@ def fromDoc( raise ValidationException(f"tried `{cls.__name__}` but") except ValidationException as e: raise e - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -24478,20 +24564,10 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class"]) - - -class ScatterFeatureRequirement(ProcessRequirement): - """ - Indicates that the workflow platform must support the `scatter` and - `scatterMethod` fields of [WorkflowStep](#WorkflowStep). - - """ - def __init__( self, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -24501,7 +24577,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "ScatterFeatureRequirement" + self.class_: Final[str] = "SubworkflowFeatureRequirement" + + attrs: ClassVar[Collection[str]] = frozenset(["class"]) + + +class ScatterFeatureRequirement(ProcessRequirement): + """ + Indicates that the workflow platform must support the `scatter` and + `scatterMethod` fields of [WorkflowStep](#WorkflowStep). + + """ def __eq__(self, other: Any) -> bool: if isinstance(other, ScatterFeatureRequirement): @@ -24517,8 +24603,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "ScatterFeatureRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -24541,7 +24627,7 @@ def fromDoc( raise ValidationException(f"tried `{cls.__name__}` but") except ValidationException as e: raise e - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -24597,20 +24683,10 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class"]) - - -class MultipleInputFeatureRequirement(ProcessRequirement): - """ - Indicates that the workflow platform must support multiple inbound data links - listed in the `source` field of [WorkflowStepInput](#WorkflowStepInput). - - """ - def __init__( self, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -24620,7 +24696,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "MultipleInputFeatureRequirement" + self.class_: Final[str] = "ScatterFeatureRequirement" + + attrs: ClassVar[Collection[str]] = frozenset(["class"]) + + +class MultipleInputFeatureRequirement(ProcessRequirement): + """ + Indicates that the workflow platform must support multiple inbound data links + listed in the `source` field of [WorkflowStepInput](#WorkflowStepInput). + + """ def __eq__(self, other: Any) -> bool: if isinstance(other, MultipleInputFeatureRequirement): @@ -24636,8 +24722,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "MultipleInputFeatureRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -24660,7 +24746,7 @@ def fromDoc( raise ValidationException(f"tried `{cls.__name__}` but") except ValidationException as e: raise e - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -24716,20 +24802,10 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class"]) - - -class StepInputExpressionRequirement(ProcessRequirement): - """ - Indicate that the workflow platform must support the `valueFrom` field - of [WorkflowStepInput](#WorkflowStepInput). - - """ - def __init__( self, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -24739,7 +24815,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "StepInputExpressionRequirement" + self.class_: Final[str] = "MultipleInputFeatureRequirement" + + attrs: ClassVar[Collection[str]] = frozenset(["class"]) + + +class StepInputExpressionRequirement(ProcessRequirement): + """ + Indicate that the workflow platform must support the `valueFrom` field + of [WorkflowStepInput](#WorkflowStepInput). + + """ def __eq__(self, other: Any) -> bool: if isinstance(other, StepInputExpressionRequirement): @@ -24755,8 +24841,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "StepInputExpressionRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -24779,7 +24865,7 @@ def fromDoc( raise ValidationException(f"tried `{cls.__name__}` but") except ValidationException as e: raise e - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -24833,33 +24919,12 @@ def save( r["$namespaces"] = self.loadingOptions.namespaces if self.loadingOptions.schemas: r["$schemas"] = self.loadingOptions.schemas - return r - - attrs = frozenset(["class"]) - - -class OperationInputParameter(InputParameter): - """ - Describe an input parameter of an operation. - - """ - - id: str + return r def __init__( self, - id: Any, - type_: Any, - label: Optional[Any] = None, - secondaryFiles: Optional[Any] = None, - streamable: Optional[Any] = None, - doc: Optional[Any] = None, - format: Optional[Any] = None, - loadContents: Optional[Any] = None, - loadListing: Optional[Any] = None, - default: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -24869,16 +24934,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.format = format - self.loadContents = loadContents - self.loadListing = loadListing - self.default = default - self.type_ = type_ + self.class_: Final[str] = "StepInputExpressionRequirement" + + attrs: ClassVar[Collection[str]] = frozenset(["class"]) + + +class OperationInputParameter(InputParameter): + """ + Describe an input parameter of an operation. + + """ + + id: str def __eq__(self, other: Any) -> bool: if isinstance(other, OperationInputParameter): @@ -24918,8 +24985,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "OperationInputParameter": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -25406,7 +25473,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -25431,11 +25498,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + id=cast(str, id), label=label, secondaryFiles=secondaryFiles, streamable=streamable, doc=doc, - id=id, format=format, loadContents=loadContents, loadListing=loadListing, @@ -25517,7 +25584,41 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + id: str, + type_: InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str, + label: None | str = None, + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = None, + streamable: None | bool = None, + doc: None | Sequence[str] | str = None, + format: None | Sequence[str] | str = None, + loadContents: None | bool = None, + loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = None, + default: CWLObjectType | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.label: None | str = label + self.secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = secondaryFiles + self.streamable: None | bool = streamable + self.doc: None | Sequence[str] | str = doc + self.id: str = id + self.format: None | Sequence[str] | str = format + self.loadContents: None | bool = loadContents + self.loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = loadListing + self.default: CWLObjectType | None = default + self.type_: InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | Sequence[InputArraySchema | InputEnumSchema | InputRecordSchema | Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | str] | str = type_ + + attrs: ClassVar[Collection[str]] = frozenset( [ "label", "secondaryFiles", @@ -25541,34 +25642,6 @@ class OperationOutputParameter(OutputParameter): id: str - def __init__( - self, - id: Any, - type_: Any, - label: Optional[Any] = None, - secondaryFiles: Optional[Any] = None, - streamable: Optional[Any] = None, - doc: Optional[Any] = None, - format: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.format = format - self.type_ = type_ - def __eq__(self, other: Any) -> bool: if isinstance(other, OperationOutputParameter): return bool( @@ -25601,8 +25674,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "OperationOutputParameter": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -25948,7 +26021,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -25973,11 +26046,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + id=cast(str, id), label=label, secondaryFiles=secondaryFiles, streamable=streamable, doc=doc, - id=id, format=format, type_=type_, extension_fields=extension_fields, @@ -26038,7 +26111,35 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + id: str, + type_: Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str, + label: None | str = None, + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = None, + streamable: None | bool = None, + doc: None | Sequence[str] | str = None, + format: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.label: None | str = label + self.secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = secondaryFiles + self.streamable: None | bool = streamable + self.doc: None | Sequence[str] | str = doc + self.id: str = id + self.format: None | str = format + self.type_: Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[Literal["null", "boolean", "int", "long", "float", "double", "string", "File", "Directory"] | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str = type_ + + attrs: ClassVar[Collection[str]] = frozenset( ["label", "secondaryFiles", "streamable", "doc", "id", "format", "type"] ) @@ -26057,39 +26158,6 @@ class Operation(Process): id: str - def __init__( - self, - inputs: Any, - outputs: Any, - id: Optional[Any] = None, - label: Optional[Any] = None, - doc: Optional[Any] = None, - requirements: Optional[Any] = None, - hints: Optional[Any] = None, - cwlVersion: Optional[Any] = None, - intent: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.label = label - self.doc = doc - self.inputs = inputs - self.outputs = outputs - self.requirements = requirements - self.hints = hints - self.cwlVersion = cwlVersion - self.intent = intent - self.class_ = "Operation" - def __eq__(self, other: Any) -> bool: if isinstance(other, Operation): return bool( @@ -26128,8 +26196,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "Operation": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -26586,7 +26654,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -26611,7 +26679,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=id, + id=cast(str, id), label=label, doc=doc, inputs=inputs, @@ -26690,7 +26758,40 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + inputs: Sequence[OperationInputParameter], + outputs: Sequence[OperationOutputParameter], + id: None | str = None, + label: None | str = None, + doc: None | Sequence[str] | str = None, + requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | Loop | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = None, + hints: None | Sequence[Any | CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | Loop | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = None, + cwlVersion: Literal["v1.2"] | None = None, + intent: None | Sequence[str] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.id: str = id if id is not None else "_:" + str(_uuid__.uuid4()) + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + self.inputs: Sequence[OperationInputParameter] = inputs + self.outputs: Sequence[OperationOutputParameter] = outputs + self.requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | Loop | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = requirements + self.hints: None | Sequence[Any | CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | Loop | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = hints + self.cwlVersion: Literal["v1.2"] | None = cwlVersion + self.intent: None | Sequence[str] = intent + self.class_: Final[str] = "Operation" + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "label", @@ -26707,23 +26808,6 @@ def save( class Secrets(ProcessRequirement): - def __init__( - self, - secrets: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "Secrets" - self.secrets = secrets - def __eq__(self, other: Any) -> bool: if isinstance(other, Secrets): return bool(self.class_ == other.class_ and self.secrets == other.secrets) @@ -26738,8 +26822,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "Secrets": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -26810,7 +26894,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -26872,26 +26956,11 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "secrets"]) - - -class ProcessGenerator(Process): - id: str - def __init__( self, - inputs: Any, - outputs: Any, - run: Any, - id: Optional[Any] = None, - label: Optional[Any] = None, - doc: Optional[Any] = None, - requirements: Optional[Any] = None, - hints: Optional[Any] = None, - cwlVersion: Optional[Any] = None, - intent: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + secrets: Sequence[str], + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -26901,17 +26970,14 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.label = label - self.doc = doc - self.inputs = inputs - self.outputs = outputs - self.requirements = requirements - self.hints = hints - self.cwlVersion = cwlVersion - self.intent = intent - self.class_ = "ProcessGenerator" - self.run = run + self.class_: Final[str] = "Secrets" + self.secrets: Sequence[str] = secrets + + attrs: ClassVar[Collection[str]] = frozenset(["class", "secrets"]) + + +class ProcessGenerator(Process): + id: str def __eq__(self, other: Any) -> bool: if isinstance(other, ProcessGenerator): @@ -26953,8 +27019,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "ProcessGenerator": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -27133,7 +27199,7 @@ def fromDoc( inputs = load_field( _doc.get("inputs"), - idmap_inputs_array_of_union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader_or_OperationInputParameterLoader, + idmap_inputs_array_of_WorkflowInputParameterLoader, baseuri, loadingOptions, lc=_doc.get("inputs") @@ -27181,7 +27247,7 @@ def fromDoc( outputs = load_field( _doc.get("outputs"), - idmap_outputs_array_of_union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader_or_OperationOutputParameterLoader, + idmap_outputs_array_of_ExpressionToolOutputParameterLoader, baseuri, loadingOptions, lc=_doc.get("outputs") @@ -27461,7 +27527,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -27486,7 +27552,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=id, + id=cast(str, id), label=label, doc=doc, inputs=inputs, @@ -27569,7 +27635,42 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + inputs: Sequence[WorkflowInputParameter], + outputs: Sequence[ExpressionToolOutputParameter], + run: CommandLineTool | ExpressionTool | Operation | ProcessGenerator | Workflow | str, + id: None | str = None, + label: None | str = None, + doc: None | Sequence[str] | str = None, + requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | Loop | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = None, + hints: None | Sequence[Any | CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | Loop | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = None, + cwlVersion: Literal["v1.2"] | None = None, + intent: None | Sequence[str] = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.id: str = id if id is not None else "_:" + str(_uuid__.uuid4()) + self.label: None | str = label + self.doc: None | Sequence[str] | str = doc + self.inputs: Sequence[WorkflowInputParameter] = inputs + self.outputs: Sequence[ExpressionToolOutputParameter] = outputs + self.requirements: None | Sequence[CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | Loop | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = requirements + self.hints: None | Sequence[Any | CUDARequirement | DockerRequirement | EnvVarRequirement | InitialWorkDirRequirement | InlineJavascriptRequirement | InplaceUpdateRequirement | LoadListingRequirement | Loop | MPIRequirement | MultipleInputFeatureRequirement | NetworkAccess | ResourceRequirement | ScatterFeatureRequirement | SchemaDefRequirement | Secrets | ShellCommandRequirement | ShmSize | SoftwareRequirement | StepInputExpressionRequirement | SubworkflowFeatureRequirement | ToolTimeLimit | WorkReuse] = hints + self.cwlVersion: Literal["v1.2"] | None = cwlVersion + self.intent: None | Sequence[str] = intent + self.class_: Final[str] = "ProcessGenerator" + self.run: CommandLineTool | ExpressionTool | Operation | ProcessGenerator | Workflow | str = run + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "label", @@ -27592,23 +27693,6 @@ class MPIRequirement(ProcessRequirement): """ - def __init__( - self, - processes: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "MPIRequirement" - self.processes = processes - def __eq__(self, other: Any) -> bool: if isinstance(other, MPIRequirement): return bool( @@ -27625,8 +27709,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "MPIRequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -27697,7 +27781,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -27763,23 +27847,11 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "processes"]) - - -class CUDARequirement(ProcessRequirement): - """ - Require support for NVIDA CUDA (GPU hardware acceleration). - - """ - def __init__( self, - cudaComputeCapability: Any, - cudaVersionMin: Any, - cudaDeviceCountMax: Optional[Any] = None, - cudaDeviceCountMin: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + processes: i32 | str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -27789,11 +27861,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "CUDARequirement" - self.cudaComputeCapability = cudaComputeCapability - self.cudaDeviceCountMax = cudaDeviceCountMax - self.cudaDeviceCountMin = cudaDeviceCountMin - self.cudaVersionMin = cudaVersionMin + self.class_: Final[str] = "MPIRequirement" + self.processes: i32 | str = processes + + attrs: ClassVar[Collection[str]] = frozenset(["class", "processes"]) + + +class CUDARequirement(ProcessRequirement): + """ + Require support for NVIDA CUDA (GPU hardware acceleration). + + """ def __eq__(self, other: Any) -> bool: if isinstance(other, CUDARequirement): @@ -27823,8 +27901,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "CUDARequirement": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -28037,7 +28115,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -28127,7 +28205,30 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + cudaComputeCapability: Sequence[str] | str, + cudaVersionMin: str, + cudaDeviceCountMax: None | i32 | str = None, + cudaDeviceCountMin: None | i32 | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "CUDARequirement" + self.cudaComputeCapability: Sequence[str] | str = cudaComputeCapability + self.cudaDeviceCountMax: None | i32 | str = cudaDeviceCountMax + self.cudaDeviceCountMin: None | i32 | str = cudaDeviceCountMin + self.cudaVersionMin: str = cudaVersionMin + + attrs: ClassVar[Collection[str]] = frozenset( [ "class", "cudaComputeCapability", @@ -28141,32 +28242,6 @@ def save( class LoopInput(Saveable): id: str - def __init__( - self, - default: Optional[Any] = None, - id: Optional[Any] = None, - linkMerge: Optional[Any] = None, - loopSource: Optional[Any] = None, - pickValue: Optional[Any] = None, - valueFrom: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.default = default - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) - self.linkMerge = linkMerge - self.loopSource = loopSource - self.pickValue = pickValue - self.valueFrom = valueFrom - def __eq__(self, other: Any) -> bool: if isinstance(other, LoopInput): return bool( @@ -28197,8 +28272,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "LoopInput": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -28496,7 +28571,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -28521,8 +28596,8 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( + id=cast(str, id), default=default, - id=id, linkMerge=linkMerge, loopSource=loopSource, pickValue=pickValue, @@ -28575,7 +28650,33 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + default: Any | None = None, + id: None | str = None, + linkMerge: Literal["merge_nested", "merge_flattened"] | None = None, + loopSource: None | Sequence[str] | str = None, + pickValue: Literal["first_non_null", "the_only_non_null", "all_non_null"] | None = None, + valueFrom: None | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.default: Any | None = default + self.id: str = id if id is not None else "_:" + str(_uuid__.uuid4()) + self.linkMerge: Literal["merge_nested", "merge_flattened"] | None = linkMerge + self.loopSource: None | Sequence[str] | str = loopSource + self.pickValue: Literal["first_non_null", "the_only_non_null", "all_non_null"] | None = pickValue + self.valueFrom: None | str = valueFrom + + attrs: ClassVar[Collection[str]] = frozenset( ["default", "id", "linkMerge", "loopSource", "pickValue", "valueFrom"] ) @@ -28597,27 +28698,6 @@ class Loop(ProcessRequirement): """ - def __init__( - self, - loop: Any, - loopWhen: Any, - outputMethod: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, - ) -> None: - if extension_fields: - self.extension_fields = extension_fields - else: - self.extension_fields = CommentedMap() - if loadingOptions: - self.loadingOptions = loadingOptions - else: - self.loadingOptions = LoadingOptions() - self.class_ = "Loop" - self.loop = loop - self.loopWhen = loopWhen - self.outputMethod = outputMethod - def __eq__(self, other: Any) -> bool: if isinstance(other, Loop): return bool( @@ -28637,8 +28717,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "Loop": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -28805,7 +28885,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -28881,15 +28961,13 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "loop", "loopWhen", "outputMethod"]) - - -class ShmSize(ProcessRequirement): def __init__( self, - shmSize: Any, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + loop: Sequence[LoopInput], + loopWhen: str, + outputMethod: Literal["last", "all"], + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -28899,9 +28977,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "ShmSize" - self.shmSize = shmSize + self.class_: Final[str] = "Loop" + self.loop: Sequence[LoopInput] = loop + self.loopWhen: str = loopWhen + self.outputMethod: Literal["last", "all"] = outputMethod + + attrs: ClassVar[Collection[str]] = frozenset( + ["class", "loop", "loopWhen", "outputMethod"] + ) + +class ShmSize(ProcessRequirement): def __eq__(self, other: Any) -> bool: if isinstance(other, ShmSize): return bool(self.class_ == other.class_ and self.shmSize == other.shmSize) @@ -28916,8 +29002,8 @@ def fromDoc( doc: Any, baseuri: str, loadingOptions: LoadingOptions, - docRoot: Optional[str] = None - ) -> "ShmSize": + docRoot: str | None = None + ) -> Self: _doc = copy.copy(doc) if hasattr(doc, "lc"): @@ -28988,7 +29074,7 @@ def fromDoc( "is not valid because:", ) ) - extension_fields: dict[str, Any] = {} + extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: if not k: @@ -29051,10 +29137,27 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "shmSize"]) + def __init__( + self, + shmSize: str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "ShmSize" + self.shmSize: str = shmSize + + attrs: ClassVar[Collection[str]] = frozenset(["class", "shmSize"]) -_vocab = { +_vocab.update({ "Any": "https://w3id.org/cwl/salad#Any", "ArraySchema": "https://w3id.org/cwl/salad#ArraySchema", "CUDARequirement": "http://commonwl.org/cwltool#CUDARequirement", @@ -29165,16 +29268,6 @@ def save( "deep_listing": "https://w3id.org/cwl/cwl#LoadListingEnum/deep_listing", "dotproduct": "https://w3id.org/cwl/cwl#ScatterMethod/dotproduct", "double": "http://www.w3.org/2001/XMLSchema#double", - "draft-2": "https://w3id.org/cwl/cwl#draft-2", - "draft-3": "https://w3id.org/cwl/cwl#draft-3", - "draft-3.dev1": "https://w3id.org/cwl/cwl#draft-3.dev1", - "draft-3.dev2": "https://w3id.org/cwl/cwl#draft-3.dev2", - "draft-3.dev3": "https://w3id.org/cwl/cwl#draft-3.dev3", - "draft-3.dev4": "https://w3id.org/cwl/cwl#draft-3.dev4", - "draft-3.dev5": "https://w3id.org/cwl/cwl#draft-3.dev5", - "draft-4.dev1": "https://w3id.org/cwl/cwl#draft-4.dev1", - "draft-4.dev2": "https://w3id.org/cwl/cwl#draft-4.dev2", - "draft-4.dev3": "https://w3id.org/cwl/cwl#draft-4.dev3", "enum": "https://w3id.org/cwl/salad#enum", "first_non_null": "https://w3id.org/cwl/cwl#PickValueMethod/first_non_null", "flat_crossproduct": "https://w3id.org/cwl/cwl#ScatterMethod/flat_crossproduct", @@ -29196,18 +29289,9 @@ def save( "string": "http://www.w3.org/2001/XMLSchema#string", "the_only_non_null": "https://w3id.org/cwl/cwl#PickValueMethod/the_only_non_null", "union": "https://w3id.org/cwl/salad#union", - "v1.0": "https://w3id.org/cwl/cwl#v1.0", - "v1.0.dev4": "https://w3id.org/cwl/cwl#v1.0.dev4", - "v1.1": "https://w3id.org/cwl/cwl#v1.1", - "v1.1.0-dev1": "https://w3id.org/cwl/cwl#v1.1.0-dev1", "v1.2": "https://w3id.org/cwl/cwl#v1.2", - "v1.2.0-dev1": "https://w3id.org/cwl/cwl#v1.2.0-dev1", - "v1.2.0-dev2": "https://w3id.org/cwl/cwl#v1.2.0-dev2", - "v1.2.0-dev3": "https://w3id.org/cwl/cwl#v1.2.0-dev3", - "v1.2.0-dev4": "https://w3id.org/cwl/cwl#v1.2.0-dev4", - "v1.2.0-dev5": "https://w3id.org/cwl/cwl#v1.2.0-dev5", -} -_rvocab = { +}) +_rvocab.update({ "https://w3id.org/cwl/salad#Any": "Any", "https://w3id.org/cwl/salad#ArraySchema": "ArraySchema", "http://commonwl.org/cwltool#CUDARequirement": "CUDARequirement", @@ -29318,16 +29402,6 @@ def save( "https://w3id.org/cwl/cwl#LoadListingEnum/deep_listing": "deep_listing", "https://w3id.org/cwl/cwl#ScatterMethod/dotproduct": "dotproduct", "http://www.w3.org/2001/XMLSchema#double": "double", - "https://w3id.org/cwl/cwl#draft-2": "draft-2", - "https://w3id.org/cwl/cwl#draft-3": "draft-3", - "https://w3id.org/cwl/cwl#draft-3.dev1": "draft-3.dev1", - "https://w3id.org/cwl/cwl#draft-3.dev2": "draft-3.dev2", - "https://w3id.org/cwl/cwl#draft-3.dev3": "draft-3.dev3", - "https://w3id.org/cwl/cwl#draft-3.dev4": "draft-3.dev4", - "https://w3id.org/cwl/cwl#draft-3.dev5": "draft-3.dev5", - "https://w3id.org/cwl/cwl#draft-4.dev1": "draft-4.dev1", - "https://w3id.org/cwl/cwl#draft-4.dev2": "draft-4.dev2", - "https://w3id.org/cwl/cwl#draft-4.dev3": "draft-4.dev3", "https://w3id.org/cwl/salad#enum": "enum", "https://w3id.org/cwl/cwl#PickValueMethod/first_non_null": "first_non_null", "https://w3id.org/cwl/cwl#ScatterMethod/flat_crossproduct": "flat_crossproduct", @@ -29349,25 +29423,17 @@ def save( "http://www.w3.org/2001/XMLSchema#string": "string", "https://w3id.org/cwl/cwl#PickValueMethod/the_only_non_null": "the_only_non_null", "https://w3id.org/cwl/salad#union": "union", - "https://w3id.org/cwl/cwl#v1.0": "v1.0", - "https://w3id.org/cwl/cwl#v1.0.dev4": "v1.0.dev4", - "https://w3id.org/cwl/cwl#v1.1": "v1.1", - "https://w3id.org/cwl/cwl#v1.1.0-dev1": "v1.1.0-dev1", "https://w3id.org/cwl/cwl#v1.2": "v1.2", - "https://w3id.org/cwl/cwl#v1.2.0-dev1": "v1.2.0-dev1", - "https://w3id.org/cwl/cwl#v1.2.0-dev2": "v1.2.0-dev2", - "https://w3id.org/cwl/cwl#v1.2.0-dev3": "v1.2.0-dev3", - "https://w3id.org/cwl/cwl#v1.2.0-dev4": "v1.2.0-dev4", - "https://w3id.org/cwl/cwl#v1.2.0-dev5": "v1.2.0-dev5", -} - -strtype = _PrimitiveLoader(str) -inttype = _PrimitiveLoader(int) -floattype = _PrimitiveLoader(float) -booltype = _PrimitiveLoader(bool) -None_type = _PrimitiveLoader(type(None)) -Any_type = _AnyLoader() -PrimitiveTypeLoader = _EnumLoader( +}) + +strtype: Final = _PrimitiveLoader(str) +inttype: Final = _PrimitiveLoader(i32) +floattype: Final = _PrimitiveLoader(float) +booltype: Final = _PrimitiveLoader(bool) +None_type: Final = _PrimitiveLoader(type(None)) +Any_type: Final = _AnyLoader() +longtype: Final = _PrimitiveLoader(i64) +PrimitiveTypeLoader: Final = _EnumLoader( ( "null", "boolean", @@ -29393,17 +29459,17 @@ def save( double: double precision (64-bit) IEEE 754 floating-point number string: Unicode character sequence """ -AnyLoader = _EnumLoader(("Any",), "Any") +AnyLoader: Final = _EnumLoader(("Any",), "Any") """ The **Any** type validates for any non-null value. """ -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( +RecordFieldLoader: Final = _RecordLoader(RecordField, None, None) +RecordSchemaLoader: Final = _RecordLoader(RecordSchema, None, None) +EnumSchemaLoader: Final = _RecordLoader(EnumSchema, None, None) +ArraySchemaLoader: Final = _RecordLoader(ArraySchema, None, None) +MapSchemaLoader: Final = _RecordLoader(MapSchema, None, None) +UnionSchemaLoader: Final = _RecordLoader(UnionSchema, None, None) +CWLTypeLoader: Final = _EnumLoader( ( "null", "boolean", @@ -29422,55 +29488,65 @@ def save( File: A File object Directory: A Directory object """ -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( +CWLArraySchemaLoader: Final = _RecordLoader(CWLArraySchema, None, None) +CWLRecordFieldLoader: Final = _RecordLoader(CWLRecordField, None, None) +CWLRecordSchemaLoader: Final = _RecordLoader(CWLRecordSchema, None, None) +FileLoader: Final = _RecordLoader(File, None, None) +DirectoryLoader: Final = _RecordLoader(Directory, None, None) +CWLObjectTypeLoader: Final = _UnionLoader((), "CWLObjectTypeLoader") +union_of_None_type_or_CWLObjectTypeLoader: Final = _UnionLoader( ( None_type, CWLObjectTypeLoader, ) ) -array_of_union_of_None_type_or_CWLObjectTypeLoader = _ArrayLoader( +array_of_union_of_None_type_or_CWLObjectTypeLoader: Final = _ArrayLoader( union_of_None_type_or_CWLObjectTypeLoader ) -map_of_union_of_None_type_or_CWLObjectTypeLoader = _MapLoader( +map_of_union_of_None_type_or_CWLObjectTypeLoader: Final = _MapLoader( union_of_None_type_or_CWLObjectTypeLoader, "None", None, None ) -InlineJavascriptRequirementLoader = _RecordLoader( +InlineJavascriptRequirementLoader: Final = _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( +SchemaDefRequirementLoader: Final = _RecordLoader(SchemaDefRequirement, None, None) +LoadListingRequirementLoader: Final = _RecordLoader(LoadListingRequirement, None, None) +DockerRequirementLoader: Final = _RecordLoader(DockerRequirement, None, None) +SoftwareRequirementLoader: Final = _RecordLoader(SoftwareRequirement, None, None) +InitialWorkDirRequirementLoader: Final = _RecordLoader( + InitialWorkDirRequirement, None, None +) +EnvVarRequirementLoader: Final = _RecordLoader(EnvVarRequirement, None, None) +ShellCommandRequirementLoader: Final = _RecordLoader( + ShellCommandRequirement, None, None +) +ResourceRequirementLoader: Final = _RecordLoader(ResourceRequirement, None, None) +WorkReuseLoader: Final = _RecordLoader(WorkReuse, None, None) +NetworkAccessLoader: Final = _RecordLoader(NetworkAccess, None, None) +InplaceUpdateRequirementLoader: Final = _RecordLoader( + InplaceUpdateRequirement, None, None +) +ToolTimeLimitLoader: Final = _RecordLoader(ToolTimeLimit, None, None) +SubworkflowFeatureRequirementLoader: Final = _RecordLoader( SubworkflowFeatureRequirement, None, None ) -ScatterFeatureRequirementLoader = _RecordLoader(ScatterFeatureRequirement, None, None) -MultipleInputFeatureRequirementLoader = _RecordLoader( +ScatterFeatureRequirementLoader: Final = _RecordLoader( + ScatterFeatureRequirement, None, None +) +MultipleInputFeatureRequirementLoader: Final = _RecordLoader( MultipleInputFeatureRequirement, None, None ) -StepInputExpressionRequirementLoader = _RecordLoader( +StepInputExpressionRequirementLoader: Final = _RecordLoader( StepInputExpressionRequirement, None, None ) -SecretsLoader = _RecordLoader(Secrets, None, None) -MPIRequirementLoader = _RecordLoader(MPIRequirement, None, None) -CUDARequirementLoader = _RecordLoader(CUDARequirement, None, None) -LoopLoader = _RecordLoader(Loop, None, None) -ShmSizeLoader = _RecordLoader(ShmSize, None, None) -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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_LoopLoader_or_ShmSizeLoader = _UnionLoader( +SecretsLoader: Final = _RecordLoader(Secrets, None, None) +MPIRequirementLoader: Final = _RecordLoader(MPIRequirement, None, None) +CUDARequirementLoader: Final = _RecordLoader(CUDARequirement, None, None) +LoopLoader: Final = _RecordLoader(Loop, None, None) +ShmSizeLoader: Final = _RecordLoader(ShmSize, None, None) +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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_LoopLoader_or_ShmSizeLoader: ( + Final +) = _UnionLoader( ( InlineJavascriptRequirementLoader, SchemaDefRequirementLoader, @@ -29496,52 +29572,36 @@ def save( ShmSizeLoader, ) ) -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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_LoopLoader_or_ShmSizeLoader = _ArrayLoader( +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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_LoopLoader_or_ShmSizeLoader: ( + Final +) = _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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_LoopLoader_or_ShmSizeLoader ) -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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_LoopLoader_or_ShmSizeLoader_or_CWLObjectTypeLoader = _UnionLoader( +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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_LoopLoader_or_ShmSizeLoader_or_CWLObjectTypeLoader: ( + Final +) = _UnionLoader( ( None_type, 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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_LoopLoader_or_ShmSizeLoader, CWLObjectTypeLoader, ) ) -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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_LoopLoader_or_ShmSizeLoader_or_CWLObjectTypeLoader = _MapLoader( +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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_LoopLoader_or_ShmSizeLoader_or_CWLObjectTypeLoader: ( + Final +) = _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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_LoopLoader_or_ShmSizeLoader_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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_LoopLoader_or_ShmSizeLoader_or_CWLObjectTypeLoader -CWLVersionLoader = _EnumLoader( - ( - "draft-2", - "draft-3.dev1", - "draft-3.dev2", - "draft-3.dev3", - "draft-3.dev4", - "draft-3.dev5", - "draft-3", - "draft-4.dev1", - "draft-4.dev2", - "draft-4.dev3", - "v1.0.dev4", - "v1.0", - "v1.1.0-dev1", - "v1.1", - "v1.2.0-dev1", - "v1.2.0-dev2", - "v1.2.0-dev3", - "v1.2.0-dev4", - "v1.2.0-dev5", - "v1.2", - ), - "CWLVersion", +CWLInputFileLoader: Final = ( + 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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_LoopLoader_or_ShmSizeLoader_or_CWLObjectTypeLoader ) +CWLVersionLoader: Final = _EnumLoader(("v1.2",), "CWLVersion") """ -Version symbols for published CWL document versions. +Current version symbol for CWL documents. """ -LoadListingEnumLoader = _EnumLoader( +LoadListingEnumLoader: Final = _EnumLoader( ( "no_listing", "shallow_listing", @@ -29557,31 +29617,45 @@ def save( shallow_listing: Only load the top level listing, do not recurse into subdirectories. deep_listing: Load the directory listing and recursively load all subdirectories as well. """ -ExpressionLoader = _ExpressionLoader(str) -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) -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") +ExpressionLoader: Final = _ExpressionLoader(str) +InputBindingLoader: Final = _RecordLoader(InputBinding, None, None) +InputRecordFieldLoader: Final = _RecordLoader(InputRecordField, None, None) +InputRecordSchemaLoader: Final = _RecordLoader(InputRecordSchema, None, None) +InputEnumSchemaLoader: Final = _RecordLoader(InputEnumSchema, None, None) +InputArraySchemaLoader: Final = _RecordLoader(InputArraySchema, None, None) +OutputRecordFieldLoader: Final = _RecordLoader(OutputRecordField, None, None) +OutputRecordSchemaLoader: Final = _RecordLoader(OutputRecordSchema, None, None) +OutputEnumSchemaLoader: Final = _RecordLoader(OutputEnumSchema, None, None) +OutputArraySchemaLoader: Final = _RecordLoader(OutputArraySchema, None, None) +SecondaryFileSchemaLoader: Final = _RecordLoader(SecondaryFileSchema, None, None) +EnvironmentDefLoader: Final = _RecordLoader(EnvironmentDef, None, None) +CommandLineBindingLoader: Final = _RecordLoader(CommandLineBinding, None, None) +CommandOutputBindingLoader: Final = _RecordLoader(CommandOutputBinding, None, None) +CommandInputRecordFieldLoader: Final = _RecordLoader( + CommandInputRecordField, None, None +) +CommandInputRecordSchemaLoader: Final = _RecordLoader( + CommandInputRecordSchema, None, None +) +CommandInputEnumSchemaLoader: Final = _RecordLoader(CommandInputEnumSchema, None, None) +CommandInputArraySchemaLoader: Final = _RecordLoader( + CommandInputArraySchema, None, None +) +CommandOutputRecordFieldLoader: Final = _RecordLoader( + CommandOutputRecordField, None, None +) +CommandOutputRecordSchemaLoader: Final = _RecordLoader( + CommandOutputRecordSchema, None, None +) +CommandOutputEnumSchemaLoader: Final = _RecordLoader( + CommandOutputEnumSchema, None, None +) +CommandOutputArraySchemaLoader: Final = _RecordLoader( + CommandOutputArraySchema, None, None +) +CommandInputParameterLoader: Final = _RecordLoader(CommandInputParameter, None, None) +CommandOutputParameterLoader: Final = _RecordLoader(CommandOutputParameter, None, None) +stdinLoader: Final = _EnumLoader(("stdin",), "stdin") """ Only valid as a `type` for a `CommandLineTool` input with no `inputBinding` set. `stdin` must not be specified at the `CommandLineTool` @@ -29603,7 +29677,7 @@ def save( stdin: $(inputs.an_input_name.path) ``` """ -stdoutLoader = _EnumLoader(("stdout",), "stdout") +stdoutLoader: Final = _EnumLoader(("stdout",), "stdout") """ Only valid as a `type` for a `CommandLineTool` output with no `outputBinding` set. @@ -29651,7 +29725,7 @@ def save( (e.g. `echo a && echo b`) `stdout` must include the output of every command. """ -stderrLoader = _EnumLoader(("stderr",), "stderr") +stderrLoader: Final = _EnumLoader(("stderr",), "stderr") """ Only valid as a `type` for a `CommandLineTool` output with no `outputBinding` set. @@ -29695,15 +29769,15 @@ def save( stderr: random_stderr_filenameABCDEFG ``` """ -CommandLineToolLoader = _RecordLoader(CommandLineTool, None, None) -SoftwarePackageLoader = _RecordLoader(SoftwarePackage, None, None) -DirentLoader = _RecordLoader(Dirent, None, None) -ExpressionToolOutputParameterLoader = _RecordLoader( +CommandLineToolLoader: Final = _RecordLoader(CommandLineTool, None, None) +SoftwarePackageLoader: Final = _RecordLoader(SoftwarePackage, None, None) +DirentLoader: Final = _RecordLoader(Dirent, None, None) +ExpressionToolOutputParameterLoader: Final = _RecordLoader( ExpressionToolOutputParameter, None, None ) -WorkflowInputParameterLoader = _RecordLoader(WorkflowInputParameter, None, None) -ExpressionToolLoader = _RecordLoader(ExpressionTool, None, None) -LinkMergeMethodLoader = _EnumLoader( +WorkflowInputParameterLoader: Final = _RecordLoader(WorkflowInputParameter, None, None) +ExpressionToolLoader: Final = _RecordLoader(ExpressionTool, None, None) +LinkMergeMethodLoader: Final = _EnumLoader( ( "merge_nested", "merge_flattened", @@ -29713,7 +29787,7 @@ def save( """ The input link merge method, described in [WorkflowStepInput](#WorkflowStepInput). """ -PickValueMethodLoader = _EnumLoader( +PickValueMethodLoader: Final = _EnumLoader( ( "first_non_null", "the_only_non_null", @@ -29724,10 +29798,12 @@ def save( """ Picking non-null values among inbound data links, described in [WorkflowStepInput](#WorkflowStepInput). """ -WorkflowOutputParameterLoader = _RecordLoader(WorkflowOutputParameter, None, None) -WorkflowStepInputLoader = _RecordLoader(WorkflowStepInput, None, None) -WorkflowStepOutputLoader = _RecordLoader(WorkflowStepOutput, None, None) -ScatterMethodLoader = _EnumLoader( +WorkflowOutputParameterLoader: Final = _RecordLoader( + WorkflowOutputParameter, None, None +) +WorkflowStepInputLoader: Final = _RecordLoader(WorkflowStepInput, None, None) +WorkflowStepOutputLoader: Final = _RecordLoader(WorkflowStepOutput, None, None) +ScatterMethodLoader: Final = _EnumLoader( ( "dotproduct", "nested_crossproduct", @@ -29738,23 +29814,29 @@ def save( """ The scatter method, as described in [workflow step scatter](#WorkflowStep). """ -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) -ProcessGeneratorLoader = _RecordLoader(ProcessGenerator, None, None) -LoopInputLoader = _RecordLoader(LoopInput, None, None) -array_of_strtype = _ArrayLoader(strtype) -union_of_None_type_or_strtype_or_array_of_strtype = _UnionLoader( +WorkflowStepLoader: Final = _RecordLoader(WorkflowStep, None, None) +WorkflowLoader: Final = _RecordLoader(Workflow, None, None) +OperationInputParameterLoader: Final = _RecordLoader( + OperationInputParameter, None, None +) +OperationOutputParameterLoader: Final = _RecordLoader( + OperationOutputParameter, None, None +) +OperationLoader: Final = _RecordLoader(Operation, None, None) +ProcessGeneratorLoader: Final = _RecordLoader(ProcessGenerator, None, None) +LoopInputLoader: Final = _RecordLoader(LoopInput, None, None) +array_of_strtype: Final = _ArrayLoader(strtype) +union_of_None_type_or_strtype_or_array_of_strtype: Final = _UnionLoader( ( None_type, strtype, array_of_strtype, ) ) -uri_strtype_True_False_None_None = _URILoader(strtype, True, False, None, None) -union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype = _UnionLoader( +uri_strtype_True_False_None_None: Final = _URILoader(strtype, True, False, None, None) +union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype: ( + Final +) = _UnionLoader( ( PrimitiveTypeLoader, RecordSchemaLoader, @@ -29765,10 +29847,14 @@ def save( strtype, ) ) -array_of_union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype = _ArrayLoader( +array_of_union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype: ( + Final +) = _ArrayLoader( 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( +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: ( + Final +) = _UnionLoader( ( PrimitiveTypeLoader, RecordSchemaLoader, @@ -29780,51 +29866,57 @@ def save( array_of_union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype, ) ) -typedsl_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_2 = _TypeDSLLoader( +typedsl_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_2: ( + Final +) = _TypeDSLLoader( 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, 2, "v1.1", ) -array_of_RecordFieldLoader = _ArrayLoader(RecordFieldLoader) -union_of_None_type_or_array_of_RecordFieldLoader = _UnionLoader( +array_of_RecordFieldLoader: Final = _ArrayLoader(RecordFieldLoader) +union_of_None_type_or_array_of_RecordFieldLoader: Final = _UnionLoader( ( None_type, array_of_RecordFieldLoader, ) ) -idmap_fields_union_of_None_type_or_array_of_RecordFieldLoader = _IdMapLoader( +idmap_fields_union_of_None_type_or_array_of_RecordFieldLoader: Final = _IdMapLoader( union_of_None_type_or_array_of_RecordFieldLoader, "name", "type" ) -Record_nameLoader = _EnumLoader(("record",), "Record_name") -typedsl_Record_nameLoader_2 = _TypeDSLLoader(Record_nameLoader, 2, "v1.1") -union_of_None_type_or_strtype = _UnionLoader( +Record_nameLoader: Final = _EnumLoader(("record",), "Record_name") +typedsl_Record_nameLoader_2: Final = _TypeDSLLoader(Record_nameLoader, 2, "v1.1") +union_of_None_type_or_strtype: Final = _UnionLoader( ( None_type, strtype, ) ) -uri_union_of_None_type_or_strtype_True_False_None_None = _URILoader( +uri_union_of_None_type_or_strtype_True_False_None_None: Final = _URILoader( union_of_None_type_or_strtype, True, False, None, None ) -uri_array_of_strtype_True_False_None_None = _URILoader( +uri_array_of_strtype_True_False_None_None: Final = _URILoader( array_of_strtype, True, False, None, None ) -Enum_nameLoader = _EnumLoader(("enum",), "Enum_name") -typedsl_Enum_nameLoader_2 = _TypeDSLLoader(Enum_nameLoader, 2, "v1.1") -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( +Enum_nameLoader: Final = _EnumLoader(("enum",), "Enum_name") +typedsl_Enum_nameLoader_2: Final = _TypeDSLLoader(Enum_nameLoader, 2, "v1.1") +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: ( + Final +) = _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, True, 2, None, ) -Array_nameLoader = _EnumLoader(("array",), "Array_name") -typedsl_Array_nameLoader_2 = _TypeDSLLoader(Array_nameLoader, 2, "v1.1") -Map_nameLoader = _EnumLoader(("map",), "Map_name") -typedsl_Map_nameLoader_2 = _TypeDSLLoader(Map_nameLoader, 2, "v1.1") -Union_nameLoader = _EnumLoader(("union",), "Union_name") -typedsl_Union_nameLoader_2 = _TypeDSLLoader(Union_nameLoader, 2, "v1.1") -union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype = _UnionLoader( +Array_nameLoader: Final = _EnumLoader(("array",), "Array_name") +typedsl_Array_nameLoader_2: Final = _TypeDSLLoader(Array_nameLoader, 2, "v1.1") +Map_nameLoader: Final = _EnumLoader(("map",), "Map_name") +typedsl_Map_nameLoader_2: Final = _TypeDSLLoader(Map_nameLoader, 2, "v1.1") +Union_nameLoader: Final = _EnumLoader(("union",), "Union_name") +typedsl_Union_nameLoader_2: Final = _TypeDSLLoader(Union_nameLoader, 2, "v1.1") +union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype: ( + Final +) = _UnionLoader( ( PrimitiveTypeLoader, CWLRecordSchemaLoader, @@ -29833,10 +29925,14 @@ def save( strtype, ) ) -array_of_union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype = _ArrayLoader( +array_of_union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype: ( + Final +) = _ArrayLoader( 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( +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: ( + Final +) = _UnionLoader( ( PrimitiveTypeLoader, CWLRecordSchemaLoader, @@ -29846,57 +29942,66 @@ def save( array_of_union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype, ) ) -uri_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_False_True_2_None = _URILoader( +uri_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_False_True_2_None: ( + Final +) = _URILoader( 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, False, True, 2, None, ) -typedsl_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_2 = _TypeDSLLoader( +typedsl_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_2: ( + Final +) = _TypeDSLLoader( 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, 2, "v1.1", ) -array_of_CWLRecordFieldLoader = _ArrayLoader(CWLRecordFieldLoader) -union_of_None_type_or_array_of_CWLRecordFieldLoader = _UnionLoader( +array_of_CWLRecordFieldLoader: Final = _ArrayLoader(CWLRecordFieldLoader) +union_of_None_type_or_array_of_CWLRecordFieldLoader: Final = _UnionLoader( ( None_type, array_of_CWLRecordFieldLoader, ) ) -idmap_fields_union_of_None_type_or_array_of_CWLRecordFieldLoader = _IdMapLoader( +idmap_fields_union_of_None_type_or_array_of_CWLRecordFieldLoader: Final = _IdMapLoader( union_of_None_type_or_array_of_CWLRecordFieldLoader, "name", "type" ) -File_classLoader = _EnumLoader(("File",), "File_class") -uri_File_classLoader_False_True_None_None = _URILoader( +File_classLoader: Final = _EnumLoader(("File",), "File_class") +uri_File_classLoader_False_True_None_None: Final = _URILoader( File_classLoader, False, True, None, None ) -uri_union_of_None_type_or_strtype_False_False_None_None = _URILoader( +uri_union_of_None_type_or_strtype_False_False_None_None: Final = _URILoader( union_of_None_type_or_strtype, False, False, None, None ) -union_of_None_type_or_inttype = _UnionLoader( +union_of_None_type_or_inttype_or_inttype: Final = _UnionLoader( ( None_type, inttype, + inttype, ) ) -union_of_FileLoader_or_DirectoryLoader = _UnionLoader( +union_of_FileLoader_or_DirectoryLoader: Final = _UnionLoader( ( FileLoader, DirectoryLoader, ) ) -array_of_union_of_FileLoader_or_DirectoryLoader = _ArrayLoader( +array_of_union_of_FileLoader_or_DirectoryLoader: Final = _ArrayLoader( union_of_FileLoader_or_DirectoryLoader ) -union_of_None_type_or_array_of_union_of_FileLoader_or_DirectoryLoader = _UnionLoader( - ( - None_type, - array_of_union_of_FileLoader_or_DirectoryLoader, +union_of_None_type_or_array_of_union_of_FileLoader_or_DirectoryLoader: Final = ( + _UnionLoader( + ( + None_type, + array_of_union_of_FileLoader_or_DirectoryLoader, + ) ) ) -secondaryfilesdsl_union_of_None_type_or_array_of_union_of_FileLoader_or_DirectoryLoader = _UnionLoader( +secondaryfilesdsl_union_of_None_type_or_array_of_union_of_FileLoader_or_DirectoryLoader: ( + Final +) = _UnionLoader( ( _SecondaryDSLLoader( union_of_None_type_or_array_of_union_of_FileLoader_or_DirectoryLoader @@ -29904,34 +30009,38 @@ def save( union_of_None_type_or_array_of_union_of_FileLoader_or_DirectoryLoader, ) ) -uri_union_of_None_type_or_strtype_True_False_None_True = _URILoader( +uri_union_of_None_type_or_strtype_True_False_None_True: Final = _URILoader( union_of_None_type_or_strtype, True, False, None, True ) -Directory_classLoader = _EnumLoader(("Directory",), "Directory_class") -uri_Directory_classLoader_False_True_None_None = _URILoader( +Directory_classLoader: Final = _EnumLoader(("Directory",), "Directory_class") +uri_Directory_classLoader_False_True_None_None: Final = _URILoader( Directory_classLoader, False, True, None, None ) -union_of_None_type_or_booltype = _UnionLoader( +union_of_None_type_or_booltype: Final = _UnionLoader( ( None_type, booltype, ) ) -union_of_None_type_or_LoadListingEnumLoader = _UnionLoader( +union_of_None_type_or_LoadListingEnumLoader: Final = _UnionLoader( ( None_type, LoadListingEnumLoader, ) ) -array_of_SecondaryFileSchemaLoader = _ArrayLoader(SecondaryFileSchemaLoader) -union_of_None_type_or_SecondaryFileSchemaLoader_or_array_of_SecondaryFileSchemaLoader = _UnionLoader( +array_of_SecondaryFileSchemaLoader: Final = _ArrayLoader(SecondaryFileSchemaLoader) +union_of_None_type_or_SecondaryFileSchemaLoader_or_array_of_SecondaryFileSchemaLoader: ( + Final +) = _UnionLoader( ( None_type, SecondaryFileSchemaLoader, array_of_SecondaryFileSchemaLoader, ) ) -secondaryfilesdsl_union_of_None_type_or_SecondaryFileSchemaLoader_or_array_of_SecondaryFileSchemaLoader = _UnionLoader( +secondaryfilesdsl_union_of_None_type_or_SecondaryFileSchemaLoader_or_array_of_SecondaryFileSchemaLoader: ( + Final +) = _UnionLoader( ( _SecondaryDSLLoader( union_of_None_type_or_SecondaryFileSchemaLoader_or_array_of_SecondaryFileSchemaLoader @@ -29939,32 +30048,40 @@ def save( union_of_None_type_or_SecondaryFileSchemaLoader_or_array_of_SecondaryFileSchemaLoader, ) ) -union_of_None_type_or_strtype_or_array_of_strtype_or_ExpressionLoader = _UnionLoader( - ( - None_type, - strtype, - array_of_strtype, - ExpressionLoader, +union_of_None_type_or_strtype_or_array_of_strtype_or_ExpressionLoader: Final = ( + _UnionLoader( + ( + None_type, + strtype, + array_of_strtype, + ExpressionLoader, + ) ) ) -uri_union_of_None_type_or_strtype_or_array_of_strtype_or_ExpressionLoader_True_False_None_True = _URILoader( +uri_union_of_None_type_or_strtype_or_array_of_strtype_or_ExpressionLoader_True_False_None_True: ( + Final +) = _URILoader( union_of_None_type_or_strtype_or_array_of_strtype_or_ExpressionLoader, True, False, None, True, ) -union_of_None_type_or_strtype_or_ExpressionLoader = _UnionLoader( +union_of_None_type_or_strtype_or_ExpressionLoader: Final = _UnionLoader( ( None_type, strtype, ExpressionLoader, ) ) -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 +uri_union_of_None_type_or_strtype_or_ExpressionLoader_True_False_None_True: Final = ( + _URILoader( + union_of_None_type_or_strtype_or_ExpressionLoader, True, False, None, True + ) ) -union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype = _UnionLoader( +union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype: ( + Final +) = _UnionLoader( ( CWLTypeLoader, InputRecordSchemaLoader, @@ -29973,10 +30090,14 @@ def save( strtype, ) ) -array_of_union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype = _ArrayLoader( +array_of_union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype: ( + Final +) = _ArrayLoader( 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( +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: ( + Final +) = _UnionLoader( ( CWLTypeLoader, InputRecordSchemaLoader, @@ -29986,29 +30107,35 @@ def save( array_of_union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype, ) ) -typedsl_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_2 = _TypeDSLLoader( +typedsl_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_2: ( + Final +) = _TypeDSLLoader( 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, 2, "v1.1", ) -array_of_InputRecordFieldLoader = _ArrayLoader(InputRecordFieldLoader) -union_of_None_type_or_array_of_InputRecordFieldLoader = _UnionLoader( +array_of_InputRecordFieldLoader: Final = _ArrayLoader(InputRecordFieldLoader) +union_of_None_type_or_array_of_InputRecordFieldLoader: Final = _UnionLoader( ( None_type, array_of_InputRecordFieldLoader, ) ) -idmap_fields_union_of_None_type_or_array_of_InputRecordFieldLoader = _IdMapLoader( - union_of_None_type_or_array_of_InputRecordFieldLoader, "name", "type" +idmap_fields_union_of_None_type_or_array_of_InputRecordFieldLoader: Final = ( + _IdMapLoader(union_of_None_type_or_array_of_InputRecordFieldLoader, "name", "type") ) -uri_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_False_True_2_None = _URILoader( +uri_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_False_True_2_None: ( + Final +) = _URILoader( 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, False, True, 2, None, ) -union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype = _UnionLoader( +union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype: ( + Final +) = _UnionLoader( ( CWLTypeLoader, OutputRecordSchemaLoader, @@ -30017,10 +30144,14 @@ def save( strtype, ) ) -array_of_union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype = _ArrayLoader( +array_of_union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype: ( + Final +) = _ArrayLoader( 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( +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: ( + Final +) = _UnionLoader( ( CWLTypeLoader, OutputRecordSchemaLoader, @@ -30030,44 +30161,56 @@ def save( array_of_union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype, ) ) -typedsl_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_2 = _TypeDSLLoader( +typedsl_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_2: ( + Final +) = _TypeDSLLoader( 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, 2, "v1.1", ) -array_of_OutputRecordFieldLoader = _ArrayLoader(OutputRecordFieldLoader) -union_of_None_type_or_array_of_OutputRecordFieldLoader = _UnionLoader( +array_of_OutputRecordFieldLoader: Final = _ArrayLoader(OutputRecordFieldLoader) +union_of_None_type_or_array_of_OutputRecordFieldLoader: Final = _UnionLoader( ( None_type, array_of_OutputRecordFieldLoader, ) ) -idmap_fields_union_of_None_type_or_array_of_OutputRecordFieldLoader = _IdMapLoader( - union_of_None_type_or_array_of_OutputRecordFieldLoader, "name", "type" +idmap_fields_union_of_None_type_or_array_of_OutputRecordFieldLoader: Final = ( + _IdMapLoader(union_of_None_type_or_array_of_OutputRecordFieldLoader, "name", "type") ) -uri_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_False_True_2_None = _URILoader( +uri_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_False_True_2_None: ( + Final +) = _URILoader( 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, False, True, 2, None, ) -union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader_or_OperationInputParameterLoader = _UnionLoader( +union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader_or_OperationInputParameterLoader: ( + Final +) = _UnionLoader( ( CommandInputParameterLoader, WorkflowInputParameterLoader, OperationInputParameterLoader, ) ) -array_of_union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader_or_OperationInputParameterLoader = _ArrayLoader( +array_of_union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader_or_OperationInputParameterLoader: ( + Final +) = _ArrayLoader( union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader_or_OperationInputParameterLoader ) -idmap_inputs_array_of_union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader_or_OperationInputParameterLoader = _IdMapLoader( +idmap_inputs_array_of_union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader_or_OperationInputParameterLoader: ( + Final +) = _IdMapLoader( array_of_union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader_or_OperationInputParameterLoader, "id", "type", ) -union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader_or_OperationOutputParameterLoader = _UnionLoader( +union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader_or_OperationOutputParameterLoader: ( + Final +) = _UnionLoader( ( CommandOutputParameterLoader, ExpressionToolOutputParameterLoader, @@ -30075,26 +30218,36 @@ def save( OperationOutputParameterLoader, ) ) -array_of_union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader_or_OperationOutputParameterLoader = _ArrayLoader( +array_of_union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader_or_OperationOutputParameterLoader: ( + Final +) = _ArrayLoader( union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader_or_OperationOutputParameterLoader ) -idmap_outputs_array_of_union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader_or_OperationOutputParameterLoader = _IdMapLoader( +idmap_outputs_array_of_union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader_or_OperationOutputParameterLoader: ( + Final +) = _IdMapLoader( array_of_union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader_or_OperationOutputParameterLoader, "id", "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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_LoopLoader_or_ShmSizeLoader = _UnionLoader( +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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_LoopLoader_or_ShmSizeLoader: ( + Final +) = _UnionLoader( ( None_type, 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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_LoopLoader_or_ShmSizeLoader, ) ) -idmap_requirements_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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_LoopLoader_or_ShmSizeLoader = _IdMapLoader( +idmap_requirements_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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_LoopLoader_or_ShmSizeLoader: ( + Final +) = _IdMapLoader( 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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_LoopLoader_or_ShmSizeLoader, "class", "None", ) -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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_LoopLoader_or_ShmSizeLoader_or_Any_type = _UnionLoader( +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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_LoopLoader_or_ShmSizeLoader_or_Any_type: ( + Final +) = _UnionLoader( ( InlineJavascriptRequirementLoader, SchemaDefRequirementLoader, @@ -30121,107 +30274,121 @@ def save( Any_type, ) ) -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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_LoopLoader_or_ShmSizeLoader_or_Any_type = _ArrayLoader( +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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_LoopLoader_or_ShmSizeLoader_or_Any_type: ( + Final +) = _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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_LoopLoader_or_ShmSizeLoader_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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_LoopLoader_or_ShmSizeLoader_or_Any_type = _UnionLoader( +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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_LoopLoader_or_ShmSizeLoader_or_Any_type: ( + Final +) = _UnionLoader( ( None_type, 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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_LoopLoader_or_ShmSizeLoader_or_Any_type, ) ) -idmap_hints_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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_LoopLoader_or_ShmSizeLoader_or_Any_type = _IdMapLoader( +idmap_hints_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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_LoopLoader_or_ShmSizeLoader_or_Any_type: ( + Final +) = _IdMapLoader( 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_SecretsLoader_or_MPIRequirementLoader_or_CUDARequirementLoader_or_LoopLoader_or_ShmSizeLoader_or_Any_type, "class", "None", ) -union_of_None_type_or_CWLVersionLoader = _UnionLoader( +union_of_None_type_or_CWLVersionLoader: Final = _UnionLoader( ( None_type, CWLVersionLoader, ) ) -uri_union_of_None_type_or_CWLVersionLoader_False_True_None_None = _URILoader( +uri_union_of_None_type_or_CWLVersionLoader_False_True_None_None: Final = _URILoader( union_of_None_type_or_CWLVersionLoader, False, True, None, None ) -union_of_None_type_or_array_of_strtype = _UnionLoader( +union_of_None_type_or_array_of_strtype: Final = _UnionLoader( ( None_type, array_of_strtype, ) ) -uri_union_of_None_type_or_array_of_strtype_True_False_None_None = _URILoader( +uri_union_of_None_type_or_array_of_strtype_True_False_None_None: Final = _URILoader( union_of_None_type_or_array_of_strtype, True, False, None, None ) -InlineJavascriptRequirement_classLoader = _EnumLoader( +InlineJavascriptRequirement_classLoader: Final = _EnumLoader( ("InlineJavascriptRequirement",), "InlineJavascriptRequirement_class" ) -uri_InlineJavascriptRequirement_classLoader_False_True_None_None = _URILoader( +uri_InlineJavascriptRequirement_classLoader_False_True_None_None: Final = _URILoader( InlineJavascriptRequirement_classLoader, False, True, None, None ) -SchemaDefRequirement_classLoader = _EnumLoader( +SchemaDefRequirement_classLoader: Final = _EnumLoader( ("SchemaDefRequirement",), "SchemaDefRequirement_class" ) -uri_SchemaDefRequirement_classLoader_False_True_None_None = _URILoader( +uri_SchemaDefRequirement_classLoader_False_True_None_None: Final = _URILoader( SchemaDefRequirement_classLoader, False, True, None, None ) -union_of_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader = _UnionLoader( +union_of_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader: ( + Final +) = _UnionLoader( ( CommandInputRecordSchemaLoader, CommandInputEnumSchemaLoader, CommandInputArraySchemaLoader, ) ) -array_of_union_of_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader = _ArrayLoader( +array_of_union_of_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader: ( + Final +) = _ArrayLoader( union_of_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader ) -union_of_strtype_or_ExpressionLoader = _UnionLoader( +union_of_strtype_or_ExpressionLoader: Final = _UnionLoader( ( strtype, ExpressionLoader, ) ) -union_of_None_type_or_booltype_or_ExpressionLoader = _UnionLoader( +union_of_None_type_or_booltype_or_ExpressionLoader: Final = _UnionLoader( ( None_type, booltype, ExpressionLoader, ) ) -LoadListingRequirement_classLoader = _EnumLoader( +LoadListingRequirement_classLoader: Final = _EnumLoader( ("LoadListingRequirement",), "LoadListingRequirement_class" ) -uri_LoadListingRequirement_classLoader_False_True_None_None = _URILoader( +uri_LoadListingRequirement_classLoader_False_True_None_None: Final = _URILoader( LoadListingRequirement_classLoader, False, True, None, None ) -union_of_None_type_or_inttype_or_ExpressionLoader = _UnionLoader( +union_of_None_type_or_inttype_or_ExpressionLoader: Final = _UnionLoader( ( None_type, inttype, ExpressionLoader, ) ) -union_of_None_type_or_strtype_or_ExpressionLoader_or_array_of_strtype = _UnionLoader( - ( - None_type, - strtype, - ExpressionLoader, - array_of_strtype, +union_of_None_type_or_strtype_or_ExpressionLoader_or_array_of_strtype: Final = ( + _UnionLoader( + ( + None_type, + strtype, + ExpressionLoader, + array_of_strtype, + ) ) ) -union_of_None_type_or_ExpressionLoader = _UnionLoader( +union_of_None_type_or_ExpressionLoader: Final = _UnionLoader( ( None_type, ExpressionLoader, ) ) -union_of_None_type_or_CommandLineBindingLoader = _UnionLoader( +union_of_None_type_or_CommandLineBindingLoader: Final = _UnionLoader( ( None_type, CommandLineBindingLoader, ) ) -union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype = _UnionLoader( +union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype: ( + Final +) = _UnionLoader( ( CWLTypeLoader, CommandInputRecordSchemaLoader, @@ -30230,10 +30397,14 @@ def save( strtype, ) ) -array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype = _ArrayLoader( +array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype: ( + Final +) = _ArrayLoader( 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( +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: ( + Final +) = _UnionLoader( ( CWLTypeLoader, CommandInputRecordSchemaLoader, @@ -30243,31 +30414,39 @@ def save( array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype, ) ) -typedsl_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_2 = _TypeDSLLoader( +typedsl_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_2: ( + Final +) = _TypeDSLLoader( 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, 2, "v1.1", ) -array_of_CommandInputRecordFieldLoader = _ArrayLoader(CommandInputRecordFieldLoader) -union_of_None_type_or_array_of_CommandInputRecordFieldLoader = _UnionLoader( +array_of_CommandInputRecordFieldLoader: Final = _ArrayLoader( + CommandInputRecordFieldLoader +) +union_of_None_type_or_array_of_CommandInputRecordFieldLoader: Final = _UnionLoader( ( None_type, array_of_CommandInputRecordFieldLoader, ) ) -idmap_fields_union_of_None_type_or_array_of_CommandInputRecordFieldLoader = ( +idmap_fields_union_of_None_type_or_array_of_CommandInputRecordFieldLoader: Final = ( _IdMapLoader( union_of_None_type_or_array_of_CommandInputRecordFieldLoader, "name", "type" ) ) -uri_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_False_True_2_None = _URILoader( +uri_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_False_True_2_None: ( + Final +) = _URILoader( 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, False, True, 2, None, ) -union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype = _UnionLoader( +union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype: ( + Final +) = _UnionLoader( ( CWLTypeLoader, CommandOutputRecordSchemaLoader, @@ -30276,10 +30455,14 @@ def save( strtype, ) ) -array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype = _ArrayLoader( +array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype: ( + Final +) = _ArrayLoader( 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( +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: ( + Final +) = _UnionLoader( ( CWLTypeLoader, CommandOutputRecordSchemaLoader, @@ -30289,37 +30472,45 @@ def save( array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype, ) ) -typedsl_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_2 = _TypeDSLLoader( +typedsl_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_2: ( + Final +) = _TypeDSLLoader( 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, 2, "v1.1", ) -union_of_None_type_or_CommandOutputBindingLoader = _UnionLoader( +union_of_None_type_or_CommandOutputBindingLoader: Final = _UnionLoader( ( None_type, CommandOutputBindingLoader, ) ) -array_of_CommandOutputRecordFieldLoader = _ArrayLoader(CommandOutputRecordFieldLoader) -union_of_None_type_or_array_of_CommandOutputRecordFieldLoader = _UnionLoader( +array_of_CommandOutputRecordFieldLoader: Final = _ArrayLoader( + CommandOutputRecordFieldLoader +) +union_of_None_type_or_array_of_CommandOutputRecordFieldLoader: Final = _UnionLoader( ( None_type, array_of_CommandOutputRecordFieldLoader, ) ) -idmap_fields_union_of_None_type_or_array_of_CommandOutputRecordFieldLoader = ( +idmap_fields_union_of_None_type_or_array_of_CommandOutputRecordFieldLoader: Final = ( _IdMapLoader( union_of_None_type_or_array_of_CommandOutputRecordFieldLoader, "name", "type" ) ) -uri_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_False_True_2_None = _URILoader( +uri_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_False_True_2_None: ( + Final +) = _URILoader( 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, False, True, 2, None, ) -union_of_CWLTypeLoader_or_stdinLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype = _UnionLoader( +union_of_CWLTypeLoader_or_stdinLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype: ( + Final +) = _UnionLoader( ( CWLTypeLoader, stdinLoader, @@ -30330,12 +30521,16 @@ def save( array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype, ) ) -typedsl_union_of_CWLTypeLoader_or_stdinLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype_2 = _TypeDSLLoader( +typedsl_union_of_CWLTypeLoader_or_stdinLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype_2: ( + Final +) = _TypeDSLLoader( union_of_CWLTypeLoader_or_stdinLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype, 2, "v1.1", ) -union_of_CWLTypeLoader_or_stdoutLoader_or_stderrLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype = _UnionLoader( +union_of_CWLTypeLoader_or_stdoutLoader_or_stderrLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype: ( + Final +) = _UnionLoader( ( CWLTypeLoader, stdoutLoader, @@ -30347,72 +30542,82 @@ def save( array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype, ) ) -typedsl_union_of_CWLTypeLoader_or_stdoutLoader_or_stderrLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype_2 = _TypeDSLLoader( +typedsl_union_of_CWLTypeLoader_or_stdoutLoader_or_stderrLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype_2: ( + Final +) = _TypeDSLLoader( union_of_CWLTypeLoader_or_stdoutLoader_or_stderrLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype_or_array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype, 2, "v1.1", ) -CommandLineTool_classLoader = _EnumLoader(("CommandLineTool",), "CommandLineTool_class") -uri_CommandLineTool_classLoader_False_True_None_None = _URILoader( +CommandLineTool_classLoader: Final = _EnumLoader( + ("CommandLineTool",), "CommandLineTool_class" +) +uri_CommandLineTool_classLoader_False_True_None_None: Final = _URILoader( CommandLineTool_classLoader, False, True, None, None ) -array_of_CommandInputParameterLoader = _ArrayLoader(CommandInputParameterLoader) -idmap_inputs_array_of_CommandInputParameterLoader = _IdMapLoader( +array_of_CommandInputParameterLoader: Final = _ArrayLoader(CommandInputParameterLoader) +idmap_inputs_array_of_CommandInputParameterLoader: Final = _IdMapLoader( array_of_CommandInputParameterLoader, "id", "type" ) -array_of_CommandOutputParameterLoader = _ArrayLoader(CommandOutputParameterLoader) -idmap_outputs_array_of_CommandOutputParameterLoader = _IdMapLoader( +array_of_CommandOutputParameterLoader: Final = _ArrayLoader( + CommandOutputParameterLoader +) +idmap_outputs_array_of_CommandOutputParameterLoader: Final = _IdMapLoader( array_of_CommandOutputParameterLoader, "id", "type" ) -union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader = _UnionLoader( +union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader: Final = _UnionLoader( ( strtype, ExpressionLoader, CommandLineBindingLoader, ) ) -array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader = ( +array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader: Final = ( _ArrayLoader(union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader) ) -union_of_None_type_or_array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader = _UnionLoader( +union_of_None_type_or_array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader: ( + Final +) = _UnionLoader( ( None_type, array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader, ) ) -array_of_inttype = _ArrayLoader(inttype) -union_of_None_type_or_array_of_inttype = _UnionLoader( +array_of_inttype: Final = _ArrayLoader(inttype) +union_of_None_type_or_array_of_inttype: Final = _UnionLoader( ( None_type, array_of_inttype, ) ) -DockerRequirement_classLoader = _EnumLoader( +DockerRequirement_classLoader: Final = _EnumLoader( ("DockerRequirement",), "DockerRequirement_class" ) -uri_DockerRequirement_classLoader_False_True_None_None = _URILoader( +uri_DockerRequirement_classLoader_False_True_None_None: Final = _URILoader( DockerRequirement_classLoader, False, True, None, None ) -SoftwareRequirement_classLoader = _EnumLoader( +SoftwareRequirement_classLoader: Final = _EnumLoader( ("SoftwareRequirement",), "SoftwareRequirement_class" ) -uri_SoftwareRequirement_classLoader_False_True_None_None = _URILoader( +uri_SoftwareRequirement_classLoader_False_True_None_None: Final = _URILoader( SoftwareRequirement_classLoader, False, True, None, None ) -array_of_SoftwarePackageLoader = _ArrayLoader(SoftwarePackageLoader) -idmap_packages_array_of_SoftwarePackageLoader = _IdMapLoader( +array_of_SoftwarePackageLoader: Final = _ArrayLoader(SoftwarePackageLoader) +idmap_packages_array_of_SoftwarePackageLoader: Final = _IdMapLoader( array_of_SoftwarePackageLoader, "package", "specs" ) -uri_union_of_None_type_or_array_of_strtype_False_False_None_True = _URILoader( +uri_union_of_None_type_or_array_of_strtype_False_False_None_True: Final = _URILoader( union_of_None_type_or_array_of_strtype, False, False, None, True ) -InitialWorkDirRequirement_classLoader = _EnumLoader( +InitialWorkDirRequirement_classLoader: Final = _EnumLoader( ("InitialWorkDirRequirement",), "InitialWorkDirRequirement_class" ) -uri_InitialWorkDirRequirement_classLoader_False_True_None_None = _URILoader( +uri_InitialWorkDirRequirement_classLoader_False_True_None_None: Final = _URILoader( InitialWorkDirRequirement_classLoader, False, True, None, None ) -union_of_None_type_or_DirentLoader_or_ExpressionLoader_or_FileLoader_or_DirectoryLoader_or_array_of_union_of_FileLoader_or_DirectoryLoader = _UnionLoader( +union_of_None_type_or_DirentLoader_or_ExpressionLoader_or_FileLoader_or_DirectoryLoader_or_array_of_union_of_FileLoader_or_DirectoryLoader: ( + Final +) = _UnionLoader( ( None_type, DirentLoader, @@ -30422,147 +30627,167 @@ def save( array_of_union_of_FileLoader_or_DirectoryLoader, ) ) -array_of_union_of_None_type_or_DirentLoader_or_ExpressionLoader_or_FileLoader_or_DirectoryLoader_or_array_of_union_of_FileLoader_or_DirectoryLoader = _ArrayLoader( +array_of_union_of_None_type_or_DirentLoader_or_ExpressionLoader_or_FileLoader_or_DirectoryLoader_or_array_of_union_of_FileLoader_or_DirectoryLoader: ( + Final +) = _ArrayLoader( 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( +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: ( + Final +) = _UnionLoader( ( ExpressionLoader, array_of_union_of_None_type_or_DirentLoader_or_ExpressionLoader_or_FileLoader_or_DirectoryLoader_or_array_of_union_of_FileLoader_or_DirectoryLoader, ) ) -EnvVarRequirement_classLoader = _EnumLoader( +EnvVarRequirement_classLoader: Final = _EnumLoader( ("EnvVarRequirement",), "EnvVarRequirement_class" ) -uri_EnvVarRequirement_classLoader_False_True_None_None = _URILoader( +uri_EnvVarRequirement_classLoader_False_True_None_None: Final = _URILoader( EnvVarRequirement_classLoader, False, True, None, None ) -array_of_EnvironmentDefLoader = _ArrayLoader(EnvironmentDefLoader) -idmap_envDef_array_of_EnvironmentDefLoader = _IdMapLoader( +array_of_EnvironmentDefLoader: Final = _ArrayLoader(EnvironmentDefLoader) +idmap_envDef_array_of_EnvironmentDefLoader: Final = _IdMapLoader( array_of_EnvironmentDefLoader, "envName", "envValue" ) -ShellCommandRequirement_classLoader = _EnumLoader( +ShellCommandRequirement_classLoader: Final = _EnumLoader( ("ShellCommandRequirement",), "ShellCommandRequirement_class" ) -uri_ShellCommandRequirement_classLoader_False_True_None_None = _URILoader( +uri_ShellCommandRequirement_classLoader_False_True_None_None: Final = _URILoader( ShellCommandRequirement_classLoader, False, True, None, None ) -ResourceRequirement_classLoader = _EnumLoader( +ResourceRequirement_classLoader: Final = _EnumLoader( ("ResourceRequirement",), "ResourceRequirement_class" ) -uri_ResourceRequirement_classLoader_False_True_None_None = _URILoader( +uri_ResourceRequirement_classLoader_False_True_None_None: Final = _URILoader( ResourceRequirement_classLoader, False, True, None, None ) -union_of_None_type_or_inttype_or_floattype_or_ExpressionLoader = _UnionLoader( - ( - None_type, - inttype, - floattype, - ExpressionLoader, +union_of_None_type_or_inttype_or_inttype_or_floattype_or_ExpressionLoader: Final = ( + _UnionLoader( + ( + None_type, + inttype, + inttype, + floattype, + ExpressionLoader, + ) ) ) -WorkReuse_classLoader = _EnumLoader(("WorkReuse",), "WorkReuse_class") -uri_WorkReuse_classLoader_False_True_None_None = _URILoader( +WorkReuse_classLoader: Final = _EnumLoader(("WorkReuse",), "WorkReuse_class") +uri_WorkReuse_classLoader_False_True_None_None: Final = _URILoader( WorkReuse_classLoader, False, True, None, None ) -union_of_booltype_or_ExpressionLoader = _UnionLoader( +union_of_booltype_or_ExpressionLoader: Final = _UnionLoader( ( booltype, ExpressionLoader, ) ) -NetworkAccess_classLoader = _EnumLoader(("NetworkAccess",), "NetworkAccess_class") -uri_NetworkAccess_classLoader_False_True_None_None = _URILoader( +NetworkAccess_classLoader: Final = _EnumLoader( + ("NetworkAccess",), "NetworkAccess_class" +) +uri_NetworkAccess_classLoader_False_True_None_None: Final = _URILoader( NetworkAccess_classLoader, False, True, None, None ) -InplaceUpdateRequirement_classLoader = _EnumLoader( +InplaceUpdateRequirement_classLoader: Final = _EnumLoader( ("InplaceUpdateRequirement",), "InplaceUpdateRequirement_class" ) -uri_InplaceUpdateRequirement_classLoader_False_True_None_None = _URILoader( +uri_InplaceUpdateRequirement_classLoader_False_True_None_None: Final = _URILoader( InplaceUpdateRequirement_classLoader, False, True, None, None ) -ToolTimeLimit_classLoader = _EnumLoader(("ToolTimeLimit",), "ToolTimeLimit_class") -uri_ToolTimeLimit_classLoader_False_True_None_None = _URILoader( +ToolTimeLimit_classLoader: Final = _EnumLoader( + ("ToolTimeLimit",), "ToolTimeLimit_class" +) +uri_ToolTimeLimit_classLoader_False_True_None_None: Final = _URILoader( ToolTimeLimit_classLoader, False, True, None, None ) -union_of_inttype_or_ExpressionLoader = _UnionLoader( +union_of_inttype_or_inttype_or_ExpressionLoader: Final = _UnionLoader( ( + inttype, inttype, ExpressionLoader, ) ) -union_of_None_type_or_InputBindingLoader = _UnionLoader( +union_of_None_type_or_InputBindingLoader: Final = _UnionLoader( ( None_type, InputBindingLoader, ) ) -ExpressionTool_classLoader = _EnumLoader(("ExpressionTool",), "ExpressionTool_class") -uri_ExpressionTool_classLoader_False_True_None_None = _URILoader( +ExpressionTool_classLoader: Final = _EnumLoader( + ("ExpressionTool",), "ExpressionTool_class" +) +uri_ExpressionTool_classLoader_False_True_None_None: Final = _URILoader( ExpressionTool_classLoader, False, True, None, None ) -array_of_WorkflowInputParameterLoader = _ArrayLoader(WorkflowInputParameterLoader) -idmap_inputs_array_of_WorkflowInputParameterLoader = _IdMapLoader( +array_of_WorkflowInputParameterLoader: Final = _ArrayLoader( + WorkflowInputParameterLoader +) +idmap_inputs_array_of_WorkflowInputParameterLoader: Final = _IdMapLoader( array_of_WorkflowInputParameterLoader, "id", "type" ) -array_of_ExpressionToolOutputParameterLoader = _ArrayLoader( +array_of_ExpressionToolOutputParameterLoader: Final = _ArrayLoader( ExpressionToolOutputParameterLoader ) -idmap_outputs_array_of_ExpressionToolOutputParameterLoader = _IdMapLoader( +idmap_outputs_array_of_ExpressionToolOutputParameterLoader: Final = _IdMapLoader( array_of_ExpressionToolOutputParameterLoader, "id", "type" ) -uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_1_None = _URILoader( - union_of_None_type_or_strtype_or_array_of_strtype, False, False, 1, None +uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_1_None: Final = ( + _URILoader(union_of_None_type_or_strtype_or_array_of_strtype, False, False, 1, None) ) -union_of_None_type_or_LinkMergeMethodLoader = _UnionLoader( +union_of_None_type_or_LinkMergeMethodLoader: Final = _UnionLoader( ( None_type, LinkMergeMethodLoader, ) ) -union_of_None_type_or_PickValueMethodLoader = _UnionLoader( +union_of_None_type_or_PickValueMethodLoader: Final = _UnionLoader( ( None_type, PickValueMethodLoader, ) ) -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 +uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_2_None: Final = ( + _URILoader(union_of_None_type_or_strtype_or_array_of_strtype, False, False, 2, None) ) -array_of_WorkflowStepInputLoader = _ArrayLoader(WorkflowStepInputLoader) -idmap_in__array_of_WorkflowStepInputLoader = _IdMapLoader( +array_of_WorkflowStepInputLoader: Final = _ArrayLoader(WorkflowStepInputLoader) +idmap_in__array_of_WorkflowStepInputLoader: Final = _IdMapLoader( array_of_WorkflowStepInputLoader, "id", "source" ) -union_of_strtype_or_WorkflowStepOutputLoader = _UnionLoader( +union_of_strtype_or_WorkflowStepOutputLoader: Final = _UnionLoader( ( strtype, WorkflowStepOutputLoader, ) ) -array_of_union_of_strtype_or_WorkflowStepOutputLoader = _ArrayLoader( +array_of_union_of_strtype_or_WorkflowStepOutputLoader: Final = _ArrayLoader( union_of_strtype_or_WorkflowStepOutputLoader ) -union_of_array_of_union_of_strtype_or_WorkflowStepOutputLoader = _UnionLoader( +union_of_array_of_union_of_strtype_or_WorkflowStepOutputLoader: Final = _UnionLoader( (array_of_union_of_strtype_or_WorkflowStepOutputLoader,) ) -uri_union_of_array_of_union_of_strtype_or_WorkflowStepOutputLoader_True_False_None_None = _URILoader( +uri_union_of_array_of_union_of_strtype_or_WorkflowStepOutputLoader_True_False_None_None: ( + Final +) = _URILoader( union_of_array_of_union_of_strtype_or_WorkflowStepOutputLoader, True, False, None, None, ) -array_of_Any_type = _ArrayLoader(Any_type) -union_of_None_type_or_array_of_Any_type = _UnionLoader( +array_of_Any_type: Final = _ArrayLoader(Any_type) +union_of_None_type_or_array_of_Any_type: Final = _UnionLoader( ( None_type, array_of_Any_type, ) ) -idmap_hints_union_of_None_type_or_array_of_Any_type = _IdMapLoader( +idmap_hints_union_of_None_type_or_array_of_Any_type: Final = _IdMapLoader( union_of_None_type_or_array_of_Any_type, "class", "None" ) -union_of_strtype_or_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader_or_ProcessGeneratorLoader = _UnionLoader( +union_of_strtype_or_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader_or_ProcessGeneratorLoader: ( + Final +) = _UnionLoader( ( strtype, CommandLineToolLoader, @@ -30572,102 +30797,120 @@ def save( ProcessGeneratorLoader, ) ) -uri_union_of_strtype_or_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader_or_ProcessGeneratorLoader_False_False_None_None = _URILoader( +uri_union_of_strtype_or_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader_or_ProcessGeneratorLoader_False_False_None_None: ( + Final +) = _URILoader( union_of_strtype_or_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader_or_ProcessGeneratorLoader, False, False, None, None, ) -uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_0_None = _URILoader( - union_of_None_type_or_strtype_or_array_of_strtype, False, False, 0, None +uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_0_None: Final = ( + _URILoader(union_of_None_type_or_strtype_or_array_of_strtype, False, False, 0, None) ) -union_of_None_type_or_ScatterMethodLoader = _UnionLoader( +union_of_None_type_or_ScatterMethodLoader: Final = _UnionLoader( ( None_type, ScatterMethodLoader, ) ) -uri_union_of_None_type_or_ScatterMethodLoader_False_True_None_None = _URILoader( +uri_union_of_None_type_or_ScatterMethodLoader_False_True_None_None: Final = _URILoader( union_of_None_type_or_ScatterMethodLoader, False, True, None, None ) -Workflow_classLoader = _EnumLoader(("Workflow",), "Workflow_class") -uri_Workflow_classLoader_False_True_None_None = _URILoader( +Workflow_classLoader: Final = _EnumLoader(("Workflow",), "Workflow_class") +uri_Workflow_classLoader_False_True_None_None: Final = _URILoader( Workflow_classLoader, False, True, None, None ) -array_of_WorkflowOutputParameterLoader = _ArrayLoader(WorkflowOutputParameterLoader) -idmap_outputs_array_of_WorkflowOutputParameterLoader = _IdMapLoader( +array_of_WorkflowOutputParameterLoader: Final = _ArrayLoader( + WorkflowOutputParameterLoader +) +idmap_outputs_array_of_WorkflowOutputParameterLoader: Final = _IdMapLoader( array_of_WorkflowOutputParameterLoader, "id", "type" ) -array_of_WorkflowStepLoader = _ArrayLoader(WorkflowStepLoader) -union_of_array_of_WorkflowStepLoader = _UnionLoader((array_of_WorkflowStepLoader,)) -idmap_steps_union_of_array_of_WorkflowStepLoader = _IdMapLoader( +array_of_WorkflowStepLoader: Final = _ArrayLoader(WorkflowStepLoader) +union_of_array_of_WorkflowStepLoader: Final = _UnionLoader( + (array_of_WorkflowStepLoader,) +) +idmap_steps_union_of_array_of_WorkflowStepLoader: Final = _IdMapLoader( union_of_array_of_WorkflowStepLoader, "id", "None" ) -SubworkflowFeatureRequirement_classLoader = _EnumLoader( +SubworkflowFeatureRequirement_classLoader: Final = _EnumLoader( ("SubworkflowFeatureRequirement",), "SubworkflowFeatureRequirement_class" ) -uri_SubworkflowFeatureRequirement_classLoader_False_True_None_None = _URILoader( +uri_SubworkflowFeatureRequirement_classLoader_False_True_None_None: Final = _URILoader( SubworkflowFeatureRequirement_classLoader, False, True, None, None ) -ScatterFeatureRequirement_classLoader = _EnumLoader( +ScatterFeatureRequirement_classLoader: Final = _EnumLoader( ("ScatterFeatureRequirement",), "ScatterFeatureRequirement_class" ) -uri_ScatterFeatureRequirement_classLoader_False_True_None_None = _URILoader( +uri_ScatterFeatureRequirement_classLoader_False_True_None_None: Final = _URILoader( ScatterFeatureRequirement_classLoader, False, True, None, None ) -MultipleInputFeatureRequirement_classLoader = _EnumLoader( +MultipleInputFeatureRequirement_classLoader: Final = _EnumLoader( ("MultipleInputFeatureRequirement",), "MultipleInputFeatureRequirement_class" ) -uri_MultipleInputFeatureRequirement_classLoader_False_True_None_None = _URILoader( - MultipleInputFeatureRequirement_classLoader, False, True, None, None +uri_MultipleInputFeatureRequirement_classLoader_False_True_None_None: Final = ( + _URILoader(MultipleInputFeatureRequirement_classLoader, False, True, None, None) ) -StepInputExpressionRequirement_classLoader = _EnumLoader( +StepInputExpressionRequirement_classLoader: Final = _EnumLoader( ("StepInputExpressionRequirement",), "StepInputExpressionRequirement_class" ) -uri_StepInputExpressionRequirement_classLoader_False_True_None_None = _URILoader( +uri_StepInputExpressionRequirement_classLoader_False_True_None_None: Final = _URILoader( StepInputExpressionRequirement_classLoader, False, True, None, None ) -Operation_classLoader = _EnumLoader(("Operation",), "Operation_class") -uri_Operation_classLoader_False_True_None_None = _URILoader( +Operation_classLoader: Final = _EnumLoader(("Operation",), "Operation_class") +uri_Operation_classLoader_False_True_None_None: Final = _URILoader( Operation_classLoader, False, True, None, None ) -array_of_OperationInputParameterLoader = _ArrayLoader(OperationInputParameterLoader) -idmap_inputs_array_of_OperationInputParameterLoader = _IdMapLoader( +array_of_OperationInputParameterLoader: Final = _ArrayLoader( + OperationInputParameterLoader +) +idmap_inputs_array_of_OperationInputParameterLoader: Final = _IdMapLoader( array_of_OperationInputParameterLoader, "id", "type" ) -array_of_OperationOutputParameterLoader = _ArrayLoader(OperationOutputParameterLoader) -idmap_outputs_array_of_OperationOutputParameterLoader = _IdMapLoader( +array_of_OperationOutputParameterLoader: Final = _ArrayLoader( + OperationOutputParameterLoader +) +idmap_outputs_array_of_OperationOutputParameterLoader: Final = _IdMapLoader( array_of_OperationOutputParameterLoader, "id", "type" ) -uri_strtype_False_True_None_None = _URILoader(strtype, False, True, None, None) -uri_array_of_strtype_False_False_0_None = _URILoader( +uri_strtype_False_True_None_None: Final = _URILoader(strtype, False, True, None, None) +uri_array_of_strtype_False_False_0_None: Final = _URILoader( array_of_strtype, False, False, 0, None ) -union_of_strtype_or_array_of_strtype = _UnionLoader( +union_of_inttype_or_ExpressionLoader: Final = _UnionLoader( + ( + inttype, + ExpressionLoader, + ) +) +union_of_strtype_or_array_of_strtype: Final = _UnionLoader( ( strtype, array_of_strtype, ) ) -union_of_None_type_or_Any_type = _UnionLoader( +union_of_None_type_or_Any_type: Final = _UnionLoader( ( None_type, Any_type, ) ) -array_of_LoopInputLoader = _ArrayLoader(LoopInputLoader) -idmap_loop_array_of_LoopInputLoader = _IdMapLoader( +array_of_LoopInputLoader: Final = _ArrayLoader(LoopInputLoader) +idmap_loop_array_of_LoopInputLoader: Final = _IdMapLoader( array_of_LoopInputLoader, "id", "loopSource" ) -LoopOutputModesLoader = _EnumLoader( +LoopOutputModesLoader: Final = _EnumLoader( ( "last", "all", ), "LoopOutputModes", ) -union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader_or_ProcessGeneratorLoader = _UnionLoader( +union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader_or_ProcessGeneratorLoader: ( + Final +) = _UnionLoader( ( CommandLineToolLoader, ExpressionToolLoader, @@ -30676,10 +30919,14 @@ def save( ProcessGeneratorLoader, ) ) -array_of_union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader_or_ProcessGeneratorLoader = _ArrayLoader( +array_of_union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader_or_ProcessGeneratorLoader: ( + Final +) = _ArrayLoader( union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader_or_ProcessGeneratorLoader ) -union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader_or_ProcessGeneratorLoader_or_array_of_union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader_or_ProcessGeneratorLoader = _UnionLoader( +union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader_or_ProcessGeneratorLoader_or_array_of_union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader_or_ProcessGeneratorLoader: ( + Final +) = _UnionLoader( ( CommandLineToolLoader, ExpressionToolLoader, @@ -30694,6 +30941,7 @@ def save( ( booltype, inttype, + longtype, floattype, strtype, FileLoader, @@ -30702,12 +30950,15 @@ def save( map_of_union_of_None_type_or_CWLObjectTypeLoader, ) ) +CWLObjectType: TypeAlias = ( + "Directory | File | Mapping[str, CWLObjectType | None] | Sequence[CWLObjectType | None] | bool | float | i32 | i64 | str" +) def load_document( doc: Any, - baseuri: Optional[str] = None, - loadingOptions: Optional[LoadingOptions] = None, + baseuri: str | None = None, + loadingOptions: LoadingOptions | None = None, ) -> Any: if baseuri is None: baseuri = file_uri(os.getcwd()) + "/" @@ -30724,9 +30975,9 @@ def load_document( def load_document_with_metadata( doc: Any, - baseuri: Optional[str] = None, - loadingOptions: Optional[LoadingOptions] = None, - addl_metadata_fields: Optional[MutableSequence[str]] = None, + baseuri: str | None = None, + loadingOptions: LoadingOptions | None = None, + addl_metadata_fields: MutableSequence[str] | None = None, ) -> Any: if baseuri is None: baseuri = file_uri(os.getcwd()) + "/" @@ -30744,7 +30995,7 @@ def load_document_with_metadata( def load_document_by_string( string: Any, uri: str, - loadingOptions: Optional[LoadingOptions] = None, + loadingOptions: LoadingOptions | None = None, ) -> Any: yaml = yaml_no_ts() result = yaml.load(string) @@ -30765,7 +31016,7 @@ def load_document_by_string( def load_document_by_yaml( yaml: Any, uri: str, - loadingOptions: Optional[LoadingOptions] = None, + loadingOptions: LoadingOptions | None = None, ) -> Any: """ Shortcut to load via a YAML object. diff --git a/cwl_utils/parser/cwl_v1_2_utils.py b/cwl_utils/parser/cwl_v1_2_utils.py index e40f5877..f4fc6402 100644 --- a/cwl_utils/parser/cwl_v1_2_utils.py +++ b/cwl_utils/parser/cwl_v1_2_utils.py @@ -2,10 +2,10 @@ import hashlib import logging from collections import namedtuple -from collections.abc import MutableMapping, MutableSequence +from collections.abc import Mapping, MutableMapping, MutableSequence, Sequence from io import StringIO from pathlib import Path -from typing import Any, IO, cast +from typing import IO, Any, Literal, TypeAlias, TypeVar, cast from urllib.parse import urldefrag from schema_salad.exceptions import ValidationException @@ -16,6 +16,7 @@ import cwl_utils.parser.cwl_v1_2 as cwl import cwl_utils.parser.utils from cwl_utils.errors import WorkflowException +from cwl_utils.types import is_sequence from cwl_utils.utils import yaml_dumps CONTENT_LIMIT: int = 64 * 1024 @@ -24,6 +25,142 @@ SrcSink = namedtuple("SrcSink", ["src", "sink", "linkMerge", "message"]) +BasicInputTypeSchemas: TypeAlias = ( + cwl.InputArraySchema + | cwl.InputEnumSchema + | cwl.InputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] +) +InputTypeSchemas: TypeAlias = ( + BasicInputTypeSchemas | Literal["stdin"] | Sequence[BasicInputTypeSchemas] +) +BasicCommandInputTypeSchemas: TypeAlias = ( + cwl.CommandInputArraySchema + | cwl.CommandInputEnumSchema + | cwl.CommandInputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] +) +CommandInputTypeSchemas: TypeAlias = ( + BasicCommandInputTypeSchemas + | Literal["stdin"] + | Sequence[BasicCommandInputTypeSchemas] +) +BasicOutputTypeSchemas: TypeAlias = ( + cwl.OutputArraySchema + | cwl.OutputEnumSchema + | cwl.OutputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] +) +OutputTypeSchemas: TypeAlias = ( + BasicOutputTypeSchemas + | Literal["stderr", "stdout"] + | Sequence[BasicOutputTypeSchemas] +) +BasicCommandOutputTypeSchemas: TypeAlias = ( + cwl.CommandOutputArraySchema + | cwl.CommandOutputEnumSchema + | cwl.CommandOutputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] +) +CommandOutputTypeSchemas: TypeAlias = ( + BasicCommandOutputTypeSchemas + | Literal["stderr", "stdout"] + | Sequence[BasicCommandOutputTypeSchemas] +) +AnyTypeSchema = TypeVar( + "AnyTypeSchema", bound=InputTypeSchemas | CommandOutputTypeSchemas +) + + +def _in_output_type_schema_to_output_type_schema( + schema_type: BasicInputTypeSchemas | BasicOutputTypeSchemas, + loading_options: cwl.LoadingOptions, +) -> BasicOutputTypeSchemas: + match schema_type: + case cwl.ArraySchema(): + return cwl.OutputArraySchema.fromDoc( + schema_type.save(), + loading_options.baseuri, + loading_options, + ) + case cwl.EnumSchema(): + return cwl.OutputEnumSchema.fromDoc( + schema_type.save(), + loading_options.baseuri, + loading_options, + ) + case cwl.RecordSchema(): + return cwl.OutputRecordSchema.fromDoc( + schema_type.save(), + loading_options.baseuri, + loading_options, + ) + case str(): + return schema_type + raise WorkflowException(f"Unexpected output type: {schema_type}.") + + +def in_output_type_schema_to_output_type_schema( + schema_type: ( + BasicInputTypeSchemas + | BasicOutputTypeSchemas + | Sequence[BasicInputTypeSchemas | BasicOutputTypeSchemas] + ), + loading_options: cwl.LoadingOptions, +) -> OutputTypeSchemas: + if is_sequence(schema_type): + return [ + _in_output_type_schema_to_output_type_schema( + schema_type_item, loading_options + ) + for schema_type_item in schema_type + ] + return _in_output_type_schema_to_output_type_schema(schema_type, loading_options) + def _compare_records( src: cwl.RecordSchema, sink: cwl.RecordSchema, strict: bool = False @@ -83,7 +220,7 @@ def _compare_type(type1: Any, type2: Any) -> bool: def _is_all_output_method_loop_step( - param_to_step: dict[str, cwl.WorkflowStep], parm_id: str + param_to_step: Mapping[str, cwl.WorkflowStep], parm_id: str ) -> bool: if (source_step := param_to_step.get(parm_id)) is not None: for requirement in source_step.requirements or []: @@ -93,7 +230,7 @@ def _is_all_output_method_loop_step( def _is_conditional_step( - param_to_step: dict[str, cwl.WorkflowStep], parm_id: str + param_to_step: Mapping[str, cwl.WorkflowStep], parm_id: str ) -> bool: if (source_step := param_to_step.get(parm_id)) is not None: if source_step.when is not None: @@ -200,8 +337,8 @@ def can_assign_src_to_sink(src: Any, sink: Any, strict: bool = False) -> bool: def check_all_types( src_dict: dict[str, Any], - sinks: MutableSequence[cwl.WorkflowStepInput | cwl.WorkflowOutputParameter], - param_to_step: dict[str, cwl.WorkflowStep], + sinks: Sequence[cwl.WorkflowStepInput | cwl.WorkflowOutputParameter], + param_to_step: Mapping[str, cwl.WorkflowStep], type_dict: dict[str, Any], ) -> dict[str, list[SrcSink]]: """Given a list of sinks, check if their types match with the types of their sources.""" @@ -218,36 +355,10 @@ def check_all_types( sourceName = "source" sourceField = sink.source case _: - continue + raise WorkflowException(f"Invalid sink type {sink.__class__.__name__}") if sourceField is not None: - if isinstance(sourceField, MutableSequence): - linkMerge: str | None = sink.linkMerge or ( - "merge_nested" if len(sourceField) > 1 else None - ) - if sink.pickValue in ("first_non_null", "the_only_non_null"): - linkMerge = None - srcs_of_sink = [] - for parm_id in sourceField: - srcs_of_sink += [src_dict[parm_id]] - if ( - _is_conditional_step(param_to_step, parm_id) - and sink.pickValue is not None - ): - validation["warning"].append( - SrcSink( - src_dict[parm_id], - sink, - linkMerge, - message="Source is from conditional step, but pickValue is not used", - ) - ) - if _is_all_output_method_loop_step(param_to_step, parm_id): - src_typ = type_dict[src_dict[parm_id].id] - type_dict[src_dict[parm_id].id] = cwl.ArraySchema( - items=src_typ, type_="array" - ) - else: - parm_id = cast(str, sourceField) + if isinstance(sourceField, str): + parm_id = sourceField if parm_id not in src_dict: raise SourceLine(sink, sourceName, ValidationException).makeError( f"{sourceName} not found: {parm_id}" @@ -286,6 +397,32 @@ def check_all_types( type_dict[src_dict[parm_id].id] = cwl.ArraySchema( items=src_typ, type_="array" ) + else: + linkMerge = sink.linkMerge or ( + "merge_nested" if len(sourceField) > 1 else None + ) + if sink.pickValue in ("first_non_null", "the_only_non_null"): + linkMerge = None + srcs_of_sink = [] + for parm_id in sourceField: + srcs_of_sink += [src_dict[parm_id]] + if ( + _is_conditional_step(param_to_step, parm_id) + and sink.pickValue is not None + ): + validation["warning"].append( + SrcSink( + src_dict[parm_id], + sink, + linkMerge, + message="Source is from conditional step, but pickValue is not used", + ) + ) + if _is_all_output_method_loop_step(param_to_step, parm_id): + src_typ = type_dict[src_dict[parm_id].id] + type_dict[src_dict[parm_id].id] = cwl.ArraySchema( + items=src_typ, type_="array" + ) for src in srcs_of_sink: check_result = check_types( type_dict[cast(str, src.id)], @@ -388,8 +525,7 @@ def convert_stdstreams_to_files(clt: cwl.CommandLineTool) -> None: ) else: clt.stdin = ( - "$(inputs.%s.path)" - % cast(str, inp.id).rpartition("#")[2].split("/")[-1] + "$(inputs.%s.path)" % inp.id.rpartition("#")[2].split("/")[-1] ) inp.type_ = "File" @@ -461,48 +597,62 @@ def merge_flatten_type(src: Any) -> Any: return cwl.ArraySchema(type_="array", items=src) +def to_input_array(type_: InputTypeSchemas) -> cwl.InputArraySchema: + return cwl.InputArraySchema(type_="array", items=type_) + + +def to_output_array(type_: OutputTypeSchemas) -> cwl.OutputArraySchema: + return cwl.OutputArraySchema(type_="array", items=type_) + + def type_for_step_input( step: cwl.WorkflowStep, in_: cwl.WorkflowStepInput, -) -> Any: +) -> cwl_utils.parser.utils.InputTypeSchemas | None: """Determine the type for the given step input.""" if in_.valueFrom is not None: return "Any" step_run = cwl_utils.parser.utils.load_step(step) cwl_utils.parser.utils.convert_stdstreams_to_files(step_run) - if step_run and step_run.inputs: - for step_input in step_run.inputs: - if cast(str, step_input.id).split("#")[-1] == in_.id.split("#")[-1]: - 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") - return input_type + for step_input in step_run.inputs: + if step_input.id.split("#")[-1] == in_.id.split("#")[-1]: + input_type = step_input.type_ + if ( + input_type is not None + and step.scatter is not None + and in_.id in aslist(step.scatter) + ): + input_type = cwl_utils.parser.utils.to_input_array( + input_type, step_run.cwlVersion or "v1.2" + ) + return input_type return "Any" def type_for_step_output( step: cwl.WorkflowStep, sourcename: str, -) -> Any: +) -> cwl_utils.parser.utils.OutputTypeSchemas | None: """Determine the type for the given step output.""" step_run = cwl_utils.parser.utils.load_step(step) cwl_utils.parser.utils.convert_stdstreams_to_files(step_run) - if step_run and step_run.outputs: - for output in step_run.outputs: - if ( - output.id.split("#")[-1].split("/")[-1] - == sourcename.split("#")[-1].split("/")[-1] - ): - 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" - ) - else: - output_type = cwl.ArraySchema(items=output_type, type_="array") - return output_type + for output in step_run.outputs: + if ( + output.id.split("#")[-1].split("/")[-1] + == sourcename.split("#")[-1].split("/")[-1] + ): + output_type = output.type_ + if output_type is not None and step.scatter is not None: + if step.scatterMethod == "nested_crossproduct": + for _ in range(len(aslist(step.scatter))): + output_type = cwl_utils.parser.utils.to_output_array( + output_type, step_run.cwlVersion or "v1.2" + ) + else: + output_type = cwl_utils.parser.utils.to_output_array( + output_type, step_run.cwlVersion or "v1.2" + ) + return output_type raise ValidationException( "param {} not found in {}.".format( sourcename, @@ -512,38 +662,57 @@ def type_for_step_output( def type_for_source( - process: cwl.CommandLineTool | cwl.Workflow | cwl.ExpressionTool, - sourcenames: str | list[str], + process: cwl.Process, + sourcenames: str | Sequence[str], parent: cwl.Workflow | None = None, linkMerge: str | None = None, pickValue: str | None = None, -) -> Any: +) -> ( + MutableSequence[InputTypeSchemas | OutputTypeSchemas] + | InputTypeSchemas + | OutputTypeSchemas +): """Determine the type for the given sourcenames.""" scatter_context: list[tuple[int, str] | None] = [] params = param_for_source_id(process, sourcenames, parent, scatter_context) if not isinstance(params, MutableSequence): - new_type = params.type_ + new_type: InputTypeSchemas | OutputTypeSchemas = 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.OutputArraySchema( + items=in_output_type_schema_to_output_type_schema( + new_type, process.loadingOptions # type: ignore[attr-defined] + ), + type_="array", + ) else: - new_type = cwl.ArraySchema(items=new_type, type_="array") + new_type = cwl.OutputArraySchema( + items=in_output_type_schema_to_output_type_schema( + new_type, process.loadingOptions # type: ignore[attr-defined] + ), + type_="array", + ) if linkMerge == "merge_nested": - new_type = cwl.ArraySchema(items=new_type, type_="array") + new_type = cwl.OutputArraySchema( + items=in_output_type_schema_to_output_type_schema( + new_type, process.loadingOptions # type: ignore[attr-defined] + ), + type_="array", + ) elif linkMerge == "merge_flattened": new_type = merge_flatten_type(new_type) if pickValue is not None: if isinstance(new_type, cwl.ArraySchema): if pickValue in ("first_non_null", "the_only_non_null"): - new_type = new_type.items + return new_type.items return new_type - new_type = [] + new_types: MutableSequence[InputTypeSchemas | OutputTypeSchemas] = [] for p, sc in zip(params, scatter_context): - if isinstance(p, str) and not any(_compare_type(t, p) for t in new_type): + if isinstance(p, str) and not any(_compare_type(t, p) for t in new_types): cur_type = p elif hasattr(p, "type_") and not any( - _compare_type(t, p.type_) for t in new_type + _compare_type(t, p.type_) for t in new_types ): cur_type = p.type_ else: @@ -552,47 +721,81 @@ def type_for_source( 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.OutputArraySchema( + items=in_output_type_schema_to_output_type_schema( + cur_type, process.loadingOptions # type: ignore[attr-defined] + ), + type_="array", + ) else: - cur_type = cwl.ArraySchema(items=cur_type, type_="array") - new_type.append(cur_type) - if len(new_type) == 1: - new_type = new_type[0] + cur_type = cwl.OutputArraySchema( + items=in_output_type_schema_to_output_type_schema( + cur_type, process.loadingOptions # type: ignore[attr-defined] + ), + type_="array", + ) + new_types.append(cur_type) + if len(new_types) == 1: + final_type: ( + MutableSequence[InputTypeSchemas | OutputTypeSchemas] + | InputTypeSchemas + | OutputTypeSchemas + ) = new_types[0] + else: + final_type = new_types if linkMerge == "merge_nested": - new_type = cwl.ArraySchema(items=new_type, type_="array") + final_type = cwl.OutputArraySchema( + items=final_type, + type_="array", + ) elif linkMerge == "merge_flattened": - new_type = merge_flatten_type(new_type) + final_type = merge_flatten_type(final_type) elif isinstance(sourcenames, list) and len(sourcenames) > 1: - new_type = cwl.ArraySchema(items=new_type, type_="array") + final_type = cwl.OutputArraySchema( + items=final_type, + type_="array", + ) if pickValue is not None: - if isinstance(new_type, cwl.ArraySchema): + if isinstance(final_type, cwl.ArraySchema): if pickValue in ("first_non_null", "the_only_non_null"): - new_type = new_type.items - return new_type + return final_type.items + return final_type def param_for_source_id( - process: cwl.CommandLineTool | cwl.Workflow | cwl.ExpressionTool, - sourcenames: str | list[str], + process: cwl.Process, + sourcenames: str | Sequence[str], parent: cwl.Workflow | None = None, scatter_context: list[tuple[int, str] | None] | None = None, ) -> ( - cwl.CommandInputParameter - | cwl.CommandOutputParameter - | cwl.WorkflowInputParameter + cwl_utils.parser.CommandInputParameter + | cwl_utils.parser.CommandOutputParameter + | cwl_utils.parser.ExpressionToolOutputParameter + | cwl_utils.parser.OperationInputParameter + | cwl_utils.parser.OperationOutputParameter + | cwl_utils.parser.WorkflowInputParameter + | cwl_utils.parser.WorkflowOutputParameter | MutableSequence[ - cwl.CommandInputParameter - | cwl.CommandOutputParameter - | cwl.WorkflowInputParameter + cwl_utils.parser.CommandInputParameter + | cwl_utils.parser.CommandOutputParameter + | cwl_utils.parser.ExpressionToolOutputParameter + | cwl_utils.parser.OperationInputParameter + | cwl_utils.parser.OperationOutputParameter + | cwl_utils.parser.WorkflowInputParameter + | cwl_utils.parser.WorkflowOutputParameter ] ): """Find the process input parameter that matches one of the given sourcenames.""" if isinstance(sourcenames, str): sourcenames = [sourcenames] params: MutableSequence[ - cwl.CommandInputParameter - | cwl.CommandOutputParameter - | cwl.WorkflowInputParameter + cwl_utils.parser.CommandInputParameter + | cwl_utils.parser.CommandOutputParameter + | cwl_utils.parser.ExpressionToolOutputParameter + | cwl_utils.parser.OperationInputParameter + | cwl_utils.parser.OperationOutputParameter + | cwl_utils.parser.WorkflowInputParameter + | cwl_utils.parser.WorkflowOutputParameter ] = [] for sourcename in sourcenames: if not isinstance(process, cwl.Workflow): @@ -633,8 +836,8 @@ def param_for_source_id( ): params.append(output) if scatter_context is not None: - if scatter_context is not None: - if isinstance(step.scatter, str): + match step.scatter: + case str(): scatter_context.append( ( 1, @@ -642,9 +845,7 @@ def param_for_source_id( or "dotproduct", ) ) - elif isinstance( - step.scatter, MutableSequence - ): + case Sequence(): scatter_context.append( ( len(step.scatter), @@ -652,7 +853,7 @@ def param_for_source_id( or "dotproduct", ) ) - else: + case _: scatter_context.append(None) if len(params) == 1: return params[0] diff --git a/cwl_utils/parser/utils.py b/cwl_utils/parser/utils.py index 6849afd9..0ad4a8c3 100644 --- a/cwl_utils/parser/utils.py +++ b/cwl_utils/parser/utils.py @@ -2,19 +2,19 @@ import copy import logging -from collections.abc import MutableSequence +from collections.abc import MutableMapping, MutableSequence from pathlib import Path from types import ModuleType -from typing import Any, Optional, cast +from typing import Any, Final, Optional, cast, Literal, TypeAlias, overload from urllib.parse import unquote_plus, urlparse from schema_salad.exceptions import ValidationException from schema_salad.sourceline import SourceLine, strip_dup_lineno from schema_salad.utils import json_dumps, yaml_no_ts -import cwl_utils -import cwl_utils.parser -from . import ( +from cwl_utils.parser import ( + CommandLineTool, + ExpressionTool, LoadingOptions, Process, Workflow, @@ -26,11 +26,49 @@ cwl_v1_1_utils, cwl_v1_2, cwl_v1_2_utils, + load_document_by_uri, + CommandInputParameter, + CommandOutputParameter, + ExpressionToolOutputParameter, + OperationInputParameter, + OperationOutputParameter, + WorkflowInputParameter, + WorkflowOutputParameter, + OutputArraySchema, + InputArraySchema, ) _logger = logging.getLogger("cwl_utils") +BasicInputTypeSchemas: TypeAlias = ( + cwl_v1_0_utils.BasicInputTypeSchemas + | cwl_v1_1_utils.BasicInputTypeSchemas + | cwl_v1_2_utils.BasicInputTypeSchemas +) + + +InputTypeSchemas: TypeAlias = ( + cwl_v1_0_utils.InputTypeSchemas + | cwl_v1_1_utils.InputTypeSchemas + | cwl_v1_2_utils.InputTypeSchemas +) + + +BasicOutputTypeSchemas: TypeAlias = ( + cwl_v1_0_utils.BasicOutputTypeSchemas + | cwl_v1_1_utils.BasicOutputTypeSchemas + | cwl_v1_2_utils.BasicOutputTypeSchemas +) + + +OutputTypeSchemas: TypeAlias = ( + cwl_v1_0_utils.OutputTypeSchemas + | cwl_v1_1_utils.OutputTypeSchemas + | cwl_v1_2_utils.OutputTypeSchemas +) + + def convert_stdstreams_to_files(process: Process) -> None: """Convert stdin, stdout and stderr type shortcuts to files.""" match process: @@ -133,10 +171,10 @@ def load_inputfile_by_yaml( def load_step( - step: cwl_utils.parser.WorkflowStep, + step: WorkflowStep, ) -> Process: if isinstance(step.run, str): - step_run = cwl_utils.parser.load_document_by_uri( + step_run = load_document_by_uri( path=step.loadingOptions.fetcher.urljoin( base_url=cast(str, step.loadingOptions.fileuri), url=step.run, @@ -147,21 +185,19 @@ def load_step( return cast(Process, copy.deepcopy(step.run)) -def static_checker(workflow: cwl_utils.parser.Workflow) -> None: +def static_checker(workflow: Workflow) -> None: """Check if all source and sink types of a workflow are compatible before run time.""" - step_inputs = [] + step_inputs: Final[MutableSequence[WorkflowStepInput]] = [] step_outputs = [] type_dict = {} - param_to_step = {} + param_to_step: Final[MutableMapping[str, WorkflowStep]] = {} for step in workflow.steps: if step.in_ is not None: step_inputs.extend(step.in_) param_to_step.update({s.id: step for s in step.in_}) type_dict.update( { - cast(str, s.id): type_for_step_input( - step, s, cast(str, workflow.cwlVersion) - ) + s.id: type_for_step_input(step, s, cast(str, workflow.cwlVersion)) for s in step.in_ } ) @@ -210,7 +246,9 @@ def static_checker(workflow: cwl_utils.parser.Workflow) -> None: case "v1.0": parser = cwl_v1_0 step_inputs_val = cwl_v1_0_utils.check_all_types( - src_dict, step_inputs, type_dict + src_dict, + cast(MutableSequence[cwl_v1_0.WorkflowStepInput], step_inputs), + type_dict, ) workflow_outputs_val = cwl_v1_0_utils.check_all_types( src_dict, workflow.outputs, type_dict @@ -218,7 +256,9 @@ def static_checker(workflow: cwl_utils.parser.Workflow) -> None: case "v1.1": parser = cwl_v1_1 step_inputs_val = cwl_v1_1_utils.check_all_types( - src_dict, step_inputs, type_dict + src_dict, + cast(MutableSequence[cwl_v1_1.WorkflowStepInput], step_inputs), + type_dict, ) workflow_outputs_val = cwl_v1_1_utils.check_all_types( src_dict, workflow.outputs, type_dict @@ -226,10 +266,16 @@ def static_checker(workflow: cwl_utils.parser.Workflow) -> None: case "v1.2": parser = cwl_v1_2 step_inputs_val = cwl_v1_2_utils.check_all_types( - src_dict, step_inputs, param_to_step, type_dict + src_dict, + cast(MutableSequence[cwl_v1_2.WorkflowStepInput], step_inputs), + cast(MutableMapping[str, cwl_v1_2.WorkflowStep], param_to_step), + type_dict, ) workflow_outputs_val = cwl_v1_2_utils.check_all_types( - src_dict, workflow.outputs, param_to_step, type_dict + src_dict, + workflow.outputs, + cast(MutableMapping[str, cwl_v1_2.WorkflowStep], param_to_step), + type_dict, ) case _ as cwlVersion: raise Exception(f"Unsupported CWL version {cwlVersion}") @@ -326,6 +372,78 @@ def static_checker(workflow: cwl_utils.parser.Workflow) -> None: raise ValidationException(all_exception_msg) +@overload +def to_input_array( + type_: InputTypeSchemas, cwlVersion: Literal["v1.0"] +) -> cwl_v1_0.InputArraySchema: ... + + +@overload +def to_input_array( + type_: InputTypeSchemas, cwlVersion: Literal["v1.1"] +) -> cwl_v1_1.InputArraySchema: ... + + +@overload +def to_input_array( + type_: InputTypeSchemas, cwlVersion: Literal["v1.2"] +) -> cwl_v1_2.InputArraySchema: ... + + +def to_input_array( + type_: InputTypeSchemas, cwlVersion: Literal["v1.0", "v1.1", "v1.2"] +) -> InputArraySchema: + match cwlVersion: + case "v1.0": + return cwl_v1_0_utils.to_input_array( + cast(cwl_v1_0_utils.InputTypeSchemas, type_) + ) + case "v1.1": + return cwl_v1_1_utils.to_input_array( + cast(cwl_v1_1_utils.InputTypeSchemas, type_) + ) + case "v1.2": + return cwl_v1_2_utils.to_input_array( + cast(cwl_v1_2_utils.InputTypeSchemas, type_) + ) + + +@overload +def to_output_array( + type_: OutputTypeSchemas, cwlVersion: Literal["v1.0"] +) -> cwl_v1_0.OutputArraySchema: ... + + +@overload +def to_output_array( + type_: OutputTypeSchemas, cwlVersion: Literal["v1.1"] +) -> cwl_v1_1.OutputArraySchema: ... + + +@overload +def to_output_array( + type_: OutputTypeSchemas, cwlVersion: Literal["v1.2"] +) -> cwl_v1_2.OutputArraySchema: ... + + +def to_output_array( + type_: OutputTypeSchemas, cwlVersion: Literal["v1.0", "v1.1", "v1.2"] +) -> OutputArraySchema: + match cwlVersion: + case "v1.0": + return cwl_v1_0_utils.to_output_array( + cast(cwl_v1_0_utils.OutputTypeSchemas, type_) + ) + case "v1.1": + return cwl_v1_1_utils.to_output_array( + cast(cwl_v1_1_utils.OutputTypeSchemas, type_) + ) + case "v1.2": + return cwl_v1_2_utils.to_output_array( + cast(cwl_v1_2_utils.OutputTypeSchemas, type_) + ) + + def type_for_source( process: Process, sourcenames: str | list[str], @@ -337,36 +455,21 @@ def type_for_source( match process.cwlVersion: case "v1.0": return cwl_v1_0_utils.type_for_source( - cast( - cwl_v1_0.CommandLineTool - | cwl_v1_0.Workflow - | cwl_v1_0.ExpressionTool, - process, - ), + process, sourcenames, cast(cwl_v1_0.Workflow | None, parent), linkMerge, ) case "v1.1": return cwl_v1_1_utils.type_for_source( - cast( - cwl_v1_1.CommandLineTool - | cwl_v1_1.Workflow - | cwl_v1_1.ExpressionTool, - process, - ), + process, sourcenames, cast(cwl_v1_1.Workflow | None, parent), linkMerge, ) case "v1.2": return cwl_v1_2_utils.type_for_source( - cast( - cwl_v1_2.CommandLineTool - | cwl_v1_2.Workflow - | cwl_v1_2.ExpressionTool, - process, - ), + process, sourcenames, cast(cwl_v1_2.Workflow | None, parent), linkMerge, @@ -382,7 +485,7 @@ def type_for_source( def type_for_step_input( step: WorkflowStep, in_: WorkflowStepInput, cwlVersion: str -) -> Any: +) -> InputTypeSchemas | None: """Determine the type for the given step output.""" match cwlVersion: case "v1.0": @@ -397,9 +500,13 @@ def type_for_step_input( return cwl_v1_2_utils.type_for_step_input( cast(cwl_v1_2.WorkflowStep, step), cast(cwl_v1_2.WorkflowStepInput, in_) ) + case _: + raise Exception(f"Unsupported CWL version {cwlVersion}") -def type_for_step_output(step: WorkflowStep, sourcename: str, cwlVersion: str) -> Any: +def type_for_step_output( + step: WorkflowStep, sourcename: str, cwlVersion: str +) -> OutputTypeSchemas | None: """Determine the type for the given step output.""" match cwlVersion: case "v1.0": @@ -414,82 +521,53 @@ def type_for_step_output(step: WorkflowStep, sourcename: str, cwlVersion: str) - return cwl_v1_2_utils.type_for_step_output( cast(cwl_v1_2.WorkflowStep, step), sourcename ) + case _: + raise Exception(f"Unsupported CWL version {cwlVersion}") def param_for_source_id( - process: ( - cwl_utils.parser.CommandLineTool - | cwl_utils.parser.Workflow - | cwl_utils.parser.ExpressionTool - ), + process: CommandLineTool | Workflow | ExpressionTool, sourcenames: str | list[str], - parent: cwl_utils.parser.Workflow | None = None, + parent: Workflow | None = None, scatter_context: list[tuple[int, str] | None] | None = None, ) -> ( - ( - MutableSequence[ - cwl_utils.parser.cwl_v1_0.InputParameter - | cwl_utils.parser.cwl_v1_0.CommandOutputParameter - ] - | cwl_utils.parser.cwl_v1_0.InputParameter - | cwl_utils.parser.cwl_v1_0.CommandOutputParameter - ) - | ( - MutableSequence[ - cwl_utils.parser.cwl_v1_1.CommandInputParameter - | cwl_utils.parser.cwl_v1_1.CommandOutputParameter - | cwl_utils.parser.cwl_v1_1.WorkflowInputParameter - ] - | cwl_utils.parser.cwl_v1_1.CommandInputParameter - | cwl_utils.parser.cwl_v1_1.CommandOutputParameter - | cwl_utils.parser.cwl_v1_1.WorkflowInputParameter - ) - | ( - MutableSequence[ - cwl_utils.parser.cwl_v1_2.CommandInputParameter - | cwl_utils.parser.cwl_v1_2.CommandOutputParameter - | cwl_utils.parser.cwl_v1_2.WorkflowInputParameter - ] - | cwl_utils.parser.cwl_v1_2.CommandInputParameter - | cwl_utils.parser.cwl_v1_2.CommandOutputParameter - | cwl_utils.parser.cwl_v1_2.WorkflowInputParameter - ) + CommandInputParameter + | CommandOutputParameter + | ExpressionToolOutputParameter + | OperationInputParameter + | OperationOutputParameter + | WorkflowInputParameter + | WorkflowOutputParameter + | MutableSequence[ + CommandInputParameter + | CommandOutputParameter + | ExpressionToolOutputParameter + | OperationInputParameter + | OperationOutputParameter + | WorkflowInputParameter + | WorkflowOutputParameter + ] ): match process.cwlVersion: case "v1.0": - return cwl_utils.parser.cwl_v1_0_utils.param_for_source_id( - cast( - cwl_utils.parser.cwl_v1_0.CommandLineTool - | cwl_utils.parser.cwl_v1_0.Workflow - | cwl_utils.parser.cwl_v1_0.ExpressionTool, - process, - ), + return cwl_v1_0_utils.param_for_source_id( + process, sourcenames, - cast(cwl_utils.parser.cwl_v1_0.Workflow, parent), + cast(cwl_v1_0.Workflow, parent), scatter_context, ) case "v1.1": - return cwl_utils.parser.cwl_v1_1_utils.param_for_source_id( - cast( - cwl_utils.parser.cwl_v1_1.CommandLineTool - | cwl_utils.parser.cwl_v1_1.Workflow - | cwl_utils.parser.cwl_v1_1.ExpressionTool, - process, - ), + return cwl_v1_1_utils.param_for_source_id( + process, sourcenames, - cast(cwl_utils.parser.cwl_v1_1.Workflow, parent), + cast(cwl_v1_1.Workflow, parent), scatter_context, ) case "v1.2": - return cwl_utils.parser.cwl_v1_2_utils.param_for_source_id( - cast( - cwl_utils.parser.cwl_v1_2.CommandLineTool - | cwl_utils.parser.cwl_v1_2.Workflow - | cwl_utils.parser.cwl_v1_2.ExpressionTool, - process, - ), + return cwl_v1_2_utils.param_for_source_id( + process, sourcenames, - cast(cwl_utils.parser.cwl_v1_2.Workflow, parent), + cast(cwl_v1_2.Workflow, parent), scatter_context, ) case None: diff --git a/cwl_utils/tests/test_parser_utils.py b/cwl_utils/tests/test_parser_utils.py index d4d24fa7..16d900b8 100644 --- a/cwl_utils/tests/test_parser_utils.py +++ b/cwl_utils/tests/test_parser_utils.py @@ -163,6 +163,7 @@ def test_v1_0_stdout_to_file() -> None: ) cwl_utils.parser.cwl_v1_0_utils.convert_stdstreams_to_files(clt) assert clt.stdout is not None + assert clt.outputs[0].outputBinding is not None assert clt.stdout == clt.outputs[0].outputBinding.glob @@ -195,6 +196,7 @@ def test_v1_0_stdout_to_file_preserve_original() -> None: ) cwl_utils.parser.cwl_v1_0_utils.convert_stdstreams_to_files(clt) assert clt.stdout == "original.txt" + assert clt.outputs[0].outputBinding is not None assert clt.stdout == clt.outputs[0].outputBinding.glob @@ -208,6 +210,7 @@ def test_v1_0_stderr_to_file() -> None: ) cwl_utils.parser.cwl_v1_0_utils.convert_stdstreams_to_files(clt) assert clt.stderr is not None + assert clt.outputs[0].outputBinding is not None assert clt.stderr == clt.outputs[0].outputBinding.glob @@ -240,6 +243,7 @@ def test_v1_0_stderr_to_file_preserve_original() -> None: ) cwl_utils.parser.cwl_v1_0_utils.convert_stdstreams_to_files(clt) assert clt.stderr == "original.txt" + assert clt.outputs[0].outputBinding is not None assert clt.stderr == clt.outputs[0].outputBinding.glob @@ -469,6 +473,7 @@ def test_v1_1_stdout_to_file() -> None: ) cwl_utils.parser.cwl_v1_1_utils.convert_stdstreams_to_files(clt) assert clt.stdout is not None + assert clt.outputs[0].outputBinding is not None assert clt.stdout == clt.outputs[0].outputBinding.glob @@ -501,6 +506,7 @@ def test_v1_1_stdout_to_file_preserve_original() -> None: ) cwl_utils.parser.cwl_v1_1_utils.convert_stdstreams_to_files(clt) assert clt.stdout == "original.txt" + assert clt.outputs[0].outputBinding is not None assert clt.stdout == clt.outputs[0].outputBinding.glob @@ -514,6 +520,7 @@ def test_v1_1_stderr_to_file() -> None: ) cwl_utils.parser.cwl_v1_1_utils.convert_stdstreams_to_files(clt) assert clt.stderr is not None + assert clt.outputs[0].outputBinding is not None assert clt.stderr == clt.outputs[0].outputBinding.glob @@ -546,6 +553,7 @@ def test_v1_1_stderr_to_file_preserve_original() -> None: ) cwl_utils.parser.cwl_v1_1_utils.convert_stdstreams_to_files(clt) assert clt.stderr == "original.txt" + assert clt.outputs[0].outputBinding is not None assert clt.stderr == clt.outputs[0].outputBinding.glob @@ -819,6 +827,7 @@ def test_v1_2_stdout_to_file() -> None: ) cwl_utils.parser.cwl_v1_2_utils.convert_stdstreams_to_files(clt) assert clt.stdout is not None + assert clt.outputs[0].outputBinding is not None assert clt.stdout == clt.outputs[0].outputBinding.glob @@ -851,6 +860,7 @@ def test_v1_2_stdout_to_file_preserve_original() -> None: ) cwl_utils.parser.cwl_v1_2_utils.convert_stdstreams_to_files(clt) assert clt.stdout == "original.txt" + assert clt.outputs[0].outputBinding is not None assert clt.stdout == clt.outputs[0].outputBinding.glob @@ -864,6 +874,7 @@ def test_v1_2_stderr_to_file() -> None: ) cwl_utils.parser.cwl_v1_2_utils.convert_stdstreams_to_files(clt) assert clt.stderr is not None + assert clt.outputs[0].outputBinding is not None assert clt.stderr == clt.outputs[0].outputBinding.glob @@ -896,6 +907,7 @@ def test_v1_2_stderr_to_file_preserve_original() -> None: ) cwl_utils.parser.cwl_v1_2_utils.convert_stdstreams_to_files(clt) assert clt.stderr == "original.txt" + assert clt.outputs[0].outputBinding is not None assert clt.stderr == clt.outputs[0].outputBinding.glob diff --git a/cwl_utils/tests/test_subscope.py b/cwl_utils/tests/test_subscope.py index 2f7d4d50..48a68c98 100644 --- a/cwl_utils/tests/test_subscope.py +++ b/cwl_utils/tests/test_subscope.py @@ -1,8 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 """Test that scoping of identifiers in Workflow.steps[].run is correct.""" - -from cwl_utils.parser import Workflow, load_document_by_uri +from cwl_utils.parser import Process, Workflow, load_document_by_uri from .util import get_path @@ -11,6 +10,7 @@ def test_workflow_step_process_scope_v1_0() -> None: """CWL v1.0 IDs under Workflow.steps[].run should not be scoped in the "run" scope.""" uri = get_path("testdata/workflow_input_format_expr.cwl").as_uri() cwl_obj: Workflow = load_document_by_uri(uri) + assert isinstance(cwl_obj.steps[0].run, Process) assert cwl_obj.steps[0].run.inputs[0].id.endswith("#format_extract/target") @@ -18,6 +18,7 @@ def test_workflow_step_process_scope_v1_1() -> None: """CWL v1.1 IDs under Workflow.steps[].run should be scoped in the "run" scope.""" uri = get_path("testdata/workflow_input_format_expr_v1_1.cwl").as_uri() cwl_obj: Workflow = load_document_by_uri(uri) + assert isinstance(cwl_obj.steps[0].run, Process) assert cwl_obj.steps[0].run.inputs[0].id.endswith("#format_extract/run/target") @@ -25,4 +26,5 @@ def test_workflow_step_process_scope_v1_2() -> None: """CWL v1.2 IDs under Workflow.steps[].run should be scoped in the "run" scope.""" uri = get_path("testdata/workflow_input_format_expr_v1_2.cwl").as_uri() cwl_obj: Workflow = load_document_by_uri(uri) + assert isinstance(cwl_obj.steps[0].run, Process) assert cwl_obj.steps[0].run.inputs[0].id.endswith("#format_extract/run/target") diff --git a/cwl_utils/types.py b/cwl_utils/types.py index e2cc2cf5..19189a99 100644 --- a/cwl_utils/types.py +++ b/cwl_utils/types.py @@ -2,13 +2,13 @@ # From https://github.com/rabix/sbpack/blob/b8404a0859ffcbe1edae6d8f934e51847b003320/sbpack/lib.py """Shared Python type definitions for commons JSON like CWL objects.""" import sys -from collections.abc import Mapping, MutableMapping, MutableSequence +from collections.abc import Mapping, MutableMapping, MutableSequence, Sequence from typing import Any, Literal, TypeAlias, TypedDict, TypeGuard if sys.version_info >= (3, 13): - from typing import TypeIs + from typing import TypeIs as TypeIs else: - from typing_extensions import TypeIs + from typing_extensions import TypeIs as TypeIs if sys.version_info >= (3, 11): from typing import Required @@ -160,3 +160,7 @@ def is_file_or_directory( value: Any, ) -> TypeIs[CWLFileType | CWLDirectoryType]: return isinstance(value, Mapping) and value.get("class") in ("File", "Directory") + + +def is_sequence(thing: object) -> TypeIs[Sequence[Any]]: + return isinstance(thing, Sequence) and not isinstance(thing, str) diff --git a/cwl_utils/utils.py b/cwl_utils/utils.py index a535fcfb..43e382a3 100644 --- a/cwl_utils/utils.py +++ b/cwl_utils/utils.py @@ -6,11 +6,11 @@ import urllib.error import urllib.parse import urllib.request -from collections.abc import MutableMapping, MutableSequence +from collections.abc import MutableMapping, MutableSequence, Sequence from copy import deepcopy from importlib.resources import files from io import StringIO -from typing import Any +from typing import Any, cast from urllib.parse import urlparse from ruamel.yaml.main import YAML @@ -380,11 +380,24 @@ def sanitise_schema_field( case {"type": {"type": "enum", **rest}}: schema_field_item["type"] = InputEnumSchemaV1_2( type_="enum", - symbols=rest.get("symbols", ""), + symbols=cast(Sequence[str], rest.get("symbols", [])), ) case {"type": {"type": "array", **rest}}: schema_field_item["type"] = InputArraySchemaV1_2( - type_="array", items=rest.get("items", "") + type_="array", + items=cast( + str + | cwl_v1_2.InputArraySchema + | cwl_v1_2.InputEnumSchema + | cwl_v1_2.InputRecordSchema + | Sequence[ + str + | cwl_v1_2.InputArraySchema + | cwl_v1_2.InputEnumSchema + | cwl_v1_2.InputRecordSchema, + ], + rest.get("items", ""), + ), ) case {"type": {"$import": _}}: pass # Leave import as is diff --git a/pyproject.toml b/pyproject.toml index 133b5929..0fe29d2c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -142,3 +142,4 @@ ignore = [ [tool.bandit] exclude_dirs = ["cwl_utils/tests"] +skips = ["B101"]