|
11 | 11 | from typing import Any, cast |
12 | 12 |
|
13 | 13 | from ruamel import yaml |
| 14 | +from schema_salad.metaschema import ArraySchema |
14 | 15 | from schema_salad.sourceline import SourceLine |
15 | 16 | from schema_salad.utils import json_dumps |
16 | 17 |
|
@@ -56,11 +57,11 @@ def escape_expression_field(contents: str) -> str: |
56 | 57 |
|
57 | 58 |
|
58 | 59 | def clean_type_ids( |
59 | | - cwltype: cwl.ArraySchema | cwl.InputRecordSchema, |
60 | | -) -> cwl.ArraySchema | cwl.InputRecordSchema: |
| 60 | + cwltype: ArraySchema | cwl.InputRecordSchema, |
| 61 | +) -> ArraySchema | cwl.InputRecordSchema: |
61 | 62 | """Simplify type identifiers.""" |
62 | 63 | result = copy.deepcopy(cwltype) |
63 | | - if isinstance(result, cwl.ArraySchema): |
| 64 | + if isinstance(result, ArraySchema): |
64 | 65 | if isinstance(result.items, MutableSequence): |
65 | 66 | for item in result.items: |
66 | 67 | if hasattr(item, "id"): |
@@ -339,8 +340,8 @@ def generate_etool_from_expr( |
339 | 340 | self_type = target |
340 | 341 | if isinstance(self_type, list): |
341 | 342 | new_type: ( |
342 | | - list[cwl.ArraySchema | cwl.InputRecordSchema] |
343 | | - | cwl.ArraySchema |
| 343 | + list[ArraySchema | cwl.InputRecordSchema] |
| 344 | + | ArraySchema |
344 | 345 | | cwl.InputRecordSchema |
345 | 346 | ) = [clean_type_ids(t.type_) for t in self_type] |
346 | 347 | else: |
@@ -715,7 +716,7 @@ def process_workflow_inputs_and_outputs( |
715 | 716 | else: |
716 | 717 | sources = [s.split("#")[-1] for s in param2.outputSource] |
717 | 718 | source_type_items = utils.type_for_source(workflow, sources) |
718 | | - if isinstance(source_type_items, cwl.ArraySchema): |
| 719 | + if isinstance(source_type_items, ArraySchema): |
719 | 720 | if isinstance(source_type_items.items, list): |
720 | 721 | if "null" not in source_type_items.items: |
721 | 722 | source_type_items.items.append("null") |
@@ -1452,7 +1453,7 @@ def traverse_CommandLineTool( |
1452 | 1453 | modified = True |
1453 | 1454 | inp_id = "_{}_glob".format(outp.id.split("#")[-1]) |
1454 | 1455 | etool_id = f"_expression_{step_id}{inp_id}" |
1455 | | - glob_target_type = ["string", cwl.ArraySchema("string", "array")] |
| 1456 | + glob_target_type = ["string", ArraySchema("string", "array")] |
1456 | 1457 | target = cwl.WorkflowInputParameter(id=None, type_=glob_target_type) |
1457 | 1458 | replace_step_clt_expr_with_etool( |
1458 | 1459 | expression, etool_id, parent, target, step, replace_etool |
@@ -1954,7 +1955,7 @@ def traverse_step( |
1954 | 1955 | source_types.append(temp_type) |
1955 | 1956 | source_type = cwl.WorkflowInputParameter( |
1956 | 1957 | id=None, |
1957 | | - type_=cwl.ArraySchema(source_types, "array"), |
| 1958 | + type_=ArraySchema(source_types, "array"), |
1958 | 1959 | ) |
1959 | 1960 | else: |
1960 | 1961 | input_source_id = inp.source.split("#")[-1] |
|
0 commit comments