From 5066c405e04af17b10cc51915b6452fe0c1334aa Mon Sep 17 00:00:00 2001 From: GlassOfWhiskey Date: Thu, 18 Dec 2025 22:12:41 +0100 Subject: [PATCH 01/22] Typed CWL parsers --- .gitignore | 3 + cwl_utils/cite_extract.py | 2 +- cwl_utils/cwl_v1_0_expression_refactor.py | 3 +- cwl_utils/cwl_v1_1_expression_refactor.py | 2 +- cwl_utils/cwl_v1_2_expression_refactor.py | 2 +- cwl_utils/docker_extract.py | 4 +- cwl_utils/inputs_schema_gen.py | 18 +- cwl_utils/parser/__init__.py | 6 + cwl_utils/parser/cwl_v1_0.py | 4177 +++++++++--------- cwl_utils/parser/cwl_v1_0_utils.py | 4 +- cwl_utils/parser/cwl_v1_1.py | 4458 ++++++++++--------- cwl_utils/parser/cwl_v1_1_utils.py | 7 +- cwl_utils/parser/cwl_v1_2.py | 4899 +++++++++++---------- cwl_utils/parser/cwl_v1_2_utils.py | 5 +- cwl_utils/parser/utils.py | 11 +- cwl_utils/tests/test_parser_utils.py | 12 + cwl_utils/tests/test_subscope.py | 5 +- 17 files changed, 7212 insertions(+), 6406 deletions(-) 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 1446319a..1a21aac8 100755 --- a/cwl_utils/cwl_v1_0_expression_refactor.py +++ b/cwl_utils/cwl_v1_0_expression_refactor.py @@ -1242,7 +1242,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 @@ -1466,6 +1466,7 @@ def traverse_CommandLineTool( inp.linkMerge = None for index, out in enumerate(new_clt_step.out): new_clt_step.out[index] = out.split("/")[-1] + 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: diff --git a/cwl_utils/cwl_v1_1_expression_refactor.py b/cwl_utils/cwl_v1_1_expression_refactor.py index 1bedf4c2..453e4124 100755 --- a/cwl_utils/cwl_v1_1_expression_refactor.py +++ b/cwl_utils/cwl_v1_1_expression_refactor.py @@ -1244,7 +1244,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 diff --git a/cwl_utils/cwl_v1_2_expression_refactor.py b/cwl_utils/cwl_v1_2_expression_refactor.py index 1fd73d74..1b667304 100755 --- a/cwl_utils/cwl_v1_2_expression_refactor.py +++ b/cwl_utils/cwl_v1_2_expression_refactor.py @@ -1347,7 +1347,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 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 3f7304d5..e42be946 100644 --- a/cwl_utils/inputs_schema_gen.py +++ b/cwl_utils/inputs_schema_gen.py @@ -13,7 +13,7 @@ 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 @@ -27,6 +27,7 @@ InputEnumSchema, InputRecordSchema, InputRecordSchemaTypes, + SchemaDefRequirement, Workflow, WorkflowInputParameter, cwl_v1_0, @@ -403,12 +404,15 @@ 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( diff --git a/cwl_utils/parser/__init__.py b/cwl_utils/parser/__init__.py index 6e105072..3ff92077 100644 --- a/cwl_utils/parser/__init__.py +++ b/cwl_utils/parser/__init__.py @@ -238,6 +238,12 @@ class NoType(ABC): | cwl_v1_2.WorkflowStepInput ) """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..4aedf527 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 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] | int | float | bool | str +) def extract_type(val_type: type[Any]) -> str: @@ -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,6 +1186,7 @@ def parser_info() -> str: return "org.w3id.cwl.v1_0" +@trait class Documented(Saveable): pass @@ -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.doc = doc + self.name = name self.type_ = 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,10 +1656,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.fields = fields self.type_ = 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): return bool( @@ -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.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols = symbols self.type_ = 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.items = items self.type_ = type_ - self.values = values + 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.values = 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.names = names self.type_ = 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,10 +2725,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.items = items self.type_ = type_ + attrs: ClassVar[Collection[str]] = frozenset(["items", "type"]) + + +class CWLRecordField(RecordField): + name: str + def __eq__(self, other: Any) -> bool: if isinstance(other, CWLRecordField): return bool( @@ -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.doc = doc + self.name = name self.type_ = 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 = fields + self.type_ = 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 | int = 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] = "https://w3id.org/cwl/cwl#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 + + 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,13 +4378,40 @@ 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] = "https://w3id.org/cwl/cwl#Directory" + self.location = location + self.path = path + self.basename = basename + self.listing = listing + + attrs: ClassVar[Collection[str]] = frozenset( + ["class", "location", "path", "basename", "listing"] + ) +@trait class SchemaBase(Saveable): pass +@trait class Parameter(SchemaBase): """ Define an input or output parameter to a process. @@ -4398,18 +4421,22 @@ class Parameter(SchemaBase): pass +@trait class InputBinding(Saveable): pass +@trait class OutputBinding(Saveable): pass +@trait class InputSchema(SchemaBase): pass +@trait class OutputSchema(SchemaBase): pass @@ -4417,30 +4444,6 @@ class OutputSchema(SchemaBase): 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 +4464,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 +4717,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 +4742,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 +4795,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 +4813,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields = fields + self.doc = doc + self.name = name self.type_ = type_ + self.inputBinding = inputBinding self.label = label - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + + 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 +4846,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 +5052,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 +5077,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 +5122,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 +5139,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.fields = fields self.type_ = type_ self.label = label - self.inputBinding = inputBinding + self.name = 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 +5172,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 +5426,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 +5451,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 +5503,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 +5521,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items + self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols = symbols self.type_ = type_ self.label = label self.inputBinding = 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 +5552,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 +5750,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 +5822,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 +5839,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.items = items self.type_ = type_ - self.outputBinding = outputBinding + self.label = label + self.inputBinding = 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 +5871,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 +6077,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 +6102,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 +6150,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 +6167,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields = fields + self.doc = doc + self.name = name self.type_ = type_ - self.label = label + self.outputBinding = 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 +6196,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 +6346,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 +6411,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,11 +6427,15 @@ 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.fields = fields self.type_ = type_ self.label = label - self.outputBinding = outputBinding + + attrs: ClassVar[Collection[str]] = frozenset(["fields", "type", "label"]) + + +class OutputEnumSchema(EnumSchema, OutputSchema): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, OutputEnumSchema): @@ -6448,8 +6459,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 +6713,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 +6738,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 +6790,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 +6808,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items + self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols = symbols self.type_ = type_ self.label = label self.outputBinding = 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 +6839,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 +7037,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 +7109,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 +7126,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.items = items self.type_ = type_ + self.label = label + self.outputBinding = 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 +7175,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 +7615,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 +7640,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,35 +7718,19 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( - [ - "label", - "secondaryFiles", - "streamable", - "doc", - "id", - "format", - "inputBinding", - "default", - "type", - ] - ) - - -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, + 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 @@ -7753,9 +7744,29 @@ def __init__( 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.id = id self.format = format + self.inputBinding = inputBinding + self.default = default + self.type_ = type_ + + attrs: ClassVar[Collection[str]] = frozenset( + [ + "label", + "secondaryFiles", + "streamable", + "doc", + "id", + "format", + "inputBinding", + "default", + "type", + ] + ) + + +class OutputParameter(Parameter): + id: str def __eq__(self, other: Any) -> bool: if isinstance(other, OutputParameter): @@ -7789,8 +7800,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 +8146,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 +8171,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 +8239,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 = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.outputBinding = outputBinding + self.format = format + + attrs: ClassVar[Collection[str]] = frozenset( [ "label", "secondaryFiles", @@ -8241,6 +8280,7 @@ def save( ) +@trait class ProcessRequirement(Saveable): """ A process requirement declares a prerequisite that may or must be fulfilled @@ -8255,6 +8295,7 @@ class ProcessRequirement(Saveable): pass +@trait class Process(Saveable): """ @@ -8275,23 +8316,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 +8333,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 +8404,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 +8470,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] = "https://w3id.org/cwl/cwl#InlineJavascriptRequirement" + self.expressionLib = expressionLib + + attrs: ClassVar[Collection[str]] = frozenset(["class", "expressionLib"]) class SchemaDefRequirement(ProcessRequirement): @@ -8461,23 +8502,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 +8516,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 +8588,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 +8651,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 +8665,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.envName = envName - self.envValue = envValue + self.class_: Final[str] = "https://w3id.org/cwl/cwl#SchemaDefRequirement" + self.types = 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 +8695,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 +8799,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 +8859,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 = envName + self.envValue = envValue + + attrs: ClassVar[Collection[str]] = frozenset(["envName", "envValue"]) class CommandLineBinding(InputBinding): @@ -8879,34 +8920,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 +8952,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 +9289,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 +9386,35 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + loadContents: None | bool = None, + position: None | int = 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 = loadContents + self.position = position + self.prefix = prefix + self.separate = separate + self.itemSeparator = itemSeparator + self.valueFrom = valueFrom + self.shellQuote = shellQuote + + attrs: ClassVar[Collection[str]] = frozenset( [ "loadContents", "position", @@ -9401,26 +9442,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 +9460,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 +9609,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 +9680,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 +9696,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 = glob + self.loadContents = loadContents + self.outputEval = 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 +9726,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 +9979,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 +10004,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 +10057,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 +10075,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields = fields + self.doc = doc + self.name = name self.type_ = type_ + self.inputBinding = inputBinding self.label = label - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + + 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 +10108,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 +10314,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 +10339,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 +10384,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 +10401,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.fields = fields self.type_ = type_ self.label = label - self.inputBinding = inputBinding + self.name = 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 +10434,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 +10688,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 +10713,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 +10765,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 +10783,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items + self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols = symbols self.type_ = type_ self.label = label self.inputBinding = 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 +10814,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 +11012,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 +11084,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 +11101,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.items = items self.type_ = type_ - self.outputBinding = outputBinding + self.label = label + self.inputBinding = 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 +11133,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 +11339,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 +11364,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 +11412,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 +11429,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields = fields + self.doc = doc + self.name = name self.type_ = type_ - self.label = label - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.outputBinding = 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 +11461,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 +11667,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 +11692,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 +11737,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 +11754,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.fields = fields self.type_ = type_ self.label = label - self.outputBinding = outputBinding + self.name = 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 +11787,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 +12041,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 +12066,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 +12118,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 +12136,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items + self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols = symbols self.type_ = type_ self.label = label self.outputBinding = 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 +12167,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 +12365,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 +12437,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 +12454,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.items = items self.type_ = type_ + self.label = label + self.outputBinding = 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 +12507,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 +12947,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 +12972,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,7 +13050,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_: 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 = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.format = format + self.inputBinding = inputBinding + self.default = default + self.type_ = type_ + + attrs: ClassVar[Collection[str]] = frozenset( [ "label", "secondaryFiles", @@ -13051,36 +13104,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 +13138,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 +13531,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 +13556,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 +13629,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 = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.outputBinding = outputBinding + self.format = format + self.type_ = type_ + + attrs: ClassVar[Collection[str]] = frozenset( [ "label", "secondaryFiles", @@ -13628,53 +13681,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 +13733,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 +14520,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 +14545,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 +14672,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["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"] | 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[int] = None, + temporaryFailCodes: None | Sequence[int] = None, + permanentFailCodes: None | Sequence[int] = 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 = 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_: Final[str] = "https://w3id.org/cwl/cwl#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 + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "inputs", @@ -14727,33 +14780,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 +14812,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 +15118,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 +15224,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] = "https://w3id.org/cwl/cwl#DockerRequirement" + self.dockerPull = dockerPull + self.dockerLoad = dockerLoad + self.dockerFile = dockerFile + self.dockerImport = dockerImport + self.dockerImageId = dockerImageId + self.dockerOutputDirectory = dockerOutputDirectory + + attrs: ClassVar[Collection[str]] = frozenset( [ "class", "dockerPull", @@ -15218,23 +15271,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 +15285,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 +15357,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 +15420,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 +15434,13 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.package = package - self.version = version - self.specs = specs + self.class_: Final[str] = "https://w3id.org/cwl/cwl#SoftwareRequirement" + self.packages = 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 +15459,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 +15609,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 +15673,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 +15689,21 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.entryname = entryname - self.entry = entry - self.writable = writable + self.package = package + self.version = version + self.specs = 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 +15723,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 +15873,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 +15941,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 +15957,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "InitialWorkDirRequirement" - self.listing = listing + self.entryname = entryname + self.entry = entry + self.writable = 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 +15983,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 +16055,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 +16118,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 +16132,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "EnvVarRequirement" - self.envDef = envDef + self.class_: Final[str] = "https://w3id.org/cwl/cwl#InitialWorkDirRequirement" + self.listing = 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 +16159,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 +16231,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 +16294,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] = "https://w3id.org/cwl/cwl#EnvVarRequirement" + self.envDef = envDef + + attrs: ClassVar[Collection[str]] = frozenset(["class", "envDef"]) class ShellCommandRequirement(ProcessRequirement): @@ -16273,21 +16326,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 +16340,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 +16364,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 +16420,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] = "https://w3id.org/cwl/cwl#ShellCommandRequirement" + + attrs: ClassVar[Collection[str]] = frozenset(["class"]) class ResourceRequirement(ProcessRequirement): @@ -16410,37 +16463,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 +16499,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 +16528,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 +16622,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 +16669,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 +16763,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 +16810,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 +16857,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 +16899,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 +17009,38 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + coresMin: None | int | str = None, + coresMax: None | int | str = None, + ramMin: None | int | str = None, + ramMax: None | int | str = None, + tmpdirMin: None | int | str = None, + tmpdirMax: None | int | str = None, + outdirMin: None | int | str = None, + outdirMax: None | int | 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] = "https://w3id.org/cwl/cwl#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 + + attrs: ClassVar[Collection[str]] = frozenset( [ "class", "coresMin", @@ -17005,36 +17058,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 +17092,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 +17485,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 +17510,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 +17583,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 = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.outputBinding = outputBinding + self.format = format + self.type_ = type_ + + attrs: ClassVar[Collection[str]] = frozenset( [ "label", "secondaryFiles", @@ -17582,39 +17635,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 +17673,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 +18132,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 +18157,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=id, + id=cast(str, id), inputs=inputs, outputs=outputs, requirements=requirements, @@ -18220,46 +18240,19 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( - [ - "id", - "inputs", - "outputs", - "requirements", - "hints", - "label", - "doc", - "cwlVersion", - "class", - "expression", - ] - ) - - -class WorkflowOutputParameter(OutputParameter): - """ - Describe an output parameter of a workflow. The parameter must be - connected to one or more parameters defined in the workflow that will - provide the value of the output 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, - outputSource: Optional[Any] = None, - linkMerge: Optional[Any] = None, - type_: Optional[Any] = None, - extension_fields: Optional[dict[str, Any]] = None, - loadingOptions: Optional[LoadingOptions] = None, + 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["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"] | None = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -18269,16 +18262,42 @@ 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.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_ + self.cwlVersion = cwlVersion + self.class_: Final[str] = "https://w3id.org/cwl/cwl#ExpressionTool" + self.expression = expression + + attrs: ClassVar[Collection[str]] = frozenset( + [ + "id", + "inputs", + "outputs", + "requirements", + "hints", + "label", + "doc", + "cwlVersion", + "class", + "expression", + ] + ) + + +class WorkflowOutputParameter(OutputParameter): + """ + Describe an output parameter of a workflow. The parameter must be + connected to one or more parameters defined in the workflow that will + provide the value of the output parameter. + + """ + + id: str def __eq__(self, other: Any) -> bool: if isinstance(other, WorkflowOutputParameter): @@ -18318,8 +18337,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 +18824,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 +18849,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 +18931,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 = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.outputBinding = outputBinding + self.format = format + self.outputSource = outputSource + self.linkMerge = linkMerge + self.type_ = type_ + + attrs: ClassVar[Collection[str]] = frozenset( [ "label", "secondaryFiles", @@ -18928,6 +18981,7 @@ def save( ) +@trait class Sink(Saveable): pass @@ -18978,30 +19032,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 +19054,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 +19306,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 +19331,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 +19380,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 = source + self.linkMerge = linkMerge + self.id = id + self.default = default + self.valueFrom = valueFrom + + attrs: ClassVar[Collection[str]] = frozenset( + ["source", "linkMerge", "id", "default", "valueFrom"] + ) class WorkflowStepOutput(Saveable): @@ -19364,22 +19420,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 +19434,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 +19498,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 +19521,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 +19551,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 = id + + attrs: ClassVar[Collection[str]] = frozenset(["id"]) class WorkflowStep(Saveable): @@ -19576,40 +19632,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 +19670,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 +20160,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 +20185,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 +20261,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 = id + 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 + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "in", @@ -20307,39 +20363,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 +20401,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 +20860,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 +20885,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 +20965,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["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"] | 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 = 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_: Final[str] = "https://w3id.org/cwl/cwl#Workflow" + self.steps = steps + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "inputs", @@ -20965,21 +21021,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 +21035,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 +21059,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 +21115,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 +21128,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "ScatterFeatureRequirement" + self.class_: Final[str] = "https://w3id.org/cwl/cwl#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 +21154,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 +21178,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 +21234,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 +21247,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "MultipleInputFeatureRequirement" + self.class_: Final[str] = "https://w3id.org/cwl/cwl#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 +21273,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 +21297,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 +21353,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 +21366,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "StepInputExpressionRequirement" + self.class_: Final[str] = "https://w3id.org/cwl/cwl#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 +21392,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 +21416,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 +21472,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 +21485,12 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "LoadListingRequirement" - self.loadListing = loadListing + self.class_: Final[str] = "https://w3id.org/cwl/cwl#StepInputExpressionRequirement" + + attrs: ClassVar[Collection[str]] = frozenset(["class"]) + +class LoadListingRequirement(ProcessRequirement): def __eq__(self, other: Any) -> bool: if isinstance(other, LoadListingRequirement): return bool( @@ -21468,8 +21507,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 +21579,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 +21645,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 +21659,13 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "InplaceUpdateRequirement" - self.inplaceUpdate = inplaceUpdate + self.class_: Final[str] = "http://commonwl.org/cwltool#LoadListingRequirement" + self.loadListing = 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 +21683,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 +21755,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 +21821,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 +21835,13 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "Secrets" - self.secrets = secrets + self.class_: Final[str] = "http://commonwl.org/cwltool#InplaceUpdateRequirement" + self.inplaceUpdate = 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 +21856,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 +21928,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 +21990,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 +22004,20 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "TimeLimit" - self.timelimit = timelimit + self.class_: Final[str] = "http://commonwl.org/cwltool#Secrets" + self.secrets = 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 +22035,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 +22107,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 +22173,24 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class", "timelimit"]) + def __init__( + self, + timelimit: int | 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] = "http://commonwl.org/cwltool#TimeLimit" + self.timelimit = timelimit + + attrs: ClassVar[Collection[str]] = frozenset(["class", "timelimit"]) class WorkReuse(ProcessRequirement): @@ -22151,23 +22207,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 +22223,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 +22295,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 +22361,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] = "http://commonwl.org/cwltool#WorkReuse" + self.enableReuse = enableReuse + + attrs: ClassVar[Collection[str]] = frozenset(["class", "enableReuse"]) class NetworkAccess(ProcessRequirement): @@ -22345,23 +22401,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 +22418,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 +22490,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 +22556,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 +22570,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] = "http://commonwl.org/cwltool#NetworkAccess" + self.networkAccess = 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 +22617,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"): @@ -23053,7 +23076,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 +23101,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 +23180,40 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + inputs: Sequence[InputParameter], + outputs: Sequence[OutputParameter], + 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["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"] | 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 = 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_: Final[str] = "http://commonwl.org/cwltool#ProcessGenerator" + self.run = run + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "inputs", @@ -23179,23 +23235,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 +23251,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 +23323,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 +23389,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: int | str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -23376,11 +23403,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] = "http://commonwl.org/cwltool#MPIRequirement" + self.processes = 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 +23443,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 +23657,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 +23747,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 | int | str = None, + cudaDeviceCountMin: None | int | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -23740,9 +23764,24 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "ShmSize" - self.shmSize = shmSize + self.class_: Final[str] = "http://commonwl.org/cwltool#CUDARequirement" + self.cudaComputeCapability = cudaComputeCapability + self.cudaDeviceCountMax = cudaDeviceCountMax + self.cudaDeviceCountMin = cudaDeviceCountMin + self.cudaVersionMin = 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 +23796,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 +23868,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 +23931,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] = "http://commonwl.org/cwltool#ShmSize" + self.shmSize = 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", @@ -24016,8 +24072,8 @@ def save( "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", @@ -24138,15 +24194,15 @@ def save( "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(int) +floattype: Final = _PrimitiveLoader(float) +booltype: Final = _PrimitiveLoader(bool) +None_type: Final = _PrimitiveLoader(type(None)) +Any_type: Final = _AnyLoader() +PrimitiveTypeLoader: Final = _EnumLoader( ( "null", "boolean", @@ -24172,17 +24228,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,26 +24257,26 @@ 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( +CWLInputFileLoader: Final = map_of_union_of_None_type_or_CWLObjectTypeLoader +CWLVersionLoader: Final = _EnumLoader( ( "draft-2", "draft-3.dev1", @@ -24240,35 +24296,49 @@ def save( """ Version symbols for published CWL document versions. """ -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 +24382,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 +24426,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 +24453,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 +24469,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 +24517,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 +24536,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 +24595,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 +24612,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 +24695,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 +24712,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 +24729,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 +24772,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 +24789,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 +24853,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 +24907,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 +24955,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 +25043,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 +25060,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 +25101,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 +25118,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 +25161,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 +25183,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 +25267,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 +25322,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 +25335,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 +25412,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 +25483,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 +25528,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, @@ -25319,12 +25557,15 @@ def save( map_of_union_of_None_type_or_CWLObjectTypeLoader, ) ) +CWLObjectType: TypeAlias = ( + "Directory | File | Mapping[str, CWLObjectType | None] | Sequence[CWLObjectType | None] | bool | float | int | 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 +25582,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 +25602,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 +25623,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 af1df11b..309dc2cf 100644 --- a/cwl_utils/parser/cwl_v1_0_utils.py +++ b/cwl_utils/parser/cwl_v1_0_utils.py @@ -205,7 +205,7 @@ def check_all_types( for parm_id in sourceField: srcs_of_sink += [src_dict[parm_id]] else: - parm_id = cast(str, sourceField) + parm_id = sourceField if parm_id not in src_dict: raise SourceLine(sink, sourceName, ValidationException).makeError( f"{sourceName} not found: {parm_id}" @@ -375,7 +375,7 @@ def type_for_step_input( 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]: + if 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") diff --git a/cwl_utils/parser/cwl_v1_1.py b/cwl_utils/parser/cwl_v1_1.py index 744cba7f..d03c8932 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 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] | int | float | bool | str +) def extract_type(val_type: type[Any]) -> str: @@ -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,6 +1186,7 @@ def parser_info() -> str: return "org.w3id.cwl.v1_1" +@trait class Documented(Saveable): pass @@ -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.doc = doc + self.name = name self.type_ = 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,10 +1656,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.fields = fields self.type_ = 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): return bool( @@ -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.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols = symbols self.type_ = 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.items = items self.type_ = type_ - self.values = values + 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.values = 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.names = names self.type_ = 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,10 +2725,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.items = items self.type_ = type_ + attrs: ClassVar[Collection[str]] = frozenset(["items", "type"]) + + +class CWLRecordField(RecordField): + name: str + def __eq__(self, other: Any) -> bool: if isinstance(other, CWLRecordField): return bool( @@ -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.doc = doc + self.name = name self.type_ = 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 = fields + self.type_ = 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 | int = 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] = "https://w3id.org/cwl/cwl#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 + + 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,37 +4378,70 @@ 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] = "https://w3id.org/cwl/cwl#Directory" + self.location = location + self.path = path + self.basename = basename + self.listing = listing + + attrs: ClassVar[Collection[str]] = frozenset( + ["class", "location", "path", "basename", "listing"] + ) +@trait class Labeled(Saveable): pass +@trait class Identified(Saveable): pass +@trait class IdentifierRequired(Identified): pass +@trait class LoadContents(Saveable): pass +@trait class FieldBase(Labeled): pass +@trait class InputFormat(Saveable): pass +@trait class OutputFormat(Saveable): pass +@trait class Parameter(FieldBase, Documented, IdentifierRequired): """ Define an input or output parameter to a process. @@ -4423,22 +4452,6 @@ class Parameter(FieldBase, Documented, IdentifierRequired): 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 +4466,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 +4521,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,17 +4579,36 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["loadContents"]) + def __init__( + self, + loadContents: 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 = loadContents + attrs: ClassVar[Collection[str]] = frozenset(["loadContents"]) + +@trait class IOSchema(Labeled, Documented): pass +@trait class InputSchema(IOSchema): pass +@trait class OutputSchema(IOSchema): pass @@ -4584,38 +4616,6 @@ class OutputSchema(IOSchema): 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, - ) -> 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.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.format = format - self.loadContents = loadContents - self.loadListing = loadListing - def __eq__(self, other: Any) -> bool: if isinstance(other, InputRecordField): return bool( @@ -4652,8 +4652,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 +5093,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 +5118,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 +5199,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 = doc + self.name = name + self.type_ = type_ + self.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.format = format + self.loadContents = loadContents + self.loadListing = loadListing + + attrs: ClassVar[Collection[str]] = frozenset( [ "doc", "name", @@ -5217,30 +5249,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 +5269,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 +5522,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 +5547,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 +5597,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 +5615,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.fields = fields self.type_ = type_ self.label = label self.doc = doc + self.name = 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 +5649,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 +5903,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 +5928,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 +5977,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 +5995,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items + 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.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + + 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 +6029,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 +6283,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 +6308,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 +6357,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 +6375,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.items = items self.type_ = type_ self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.format = format + self.doc = doc + self.name = 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 +6421,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 +6768,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 +6793,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 +6858,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 +6878,21 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields = fields + self.doc = doc + self.name = name self.type_ = type_ self.label = label - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.format = 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 +6914,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 +7167,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 +7192,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 +7242,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 +7260,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.fields = fields self.type_ = type_ self.label = label self.doc = doc + self.name = 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 +7294,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 +7548,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 +7573,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 +7622,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 +7640,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items + 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.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + + 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 +7674,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 +7928,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 +7953,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,17 +8002,46 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["items", "type", "label", "doc", "name"]) + 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 = items + self.type_ = type_ + self.label = label + self.doc = doc + self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + + attrs: ClassVar[Collection[str]] = frozenset( + ["items", "type", "label", "doc", "name"] + ) +@trait class InputParameter(Parameter, InputFormat, LoadContents): pass +@trait class OutputParameter(Parameter, OutputFormat): pass +@trait class ProcessRequirement(Saveable): """ A process requirement declares a prerequisite that may or must be fulfilled @@ -8009,6 +8056,7 @@ class ProcessRequirement(Saveable): pass +@trait class Process(Identified, Labeled, Documented): """ @@ -8029,23 +8077,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 +8094,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 +8165,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,9 +8231,27 @@ 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] = "https://w3id.org/cwl/cwl#InlineJavascriptRequirement" + self.expressionLib = expressionLib + + attrs: ClassVar[Collection[str]] = frozenset(["class", "expressionLib"]) +@trait class CommandInputSchema(Saveable): pass @@ -8219,23 +8268,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 +8282,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 +8354,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 +8417,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 +8431,13 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.pattern = pattern - self.required = required + self.class_: Final[str] = "https://w3id.org/cwl/cwl#SchemaDefRequirement" + self.types = 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 +8454,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 +8557,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 +8617,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,17 +8632,27 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "LoadListingRequirement" - self.loadListing = loadListing + self.pattern = pattern + self.required = required - def __eq__(self, other: Any) -> bool: - if isinstance(other, LoadListingRequirement): - return bool( - self.class_ == other.class_ and self.loadListing == other.loadListing - ) - return False + attrs: ClassVar[Collection[str]] = frozenset(["pattern", "required"]) - def __hash__(self) -> int: + +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): + return bool( + self.class_ == other.class_ and self.loadListing == other.loadListing + ) + return False + + def __hash__(self) -> int: return hash((self.class_, self.loadListing)) @classmethod @@ -8629,8 +8661,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 +8732,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 +8798,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 +8812,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.envName = envName - self.envValue = envValue + self.class_: Final[str] = "https://w3id.org/cwl/cwl#LoadListingRequirement" + self.loadListing = 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 +8842,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 +8946,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 +9006,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 = envName + self.envValue = envValue + + attrs: ClassVar[Collection[str]] = frozenset(["envName", "envValue"]) class CommandLineBinding(InputBinding): @@ -9018,34 +9067,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 +9099,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 +9436,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 +9533,35 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + loadContents: None | bool = None, + position: None | int | 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 = loadContents + self.position = position + self.prefix = prefix + self.separate = separate + self.itemSeparator = itemSeparator + self.valueFrom = valueFrom + self.shellQuote = shellQuote + + attrs: ClassVar[Collection[str]] = frozenset( [ "loadContents", "position", @@ -9540,28 +9589,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 +9608,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 +9804,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 +9883,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 +9900,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.glob = glob + self.outputEval = outputEval + + attrs: ClassVar[Collection[str]] = frozenset( + ["loadContents", "loadListing", "glob", "outputEval"] + ) + + +@trait +class CommandLineBindable(Saveable): + pass + + +class CommandInputRecordField(InputRecordField, CommandLineBindable): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, CommandInputRecordField): @@ -9938,8 +9956,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 +10444,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 +10469,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 +10558,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 = doc + self.name = name + self.type_ = type_ + self.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.format = format + self.loadContents = loadContents + self.loadListing = loadListing + self.inputBinding = inputBinding + + attrs: ClassVar[Collection[str]] = frozenset( [ "doc", "name", @@ -10561,32 +10613,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 +10643,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 +10943,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 +10968,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 +11026,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,13 +11045,21 @@ 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.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 + 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): return bool( @@ -11062,8 +11090,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 +11391,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 +11416,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 +11473,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,13 +11492,23 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items + 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.name = name if name is not None else "_:" + str(_uuid__.uuid4()) self.inputBinding = 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): return bool( @@ -11502,8 +11532,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 +11833,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 +11858,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 +11915,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 +11934,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.items = items self.type_ = type_ self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.format = format - self.outputBinding = outputBinding + self.doc = doc + self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.inputBinding = 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 +11983,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 +12377,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 +12402,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 +12475,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 = doc + self.name = name + self.type_ = type_ + self.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.format = format + self.outputBinding = outputBinding + + attrs: ClassVar[Collection[str]] = frozenset( [ "doc", "name", @@ -12464,30 +12522,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 +12542,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 +12795,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 +12820,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 +12870,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 +12888,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.fields = fields self.type_ = type_ self.label = label self.doc = doc + self.name = 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 +12922,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 +13176,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 +13201,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 +13250,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 +13268,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items + 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.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + + 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 +13302,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 +13556,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 +13581,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 +13630,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 +13648,23 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() + self.items = items + self.type_ = type_ 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.name = 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 +13706,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 +14241,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 +14266,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 +14360,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 = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.format = format + self.loadContents = loadContents + self.loadListing = loadListing + self.default = default + self.type_ = type_ + self.inputBinding = inputBinding + + attrs: ClassVar[Collection[str]] = frozenset( [ "label", "secondaryFiles", @@ -14356,36 +14420,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 +14454,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 +14848,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 +14873,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 +14946,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 = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.format = format + self.type_ = type_ + self.outputBinding = outputBinding + + attrs: ClassVar[Collection[str]] = frozenset( [ "label", "secondaryFiles", @@ -14934,53 +14998,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 +15050,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 +15837,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 +15862,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 +15989,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["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"] | 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[int] = None, + temporaryFailCodes: None | Sequence[int] = None, + permanentFailCodes: None | Sequence[int] = 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 = 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_: Final[str] = "https://w3id.org/cwl/cwl#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 + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "label", @@ -16051,33 +16115,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 +16147,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 +16453,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 +16559,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] = "https://w3id.org/cwl/cwl#DockerRequirement" + self.dockerPull = dockerPull + self.dockerLoad = dockerLoad + self.dockerFile = dockerFile + self.dockerImport = dockerImport + self.dockerImageId = dockerImageId + self.dockerOutputDirectory = dockerOutputDirectory + + attrs: ClassVar[Collection[str]] = frozenset( [ "class", "dockerPull", @@ -16542,23 +16606,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 +16620,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 +16692,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 +16755,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 +16769,13 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.package = package - self.version = version - self.specs = specs + self.class_: Final[str] = "https://w3id.org/cwl/cwl#SoftwareRequirement" + self.packages = 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 +16794,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 +16944,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 +17008,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 +17024,21 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.entryname = entryname - self.entry = entry - self.writable = writable + self.package = package + self.version = version + self.specs = 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 +17058,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 +17208,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 +17276,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 +17292,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "InitialWorkDirRequirement" - self.listing = listing + self.entryname = entryname + self.entry = entry + self.writable = 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 +17318,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 +17390,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 +17453,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 +17467,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "EnvVarRequirement" - self.envDef = envDef + self.class_: Final[str] = "https://w3id.org/cwl/cwl#InitialWorkDirRequirement" + self.listing = 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 +17494,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 +17566,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 +17629,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] = "https://w3id.org/cwl/cwl#EnvVarRequirement" + self.envDef = envDef + + attrs: ClassVar[Collection[str]] = frozenset(["class", "envDef"]) class ShellCommandRequirement(ProcessRequirement): @@ -17597,21 +17661,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 +17675,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 +17699,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 +17755,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] = "https://w3id.org/cwl/cwl#ShellCommandRequirement" + + attrs: ClassVar[Collection[str]] = frozenset(["class"]) class ResourceRequirement(ProcessRequirement): @@ -17734,37 +17798,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 +17834,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 +17863,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 +17910,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 +17957,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 +18004,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 +18051,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 +18098,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 +18145,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 +18192,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 +18234,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 +18344,38 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + coresMin: None | int | str = None, + coresMax: None | int | str = None, + ramMin: None | int | str = None, + ramMax: None | int | str = None, + tmpdirMin: None | int | str = None, + tmpdirMax: None | int | str = None, + outdirMin: None | int | str = None, + outdirMax: None | int | 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] = "https://w3id.org/cwl/cwl#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 + + attrs: ClassVar[Collection[str]] = frozenset( [ "class", "coresMin", @@ -18340,23 +18404,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 +18420,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 +18492,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 +18558,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] = "https://w3id.org/cwl/cwl#WorkReuse" + self.enableReuse = enableReuse + + attrs: ClassVar[Collection[str]] = frozenset(["class", "enableReuse"]) class NetworkAccess(ProcessRequirement): @@ -18534,23 +18598,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 +18615,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 +18687,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 +18753,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] = "https://w3id.org/cwl/cwl#NetworkAccess" + self.networkAccess = networkAccess + + attrs: ClassVar[Collection[str]] = frozenset(["class", "networkAccess"]) class InplaceUpdateRequirement(ProcessRequirement): @@ -18744,23 +18808,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 +18825,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 +18897,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 +18963,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] = "https://w3id.org/cwl/cwl#InplaceUpdateRequirement" + self.inplaceUpdate = inplaceUpdate + + attrs: ClassVar[Collection[str]] = frozenset(["class", "inplaceUpdate"]) class ToolTimeLimit(ProcessRequirement): @@ -18931,23 +18995,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 +19011,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 +19041,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 +19083,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 +19149,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: int | str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -19128,13 +19163,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] = "https://w3id.org/cwl/cwl#ToolTimeLimit" + self.timelimit = 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 +19204,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 +19551,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 +19576,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, @@ -19603,31 +19639,19 @@ def save( r["$namespaces"] = self.loadingOptions.namespaces if self.loadingOptions.schemas: r["$schemas"] = self.loadingOptions.schemas - return r - - attrs = frozenset( - ["label", "secondaryFiles", "streamable", "doc", "id", "format", "type"] - ) - - -class WorkflowInputParameter(InputParameter): - 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, - 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 @@ -19641,13 +19665,17 @@ def __init__( self.secondaryFiles = secondaryFiles self.streamable = streamable self.doc = doc - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) + self.id = id self.format = format - self.loadContents = loadContents - self.loadListing = loadListing - self.default = default self.type_ = type_ - self.inputBinding = inputBinding + + 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 +19717,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 +20252,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 +20277,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 +20371,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 = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.format = format + self.loadContents = loadContents + self.loadListing = loadListing + self.default = default + self.type_ = type_ + self.inputBinding = inputBinding + + attrs: ClassVar[Collection[str]] = frozenset( [ "label", "secondaryFiles", @@ -20374,39 +20438,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 +20476,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 +20935,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 +20960,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 +21043,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["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"] | 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 = 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_: Final[str] = "https://w3id.org/cwl/cwl#ExpressionTool" + self.expression = expression + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "label", @@ -21039,38 +21103,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 +21139,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 +21580,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 +21605,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 +21679,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 = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.format = format + self.outputSource = outputSource + self.linkMerge = linkMerge + self.type_ = type_ + + attrs: ClassVar[Collection[str]] = frozenset( [ "label", "secondaryFiles", @@ -21662,6 +21726,7 @@ def save( ) +@trait class Sink(Saveable): pass @@ -21716,36 +21781,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 +21815,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 +22208,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 +22233,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 +22303,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 = id + self.source = source + self.linkMerge = linkMerge + self.loadContents = loadContents + self.loadListing = loadListing + self.label = label + self.default = default + self.valueFrom = valueFrom + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "source", @@ -22297,22 +22362,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 +22376,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 +22440,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 +22463,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=id, + id=cast(str, id), extension_fields=extension_fields, loadingOptions=loadingOptions, ) @@ -22444,7 +22493,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 = id + + attrs: ClassVar[Collection[str]] = frozenset(["id"]) class WorkflowStep(IdentifierRequired, Labeled, Documented): @@ -22509,40 +22574,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 +22612,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 +23104,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 +23129,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 +23205,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 = id + 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 + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "label", @@ -23242,39 +23307,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 +23345,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 +23804,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 +23829,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 +23909,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["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"] | 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 = 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_: Final[str] = "https://w3id.org/cwl/cwl#Workflow" + self.steps = steps + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "label", @@ -23900,21 +23965,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 +23979,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 +24003,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 +24059,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 +24072,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "ScatterFeatureRequirement" + self.class_: Final[str] = "https://w3id.org/cwl/cwl#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 +24098,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 +24122,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 +24178,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 +24191,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "MultipleInputFeatureRequirement" + self.class_: Final[str] = "https://w3id.org/cwl/cwl#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 +24217,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 +24241,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 +24297,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 +24310,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "StepInputExpressionRequirement" + self.class_: Final[str] = "https://w3id.org/cwl/cwl#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 +24336,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 +24360,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 +24416,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 +24429,12 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "Secrets" - self.secrets = secrets + self.class_: Final[str] = "https://w3id.org/cwl/cwl#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 +24449,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 +24521,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 +24583,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 +24597,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] = "http://commonwl.org/cwltool#Secrets" + self.secrets = 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 +24644,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"): @@ -25073,7 +25105,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 +25130,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 +25209,40 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + inputs: Sequence[CommandInputParameter | WorkflowInputParameter], + outputs: Sequence[CommandOutputParameter | ExpressionToolOutputParameter | WorkflowOutputParameter], + 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["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"] | 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 = 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_: Final[str] = "http://commonwl.org/cwltool#ProcessGenerator" + self.run = run + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "label", @@ -25199,23 +25264,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 +25280,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 +25352,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 +25418,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: int | str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -25396,11 +25432,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] = "http://commonwl.org/cwltool#MPIRequirement" + self.processes = 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 +25472,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 +25686,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 +25776,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 | int | str = None, + cudaDeviceCountMin: None | int | str = None, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -25760,9 +25793,24 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "ShmSize" - self.shmSize = shmSize + self.class_: Final[str] = "http://commonwl.org/cwltool#CUDARequirement" + self.cudaComputeCapability = cudaComputeCapability + self.cudaDeviceCountMax = cudaDeviceCountMax + self.cudaDeviceCountMin = cudaDeviceCountMin + self.cudaVersionMin = 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 +25825,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 +25897,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 +25960,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] = "http://commonwl.org/cwltool#ShmSize" + self.shmSize = 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", @@ -26050,8 +26115,8 @@ def save( "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", @@ -26186,15 +26251,15 @@ def save( "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(int) +floattype: Final = _PrimitiveLoader(float) +booltype: Final = _PrimitiveLoader(bool) +None_type: Final = _PrimitiveLoader(type(None)) +Any_type: Final = _AnyLoader() +PrimitiveTypeLoader: Final = _EnumLoader( ( "null", "boolean", @@ -26220,17 +26285,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 +26314,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,24 +26396,32 @@ 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( +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( ( "draft-2", "draft-3.dev1", @@ -26360,7 +26443,7 @@ def save( """ Version symbols for published CWL document versions. """ -LoadListingEnumLoader = _EnumLoader( +LoadListingEnumLoader: Final = _EnumLoader( ( "no_listing", "shallow_listing", @@ -26376,31 +26459,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 +26519,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 +26563,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 +26607,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 +26625,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 +26641,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 +26666,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 +26685,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 +26744,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 +26761,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 +26828,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 +26867,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 +26909,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 +26926,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 +26963,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 +26980,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 +27088,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 +27208,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 +27225,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 +27266,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 +27283,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 +27332,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 +27353,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 +27438,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 +27598,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 +27686,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, @@ -27450,12 +27715,15 @@ def save( map_of_union_of_None_type_or_CWLObjectTypeLoader, ) ) +CWLObjectType: TypeAlias = ( + "Directory | File | Mapping[str, CWLObjectType | None] | Sequence[CWLObjectType | None] | bool | float | int | 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 +27740,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 +27760,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 +27781,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 62265819..e85313f2 100644 --- a/cwl_utils/parser/cwl_v1_1_utils.py +++ b/cwl_utils/parser/cwl_v1_1_utils.py @@ -205,7 +205,7 @@ def check_all_types( for parm_id in sourceField: srcs_of_sink += [src_dict[parm_id]] else: - parm_id = cast(str, sourceField) + parm_id = sourceField if parm_id not in src_dict: raise SourceLine(sink, sourceName, ValidationException).makeError( f"{sourceName} not found: {parm_id}" @@ -307,8 +307,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" @@ -391,7 +390,7 @@ def type_for_step_input( 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]: + if 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") diff --git a/cwl_utils/parser/cwl_v1_2.py b/cwl_utils/parser/cwl_v1_2.py index 85f744fc..77a7c937 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 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] | int | float | bool | str +) def extract_type(val_type: type[Any]) -> str: @@ -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,6 +1186,7 @@ def parser_info() -> str: return "org.w3id.cwl.v1_2" +@trait class Documented(Saveable): pass @@ -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.doc = doc + self.name = name self.type_ = 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,10 +1656,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.fields = fields self.type_ = 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): return bool( @@ -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.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols = symbols self.type_ = 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.items = items self.type_ = type_ - self.values = values + 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.values = 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.names = names self.type_ = 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,10 +2725,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.items = items self.type_ = type_ + attrs: ClassVar[Collection[str]] = frozenset(["items", "type"]) + + +class CWLRecordField(RecordField): + name: str + def __eq__(self, other: Any) -> bool: if isinstance(other, CWLRecordField): return bool( @@ -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.doc = doc + self.name = name self.type_ = 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 = fields + self.type_ = 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 | int = 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] = "https://w3id.org/cwl/cwl#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 + + 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,37 +4378,70 @@ 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] = "https://w3id.org/cwl/cwl#Directory" + self.location = location + self.path = path + self.basename = basename + self.listing = listing + + attrs: ClassVar[Collection[str]] = frozenset( + ["class", "location", "path", "basename", "listing"] + ) +@trait class Labeled(Saveable): pass +@trait class Identified(Saveable): pass +@trait class IdentifierRequired(Identified): pass +@trait class LoadContents(Saveable): pass +@trait class FieldBase(Labeled): pass +@trait class InputFormat(Saveable): pass +@trait class OutputFormat(Saveable): pass +@trait class Parameter(FieldBase, Documented, IdentifierRequired): """ Define an input or output parameter to a process. @@ -4423,22 +4452,6 @@ class Parameter(FieldBase, Documented, IdentifierRequired): 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 +4466,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 +4521,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,17 +4579,36 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["loadContents"]) - - -class IOSchema(Labeled, Documented): + def __init__( + self, + loadContents: 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 = loadContents + + attrs: ClassVar[Collection[str]] = frozenset(["loadContents"]) + + +@trait +class IOSchema(Labeled, Documented): pass +@trait class InputSchema(IOSchema): pass +@trait class OutputSchema(IOSchema): pass @@ -4584,38 +4616,6 @@ class OutputSchema(IOSchema): 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, - ) -> 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.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.format = format - self.loadContents = loadContents - self.loadListing = loadListing - def __eq__(self, other: Any) -> bool: if isinstance(other, InputRecordField): return bool( @@ -4652,8 +4652,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 +5093,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 +5118,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 +5199,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 = doc + self.name = name + self.type_ = type_ + self.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.format = format + self.loadContents = loadContents + self.loadListing = loadListing + + attrs: ClassVar[Collection[str]] = frozenset( [ "doc", "name", @@ -5217,30 +5249,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 +5269,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 +5522,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 +5547,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 +5597,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 +5615,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.fields = fields self.type_ = type_ self.label = label self.doc = doc + self.name = 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 +5649,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 +5903,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 +5928,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 +5977,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 +5995,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items + 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.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + + 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 +6029,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 +6283,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 +6308,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 +6357,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 +6375,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.items = items self.type_ = type_ self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.format = format + self.doc = doc + self.name = 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 +6421,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 +6768,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 +6793,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 +6858,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 +6878,21 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields = fields + self.doc = doc + self.name = name self.type_ = type_ self.label = label - self.doc = doc - self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.format = 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 +6914,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 +7167,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 +7192,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 +7242,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 +7260,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.fields = fields self.type_ = type_ self.label = label self.doc = doc + self.name = 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 +7294,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 +7548,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 +7573,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 +7622,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 +7640,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items + 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.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + + 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 +7674,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 +7928,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 +7953,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,17 +8002,46 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["items", "type", "label", "doc", "name"]) + 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 = items + self.type_ = type_ + self.label = label + self.doc = doc + self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + + attrs: ClassVar[Collection[str]] = frozenset( + ["items", "type", "label", "doc", "name"] + ) +@trait class InputParameter(Parameter, InputFormat, LoadContents): pass +@trait class OutputParameter(Parameter, OutputFormat): pass +@trait class ProcessRequirement(Saveable): """ A process requirement declares a prerequisite that may or must be fulfilled @@ -8009,6 +8056,7 @@ class ProcessRequirement(Saveable): pass +@trait class Process(Identified, Labeled, Documented): """ @@ -8029,23 +8077,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 +8094,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 +8165,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,9 +8231,27 @@ 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] = "https://w3id.org/cwl/cwl#InlineJavascriptRequirement" + self.expressionLib = expressionLib + + attrs: ClassVar[Collection[str]] = frozenset(["class", "expressionLib"]) +@trait class CommandInputSchema(Saveable): pass @@ -8224,23 +8273,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 +8287,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 +8359,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 +8422,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] = "https://w3id.org/cwl/cwl#SchemaDefRequirement" + self.types = types + + attrs: ClassVar[Collection[str]] = frozenset(["class", "types"]) class SecondaryFileSchema(Saveable): @@ -8411,24 +8460,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 +8476,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 +8579,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 +8639,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 +8654,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "LoadListingRequirement" - self.loadListing = loadListing + self.pattern = pattern + self.required = 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 +8683,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 +8754,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 +8820,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 +8834,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.envName = envName - self.envValue = envValue + self.class_: Final[str] = "https://w3id.org/cwl/cwl#LoadListingRequirement" + self.loadListing = 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 +8864,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 +8968,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 +9028,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 = envName + self.envValue = envValue + + attrs: ClassVar[Collection[str]] = frozenset(["envName", "envValue"]) class CommandLineBinding(InputBinding): @@ -9040,34 +9089,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 +9121,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 +9458,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 +9555,35 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + loadContents: None | bool = None, + position: None | int | 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 = loadContents + self.position = position + self.prefix = prefix + self.separate = separate + self.itemSeparator = itemSeparator + self.valueFrom = valueFrom + self.shellQuote = shellQuote + + attrs: ClassVar[Collection[str]] = frozenset( [ "loadContents", "position", @@ -9562,28 +9611,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 +9630,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 +9826,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 +9905,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 +9922,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.glob = glob + self.outputEval = outputEval + + attrs: ClassVar[Collection[str]] = frozenset( + ["loadContents", "loadListing", "glob", "outputEval"] + ) + + +@trait +class CommandLineBindable(Saveable): + pass + + +class CommandInputRecordField(InputRecordField, CommandLineBindable): + name: str def __eq__(self, other: Any) -> bool: if isinstance(other, CommandInputRecordField): @@ -9960,8 +9978,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 +10466,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 +10491,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 +10580,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 = doc + self.name = name + self.type_ = type_ + self.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.format = format + self.loadContents = loadContents + self.loadListing = loadListing + self.inputBinding = inputBinding + + attrs: ClassVar[Collection[str]] = frozenset( [ "doc", "name", @@ -10583,32 +10635,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 +10665,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 +10965,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 +10990,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 +11048,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,13 +11067,21 @@ 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.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 + 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): return bool( @@ -11084,8 +11112,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 +11413,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 +11438,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 +11495,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,13 +11514,23 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items + 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.name = name if name is not None else "_:" + str(_uuid__.uuid4()) self.inputBinding = 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): return bool( @@ -11524,8 +11554,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 +11855,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 +11880,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 +11937,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 +11956,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.items = items self.type_ = type_ self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.format = format - self.outputBinding = outputBinding + self.doc = doc + self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.inputBinding = 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 +12005,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 +12399,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 +12424,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 +12497,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 = doc + self.name = name + self.type_ = type_ + self.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.format = format + self.outputBinding = outputBinding + + attrs: ClassVar[Collection[str]] = frozenset( [ "doc", "name", @@ -12486,30 +12544,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 +12564,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 +12817,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 +12842,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 +12892,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 +12910,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.fields = fields self.type_ = type_ self.label = label self.doc = doc + self.name = 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 +12944,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 +13198,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 +13223,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 +13272,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 +13290,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items + 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.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + + 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 +13324,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 +13578,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 +13603,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 +13652,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 +13670,23 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() + self.items = items + self.type_ = type_ 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.name = 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 +13728,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 +14263,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 +14288,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 +14382,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 = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.format = format + self.loadContents = loadContents + self.loadListing = loadListing + self.default = default + self.type_ = type_ + self.inputBinding = inputBinding + + attrs: ClassVar[Collection[str]] = frozenset( [ "label", "secondaryFiles", @@ -14378,36 +14442,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 +14476,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 +14870,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 +14895,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 +14968,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 = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.format = format + self.type_ = type_ + self.outputBinding = outputBinding + + attrs: ClassVar[Collection[str]] = frozenset( [ "label", "secondaryFiles", @@ -14956,55 +15020,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 +15074,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 +15908,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 +15933,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 +16064,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["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"] | 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[int] = None, + temporaryFailCodes: None | Sequence[int] = None, + permanentFailCodes: None | Sequence[int] = 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 = 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_: Final[str] = "https://w3id.org/cwl/cwl#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 + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "label", @@ -16129,33 +16193,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 +16225,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 +16531,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 +16637,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] = "https://w3id.org/cwl/cwl#DockerRequirement" + self.dockerPull = dockerPull + self.dockerLoad = dockerLoad + self.dockerFile = dockerFile + self.dockerImport = dockerImport + self.dockerImageId = dockerImageId + self.dockerOutputDirectory = dockerOutputDirectory + + attrs: ClassVar[Collection[str]] = frozenset( [ "class", "dockerPull", @@ -16620,23 +16684,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 +16698,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 +16770,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 +16833,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 +16847,13 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.package = package - self.version = version - self.specs = specs + self.class_: Final[str] = "https://w3id.org/cwl/cwl#SoftwareRequirement" + self.packages = 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 +16872,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 +17022,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 +17086,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 = package + self.version = version + self.specs = specs + + attrs: ClassVar[Collection[str]] = frozenset(["package", "version", "specs"]) class Dirent(Saveable): @@ -17058,26 +17122,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 +17140,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 +17290,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 +17358,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 +17374,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "InitialWorkDirRequirement" - self.listing = listing + self.entryname = entryname + self.entry = entry + self.writable = 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 +17401,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 +17473,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 +17536,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 +17550,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "EnvVarRequirement" - self.envDef = envDef + self.class_: Final[str] = "https://w3id.org/cwl/cwl#InitialWorkDirRequirement" + self.listing = 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 +17577,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 +17649,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 +17712,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] = "https://w3id.org/cwl/cwl#EnvVarRequirement" + self.envDef = envDef + + attrs: ClassVar[Collection[str]] = frozenset(["class", "envDef"]) class ShellCommandRequirement(ProcessRequirement): @@ -17680,21 +17744,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 +17758,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 +17782,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 +17838,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] = "https://w3id.org/cwl/cwl#ShellCommandRequirement" + + attrs: ClassVar[Collection[str]] = frozenset(["class"]) class ResourceRequirement(ProcessRequirement): @@ -17822,37 +17886,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 +17922,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 +17951,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 +17998,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 +18045,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 +18092,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 +18139,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 +18186,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 +18233,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 +18280,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 +18322,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 +18432,38 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + coresMin: None | float | int | str = None, + coresMax: None | float | int | str = None, + ramMin: None | float | int | str = None, + ramMax: None | float | int | str = None, + tmpdirMin: None | float | int | str = None, + tmpdirMax: None | float | int | str = None, + outdirMin: None | float | int | str = None, + outdirMax: None | float | int | 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] = "https://w3id.org/cwl/cwl#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 + + attrs: ClassVar[Collection[str]] = frozenset( [ "class", "coresMin", @@ -18428,23 +18492,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 +18508,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 +18580,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 +18646,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] = "https://w3id.org/cwl/cwl#WorkReuse" + self.enableReuse = enableReuse + + attrs: ClassVar[Collection[str]] = frozenset(["class", "enableReuse"]) class NetworkAccess(ProcessRequirement): @@ -18622,23 +18686,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 +18703,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 +18775,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 +18841,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] = "https://w3id.org/cwl/cwl#NetworkAccess" + self.networkAccess = networkAccess + + attrs: ClassVar[Collection[str]] = frozenset(["class", "networkAccess"]) class InplaceUpdateRequirement(ProcessRequirement): @@ -18832,23 +18896,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 +18913,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 +18985,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,7 +19051,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] = "https://w3id.org/cwl/cwl#InplaceUpdateRequirement" + self.inplaceUpdate = inplaceUpdate + + attrs: ClassVar[Collection[str]] = frozenset(["class", "inplaceUpdate"]) class ToolTimeLimit(ProcessRequirement): @@ -19019,23 +19083,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( @@ -19052,8 +19099,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 +19129,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 +19171,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 +19237,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: int | str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -19216,13 +19251,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] = "https://w3id.org/cwl/cwl#ToolTimeLimit" + self.timelimit = 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 +19292,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 +19639,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 +19664,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 +19729,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 @@ -19729,13 +19753,17 @@ def __init__( self.secondaryFiles = secondaryFiles self.streamable = streamable self.doc = doc - self.id = id if id is not None else "_:" + str(_uuid__.uuid4()) + self.id = id self.format = format - self.loadContents = loadContents - self.loadListing = loadListing - self.default = default self.type_ = type_ - self.inputBinding = inputBinding + + 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 +19805,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 +20340,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 +20365,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 +20459,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 = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.format = format + self.loadContents = loadContents + self.loadListing = loadListing + self.default = default + self.type_ = type_ + self.inputBinding = inputBinding + + attrs: ClassVar[Collection[str]] = frozenset( [ "label", "secondaryFiles", @@ -20462,41 +20526,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 +20566,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 +21072,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 +21097,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 +21184,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["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"] | 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 = 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_: Final[str] = "https://w3id.org/cwl/cwl#ExpressionTool" + self.expression = expression + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "label", @@ -21186,40 +21250,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 +21288,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 +21776,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 +21801,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 +21880,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 = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.format = format + self.outputSource = outputSource + self.linkMerge = linkMerge + self.pickValue = pickValue + self.type_ = type_ + + attrs: ClassVar[Collection[str]] = frozenset( [ "label", "secondaryFiles", @@ -21866,6 +21930,7 @@ def save( ) +@trait class Sink(Saveable): pass @@ -21985,38 +22050,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 +22086,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 +22526,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 +22551,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 +22626,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 = id + self.source = source + self.linkMerge = linkMerge + self.pickValue = pickValue + self.loadContents = loadContents + self.loadListing = loadListing + self.label = label + self.default = default + self.valueFrom = valueFrom + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "source", @@ -22623,22 +22688,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 +22702,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 +22766,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 +22789,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 +22819,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 = id + + attrs: ClassVar[Collection[str]] = frozenset(["id"]) class WorkflowStep(IdentifierRequired, Labeled, Documented): @@ -22848,53 +22913,17 @@ class WorkflowStep(IdentifierRequired, Labeled, Documented): # Subworkflows - To specify a nested workflow as part of a workflow step, - [SubworkflowFeatureRequirement](#SubworkflowFeatureRequirement) must be - specified in the workflow or workflow step requirements. - - It is a fatal error if a workflow directly or indirectly invokes itself as - a subworkflow (recursive workflows are not allowed). - - """ - - 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 - + To specify a nested workflow as part of a workflow step, + [SubworkflowFeatureRequirement](#SubworkflowFeatureRequirement) must be + specified in the workflow or workflow step requirements. + + It is a fatal error if a workflow directly or indirectly invokes itself as + a subworkflow (recursive workflows are not allowed). + + """ + + id: str + def __eq__(self, other: Any) -> bool: if isinstance(other, WorkflowStep): return bool( @@ -22935,8 +22964,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 +23503,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 +23528,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 +23609,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 = id + 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 + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "label", @@ -23655,41 +23720,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 +23760,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 +24266,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 +24291,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 +24375,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["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"] | 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 = 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_: Final[str] = "https://w3id.org/cwl/cwl#Workflow" + self.steps = steps + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "label", @@ -24369,21 +24434,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 +24448,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 +24472,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 +24528,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 +24541,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "ScatterFeatureRequirement" + self.class_: Final[str] = "https://w3id.org/cwl/cwl#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 +24567,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 +24591,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 +24647,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 +24660,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "MultipleInputFeatureRequirement" + self.class_: Final[str] = "https://w3id.org/cwl/cwl#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 +24686,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 +24710,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 +24766,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 +24779,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "StepInputExpressionRequirement" + self.class_: Final[str] = "https://w3id.org/cwl/cwl#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 +24805,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 +24829,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: @@ -24835,31 +24885,10 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset(["class"]) - - -class OperationInputParameter(InputParameter): - """ - Describe an input parameter of an operation. - - """ - - 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, - 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 +24898,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] = "https://w3id.org/cwl/cwl#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 +24949,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 +25437,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 +25462,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 +25548,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 = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.format = format + self.loadContents = loadContents + self.loadListing = loadListing + self.default = default + self.type_ = type_ + + attrs: ClassVar[Collection[str]] = frozenset( [ "label", "secondaryFiles", @@ -25541,34 +25606,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 +25638,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 +25985,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 +26010,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 +26075,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 = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.format = format + self.type_ = type_ + + attrs: ClassVar[Collection[str]] = frozenset( ["label", "secondaryFiles", "streamable", "doc", "id", "format", "type"] ) @@ -26057,39 +26122,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 +26160,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 +26618,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 +26643,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 +26722,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["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"] | 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 = 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_: Final[str] = "https://w3id.org/cwl/cwl#Operation" + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "label", @@ -26707,23 +26772,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 +26786,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 +26858,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 +26920,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 +26934,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] = "http://commonwl.org/cwltool#Secrets" + self.secrets = 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 +26983,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"): @@ -27461,7 +27491,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 +27516,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 +27599,42 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + inputs: Sequence[CommandInputParameter | OperationInputParameter | WorkflowInputParameter], + outputs: Sequence[CommandOutputParameter | ExpressionToolOutputParameter | OperationOutputParameter | WorkflowOutputParameter], + 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["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"] | 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 = 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_: Final[str] = "http://commonwl.org/cwltool#ProcessGenerator" + self.run = run + + attrs: ClassVar[Collection[str]] = frozenset( [ "id", "label", @@ -27592,23 +27657,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 +27673,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 +27745,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 +27811,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: int | str, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, ) -> None: if extension_fields: self.extension_fields = extension_fields @@ -27789,11 +27825,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] = "http://commonwl.org/cwltool#MPIRequirement" + self.processes = 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 +27865,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 +28079,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 +28169,30 @@ def save( r["$schemas"] = self.loadingOptions.schemas return r - attrs = frozenset( + def __init__( + self, + cudaComputeCapability: Sequence[str] | str, + cudaVersionMin: str, + cudaDeviceCountMax: None | int | str = None, + cudaDeviceCountMin: None | int | 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] = "http://commonwl.org/cwltool#CUDARequirement" + self.cudaComputeCapability = cudaComputeCapability + self.cudaDeviceCountMax = cudaDeviceCountMax + self.cudaDeviceCountMin = cudaDeviceCountMin + self.cudaVersionMin = cudaVersionMin + + attrs: ClassVar[Collection[str]] = frozenset( [ "class", "cudaComputeCapability", @@ -28141,32 +28206,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 +28236,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 +28535,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 +28560,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 +28614,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 = 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 + + attrs: ClassVar[Collection[str]] = frozenset( ["default", "id", "linkMerge", "loopSource", "pickValue", "valueFrom"] ) @@ -28597,27 +28662,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 +28681,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 +28849,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 +28925,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 +28941,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_ = "ShmSize" - self.shmSize = shmSize + self.class_: Final[str] = "http://commonwl.org/cwltool#Loop" + self.loop = loop + self.loopWhen = loopWhen + self.outputMethod = 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 +28966,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 +29038,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 +29101,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] = "http://commonwl.org/cwltool#ShmSize" + self.shmSize = 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", @@ -29206,8 +29273,8 @@ def save( "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", @@ -29359,15 +29426,15 @@ def save( "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(int) +floattype: Final = _PrimitiveLoader(float) +booltype: Final = _PrimitiveLoader(bool) +None_type: Final = _PrimitiveLoader(type(None)) +Any_type: Final = _AnyLoader() +PrimitiveTypeLoader: Final = _EnumLoader( ( "null", "boolean", @@ -29393,17 +29460,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 +29489,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,24 +29573,32 @@ 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( +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( ( "draft-2", "draft-3.dev1", @@ -29541,7 +29626,7 @@ def save( """ Version symbols for published CWL document versions. """ -LoadListingEnumLoader = _EnumLoader( +LoadListingEnumLoader: Final = _EnumLoader( ( "no_listing", "shallow_listing", @@ -29557,31 +29642,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 +29702,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 +29750,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 +29794,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 +29812,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 +29823,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 +29839,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 +29872,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 +29891,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 +29950,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 +29967,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 +30034,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 +30073,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 +30115,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 +30132,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 +30169,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 +30186,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 +30243,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 +30299,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 +30422,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 +30439,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 +30480,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 +30497,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 +30546,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 +30567,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 +30652,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 +30822,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 +30944,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, @@ -30702,12 +30974,15 @@ def save( map_of_union_of_None_type_or_CWLObjectTypeLoader, ) ) +CWLObjectType: TypeAlias = ( + "Directory | File | Mapping[str, CWLObjectType | None] | Sequence[CWLObjectType | None] | bool | float | int | 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 +30999,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 +31019,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 +31040,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 f770da8f..ad20f86a 100644 --- a/cwl_utils/parser/cwl_v1_2_utils.py +++ b/cwl_utils/parser/cwl_v1_2_utils.py @@ -405,8 +405,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" @@ -489,7 +488,7 @@ def type_for_step_input( 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]: + if 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") diff --git a/cwl_utils/parser/utils.py b/cwl_utils/parser/utils.py index 967beb12..cfbdc95d 100644 --- a/cwl_utils/parser/utils.py +++ b/cwl_utils/parser/utils.py @@ -160,9 +160,7 @@ def static_checker(workflow: cwl_utils.parser.Workflow) -> None: 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_ } ) @@ -483,12 +481,7 @@ def param_for_source_id( ) 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, - ), + process, sourcenames, cast(cwl_utils.parser.cwl_v1_2.Workflow, parent), scatter_context, diff --git a/cwl_utils/tests/test_parser_utils.py b/cwl_utils/tests/test_parser_utils.py index d977ec75..2f2610bb 100644 --- a/cwl_utils/tests/test_parser_utils.py +++ b/cwl_utils/tests/test_parser_utils.py @@ -199,6 +199,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 @@ -231,6 +232,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 @@ -244,6 +246,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 @@ -276,6 +279,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 @@ -505,6 +509,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 @@ -537,6 +542,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 @@ -550,6 +556,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 @@ -582,6 +589,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 @@ -855,6 +863,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 @@ -887,6 +896,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 @@ -900,6 +910,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 @@ -932,6 +943,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 d50bf958..48a68c98 100644 --- a/cwl_utils/tests/test_subscope.py +++ b/cwl_utils/tests/test_subscope.py @@ -1,7 +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 @@ -10,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") @@ -17,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") @@ -24,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") From fb002163c2a2734af3dbb52055c805e2902fd88e Mon Sep 17 00:00:00 2001 From: "Michael R. Crusoe" Date: Fri, 19 Dec 2025 17:29:29 +0100 Subject: [PATCH 02/22] WIP expression_refactor type fixes --- cwl_utils/cwl_v1_0_expression_refactor.py | 1010 ++++++++++++++++----- cwl_utils/parser/cwl_v1_0_utils.py | 14 +- 2 files changed, 794 insertions(+), 230 deletions(-) diff --git a/cwl_utils/cwl_v1_0_expression_refactor.py b/cwl_utils/cwl_v1_0_expression_refactor.py index 1a21aac8..03628bb7 100755 --- a/cwl_utils/cwl_v1_0_expression_refactor.py +++ b/cwl_utils/cwl_v1_0_expression_refactor.py @@ -8,7 +8,7 @@ import uuid from collections.abc import MutableSequence, Sequence from contextlib import suppress -from typing import Any, cast +from typing import Any, Literal, TypeAlias, TypeVar, cast from ruamel import yaml from schema_salad.sourceline import SourceLine @@ -56,33 +56,111 @@ 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: +BasicInputTypeSchemas: TypeAlias = ( + cwl.InputArraySchema + | cwl.InputEnumSchema + | cwl.InputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] +) +InputTypeSchemas: TypeAlias = ( + BasicInputTypeSchemas | Sequence[BasicInputTypeSchemas] | None +) +BasicCommandOutputTypeSchemas: TypeAlias = ( + cwl.CommandOutputArraySchema + | cwl.CommandOutputEnumSchema + | cwl.CommandOutputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] +) +CommandOutputTypeSchemas: TypeAlias = ( + BasicCommandOutputTypeSchemas | Sequence[BasicCommandOutputTypeSchemas] | None +) +AnyTypeSchema = TypeVar( + "AnyTypeSchema", bound=InputTypeSchemas | CommandOutputTypeSchemas +) + + +def _clean_type_ids( + cwltype: InputTypeSchemas | CommandOutputTypeSchemas, +) -> None: + if isinstance(cwltype, cwl.ArraySchema): + if isinstance(cwltype.items, Sequence): + 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 isinstance(result, Sequence): + 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 isinstance(field, Sequence): + 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. @@ -137,6 +215,439 @@ def get_expression( return None +def _plain_input_type_to_clt_input( + input_type: ( + cwl.InputArraySchema + | cwl.InputEnumSchema + | cwl.InputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | str + ), +) -> ( + cwl.CommandInputArraySchema + | cwl.CommandInputEnumSchema + | cwl.CommandInputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | str +): + 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_type_to_clt_input( + input_type: ( + cwl.InputArraySchema + | cwl.InputEnumSchema + | cwl.InputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | None + | Sequence[ + cwl.InputArraySchema + | cwl.InputEnumSchema + | cwl.InputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | str + ] + | str + ), +) -> ( + cwl.CommandInputArraySchema + | cwl.CommandInputEnumSchema + | cwl.CommandInputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | None + | Sequence[ + cwl.CommandInputArraySchema + | cwl.CommandInputEnumSchema + | cwl.CommandInputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | str + ] + | str +): + if isinstance(input_type, Sequence): + return [ + _plain_input_type_to_clt_input(input_type_item) + for input_type_item in input_type + ] + if input_type is None: + return None + return _plain_input_type_to_clt_input(input_type) + + +def _plain_input_type_to_plain_output( + input_type: ( + cwl.InputArraySchema + | cwl.InputEnumSchema + | cwl.InputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | str + ), +) -> ( + cwl.OutputArraySchema + | cwl.OutputEnumSchema + | cwl.OutputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | str +): + 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_type_to_plain_output( + input_type: ( + cwl.InputArraySchema + | cwl.InputEnumSchema + | cwl.InputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | None + | Sequence[ + cwl.InputArraySchema + | cwl.InputEnumSchema + | cwl.InputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | str + ] + | str + ), +) -> ( + cwl.OutputArraySchema + | cwl.OutputEnumSchema + | cwl.OutputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | None + | Sequence[ + cwl.OutputArraySchema + | cwl.OutputEnumSchema + | cwl.OutputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | str + ] + | str +): + if isinstance(input_type, Sequence): + return [ + _plain_input_type_to_plain_output(input_type_item) + for input_type_item in input_type + ] + if input_type is None: + return None + return _plain_input_type_to_plain_output(input_type) + + +def _plain_output_type_to_clt_output( + output_type: ( + cwl.OutputArraySchema + | cwl.OutputEnumSchema + | cwl.OutputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | str + ), +) -> ( + cwl.CommandOutputArraySchema + | cwl.CommandOutputEnumSchema + | cwl.CommandOutputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | str +): + 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( + output_type: ( + cwl.OutputArraySchema + | cwl.OutputEnumSchema + | cwl.OutputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | None + | Sequence[ + cwl.OutputArraySchema + | cwl.OutputEnumSchema + | cwl.OutputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | str + ] + | str + ), +) -> ( + cwl.CommandOutputArraySchema + | cwl.CommandOutputEnumSchema + | cwl.CommandOutputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | None + | Sequence[ + cwl.CommandOutputArraySchema + | cwl.CommandOutputEnumSchema + | cwl.CommandOutputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | str + ] + | str +): + if isinstance(output_type, Sequence): + return [ + _plain_output_type_to_clt_output(output_type_item) + for output_type_item in output_type + ] + if output_type is None: + return None + return _plain_output_type_to_clt_output(output_type) + + +def parameters_to_plain_input_paramaters( + parameters: Sequence[ + cwl.InputParameter | cwl.CommandInputParameter | cwl.CommandOutputParameter + ], +) -> Sequence[cwl.InputParameter]: + return [ + cwl.InputParameter.fromDoc( + parameter.save(), parameter.loadingOptions.baseuri, parameter.loadingOptions + ) + for parameter in parameters + ] + + def etool_to_cltool( etool: cwl.ExpressionTool, expressionLib: list[str] | None = None ) -> cwl.CommandLineTool: @@ -152,7 +663,7 @@ def etool_to_cltool( doc=inp.doc, format=inp.format, default=inp.default, - type_=inp.type_, + type_=plain_input_type_to_clt_input(inp.type_), extension_fields=inp.extension_fields, loadingOptions=inp.loadingOptions, ) @@ -167,7 +678,7 @@ def etool_to_cltool( streamable=outp.streamable, doc=outp.doc, format=outp.format, - type_=outp.type_, + type_=plain_output_type_to_clt_output(outp.type_), extension_fields=outp.extension_fields, loadingOptions=outp.loadingOptions, ) @@ -338,16 +849,20 @@ def generate_etool_from_expr( if not no_inputs: if not self_type: 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_) + new_type: InputTypeSchemas + if isinstance(self_type, Sequence): + new_type_list: MutableSequence[BasicInputTypeSchemas] = [] + for entry in self_type: + clean_type = clean_type_ids(entry.type_) + if isinstance(clean_type, Sequence): + 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", @@ -383,8 +898,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_type_to_plain_output(target.type_), extension_fields=target.extension_fields, loadingOptions=target.loadingOptions, ) @@ -413,18 +928,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): + for inp in cast(list[cwl.InputParameter], 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 @@ -433,7 +954,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: """ @@ -485,14 +1010,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( @@ -530,19 +1057,22 @@ def empty_inputs( """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 @@ -619,33 +1149,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 @@ -690,7 +1209,7 @@ def process_workflow_reqs_and_hints( if expression: modified = True target = cwl.InputParameter( - id=None, + id="", type_="string", ) etool_id = ( @@ -711,7 +1230,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: @@ -720,7 +1241,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 ) @@ -745,7 +1266,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 ), @@ -766,18 +1287,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, @@ -787,17 +1308,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="", @@ -807,7 +1330,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( @@ -818,38 +1341,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, @@ -859,24 +1382,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, @@ -885,10 +1408,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: @@ -903,14 +1428,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: @@ -921,15 +1450,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: @@ -941,32 +1474,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, @@ -1002,7 +1542,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 ) @@ -1015,9 +1555,11 @@ def process_level_reqs( replace_etool, process, ) - target_process.requirements[req_index][ + new_requirements = list(target_process.requirements) + new_requirements[req_index][ env_index ].envValue = f"$(inputs._envDef{env_index})" + target_process.requirements = new_requirements generated_envVar_reqs.append((etool_id, env_index)) case cwl.ResourceRequirement(): for attr in cwl.ResourceRequirement.attrs: @@ -1026,7 +1568,7 @@ def process_level_reqs( expression = get_expression(this_attr, inputs, None) if expression: modified = True - target = cwl.InputParameter(id=None, type_="long") + target = cwl.InputParameter(id="", type_="long") etool_id = "_expression_{}_ResourceRequirement_{}".format( step_name, attr ) @@ -1055,7 +1597,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 ) @@ -1084,15 +1626,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 = ( @@ -1115,25 +1657,25 @@ def process_level_reqs( 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} ; @@ -1149,7 +1691,7 @@ 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( @@ -1172,14 +1714,14 @@ def process_level_reqs( 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( @@ -1256,7 +1798,7 @@ def traverse_CommandLineTool( inp_id = f"_arguments_{index}" etool_id = f"_expression_{step_id}{inp_id}" target_type = "Any" - target = cwl.InputParameter(id=None, type_=target_type) + target = cwl.InputParameter(id="", type_=target_type) replace_step_clt_expr_with_etool( expression, etool_id, parent, target, step, replace_etool ) @@ -1282,7 +1824,7 @@ def traverse_CommandLineTool( inp_id = f"_arguments_{index}" etool_id = f"_expression_{step_id}{inp_id}" target_type = "Any" - target = cwl.InputParameter(id=None, type_=target_type) + target = cwl.InputParameter(id="", type_=target_type) replace_step_clt_expr_with_etool( expression, etool_id, parent, target, step, replace_etool ) @@ -1308,7 +1850,7 @@ 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 ) @@ -1348,7 +1890,7 @@ def traverse_CommandLineTool( inp_id = "_{}_glob".format(outp.id.split("#")[-1]) etool_id = f"_expression_{step_id}{inp_id}" glob_target_type = ["string", cwl.ArraySchema("string", "array")] - target = cwl.InputParameter(id=None, type_=glob_target_type) + target = cwl.InputParameter(id="", type_=glob_target_type) replace_step_clt_expr_with_etool( expression, etool_id, parent, target, step, replace_etool ) @@ -1385,7 +1927,7 @@ def traverse_CommandLineTool( step, etool_id, outp_id ) self_type = cwl.InputParameter( - id=None, + id="", type_=cwl.InputArraySchema("File", "array", None, None), ) etool = generate_etool_from_expr( @@ -1658,7 +2200,7 @@ 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. @@ -1701,7 +2243,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, @@ -1715,8 +2263,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_type_to_plain_output(target.type_), ) ) expression = "${" @@ -1731,19 +2279,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)) @@ -1752,7 +2328,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, @@ -1774,43 +2350,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 isinstance(scattered_source_type, list): + 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 @@ -1826,31 +2388,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 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="", + type_=cwl.InputArraySchema(source_types, "array"), + ) # target.id = target.id.split('#')[-1] if isinstance(original_process, cwl.ExpressionTool): found_JSReq = False @@ -1866,9 +2420,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, @@ -1885,6 +2441,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, @@ -1910,7 +2467,7 @@ def traverse_step( def workflow_step_to_InputParameters( - step_ins: list[cwl.WorkflowStepInput], parent: cwl.Workflow, except_in_id: str + step_ins: Sequence[cwl.WorkflowStepInput], parent: cwl.Workflow, except_in_id: str ) -> list[cwl.InputParameter | cwl.CommandOutputParameter]: """Create InputParameters to match the given WorkflowStep inputs.""" params = [] @@ -1949,8 +2506,10 @@ 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: ( @@ -1990,7 +2549,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: @@ -1998,12 +2557,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)) @@ -2019,7 +2577,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, @@ -2029,6 +2588,7 @@ def replace_step_valueFrom_expr_with_etool( scatterMethod=step.scatterMethod, ) ) + workflow.steps = new_steps def traverse_workflow( @@ -2061,7 +2621,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/parser/cwl_v1_0_utils.py b/cwl_utils/parser/cwl_v1_0_utils.py index 309dc2cf..cedea06a 100644 --- a/cwl_utils/parser/cwl_v1_0_utils.py +++ b/cwl_utils/parser/cwl_v1_0_utils.py @@ -2,7 +2,7 @@ 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 IO, Any, cast @@ -415,8 +415,10 @@ def type_for_step_output( def type_for_source( - process: cwl.CommandLineTool | cwl.Workflow | cwl.ExpressionTool, - sourcenames: str | list[str], + process: ( + cwl.CommandLineTool | cwl.Workflow | cwl.ExpressionTool | cwl.ProcessGenerator + ), + sourcenames: str | Sequence[str], parent: cwl.Workflow | None = None, linkMerge: str | None = None, ) -> Any: @@ -466,8 +468,10 @@ def type_for_source( def param_for_source_id( - process: cwl.CommandLineTool | cwl.Workflow | cwl.ExpressionTool, - sourcenames: str | list[str], + process: ( + cwl.CommandLineTool | cwl.Workflow | cwl.ExpressionTool | cwl.ProcessGenerator + ), + sourcenames: str | Sequence[str], parent: cwl.Workflow | None = None, scatter_context: list[tuple[int, str] | None] | None = None, ) -> ( From 762dfda61d96158955bde465983c2fea8865df8c Mon Sep 17 00:00:00 2001 From: GlassOfWhiskey Date: Fri, 19 Dec 2025 22:22:15 +0100 Subject: [PATCH 03/22] Fix typing errors in utils --- cwl_utils/parser/cwl_v1_0_utils.py | 26 ++++-- cwl_utils/parser/cwl_v1_1_utils.py | 12 ++- cwl_utils/parser/cwl_v1_2_utils.py | 22 ++++-- cwl_utils/parser/utils.py | 122 +++++++++++++++++------------ cwl_utils/utils.py | 21 ++++- 5 files changed, 133 insertions(+), 70 deletions(-) diff --git a/cwl_utils/parser/cwl_v1_0_utils.py b/cwl_utils/parser/cwl_v1_0_utils.py index cedea06a..d9127536 100644 --- a/cwl_utils/parser/cwl_v1_0_utils.py +++ b/cwl_utils/parser/cwl_v1_0_utils.py @@ -5,7 +5,7 @@ from collections.abc import MutableMapping, MutableSequence, Sequence from io import StringIO from pathlib import Path -from typing import IO, Any, cast +from typing import Any, IO, cast from urllib.parse import urldefrag from schema_salad.exceptions import ValidationException @@ -181,7 +181,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.""" @@ -197,7 +197,7 @@ def check_all_types( case _: continue if sourceField is not None: - if isinstance(sourceField, MutableSequence): + if isinstance(sourceField, Sequence): linkMerge = sink.linkMerge or ( "merge_nested" if len(sourceField) > 1 else None ) @@ -475,14 +475,26 @@ def param_for_source_id( parent: cwl.Workflow | None = None, scatter_context: list[tuple[int, str] | None] | None = None, ) -> ( - cwl.InputParameter - | cwl.CommandOutputParameter - | MutableSequence[cwl.InputParameter | cwl.CommandOutputParameter] + cwl.CommandOutputParameter + | cwl.ExpressionToolOutputParameter + | cwl.InputParameter + | cwl.WorkflowOutputParameter + | MutableSequence[ + cwl.CommandOutputParameter + | cwl.ExpressionToolOutputParameter + | cwl.InputParameter + | cwl.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.CommandOutputParameter + | cwl.ExpressionToolOutputParameter + | cwl.InputParameter + | cwl.WorkflowOutputParameter + ] = [] for sourcename in sourcenames: if not isinstance(process, cwl.Workflow): for param in process.inputs: diff --git a/cwl_utils/parser/cwl_v1_1_utils.py b/cwl_utils/parser/cwl_v1_1_utils.py index e85313f2..af2ad7b8 100644 --- a/cwl_utils/parser/cwl_v1_1_utils.py +++ b/cwl_utils/parser/cwl_v1_1_utils.py @@ -2,7 +2,7 @@ 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 IO, Any, cast @@ -181,7 +181,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.""" @@ -197,7 +197,7 @@ def check_all_types( case _: continue if sourceField is not None: - if isinstance(sourceField, MutableSequence): + if isinstance(sourceField, Sequence): linkMerge = sink.linkMerge or ( "merge_nested" if len(sourceField) > 1 else None ) @@ -489,11 +489,15 @@ def param_for_source_id( ) -> ( cwl.CommandInputParameter | cwl.CommandOutputParameter + | cwl.ExpressionToolOutputParameter | cwl.WorkflowInputParameter + | cwl.WorkflowOutputParameter | MutableSequence[ cwl.CommandInputParameter | cwl.CommandOutputParameter + | cwl.ExpressionToolOutputParameter | cwl.WorkflowInputParameter + | cwl.WorkflowOutputParameter ] ): """Find the process input parameter that matches one of the given sourcenames.""" @@ -502,7 +506,9 @@ def param_for_source_id( params: MutableSequence[ cwl.CommandInputParameter | cwl.CommandOutputParameter + | cwl.ExpressionToolOutputParameter | cwl.WorkflowInputParameter + | cwl.WorkflowOutputParameter ] = [] for sourcename in sourcenames: if not isinstance(process, cwl.Workflow): diff --git a/cwl_utils/parser/cwl_v1_2_utils.py b/cwl_utils/parser/cwl_v1_2_utils.py index ad20f86a..6eb28cc8 100644 --- a/cwl_utils/parser/cwl_v1_2_utils.py +++ b/cwl_utils/parser/cwl_v1_2_utils.py @@ -2,7 +2,7 @@ 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 IO, Any, cast @@ -83,7 +83,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 +93,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 +200,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.""" @@ -221,7 +221,7 @@ def check_all_types( case _: continue if sourceField is not None: - if isinstance(sourceField, MutableSequence) and len(sourceField) > 1: + if isinstance(sourceField, Sequence) and len (sourceField) > 1: linkMerge: str | None = sink.linkMerge or ( "merge_nested" if len(sourceField) > 1 else None ) @@ -595,11 +595,19 @@ def param_for_source_id( ) -> ( cwl.CommandInputParameter | cwl.CommandOutputParameter + | cwl.ExpressionToolOutputParameter + | cwl.OperationInputParameter + | cwl.OperationOutputParameter | cwl.WorkflowInputParameter + | cwl.WorkflowOutputParameter | MutableSequence[ cwl.CommandInputParameter | cwl.CommandOutputParameter + | cwl.ExpressionToolOutputParameter + | cwl.OperationInputParameter + | cwl.OperationOutputParameter | cwl.WorkflowInputParameter + | cwl.WorkflowOutputParameter ] ): """Find the process input parameter that matches one of the given sourcenames.""" @@ -608,7 +616,9 @@ def param_for_source_id( params: MutableSequence[ cwl.CommandInputParameter | cwl.CommandOutputParameter + | cwl.ExpressionToolOutputParameter | cwl.WorkflowInputParameter + | cwl.WorkflowOutputParameter ] = [] for sourcename in sourcenames: if not isinstance(process, cwl.Workflow): diff --git a/cwl_utils/parser/utils.py b/cwl_utils/parser/utils.py index cfbdc95d..d47c8a68 100644 --- a/cwl_utils/parser/utils.py +++ b/cwl_utils/parser/utils.py @@ -2,20 +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 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 ( + CommandLineTool, + ExpressionTool, LoadingOptions, Process, Workflow, @@ -27,6 +26,7 @@ cwl_v1_1_utils, cwl_v1_2, cwl_v1_2_utils, + load_document_by_uri, ) _logger = logging.getLogger("cwl_utils") @@ -134,10 +134,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, @@ -148,12 +148,12 @@ 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_) @@ -209,26 +209,36 @@ 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 + src_dict, cast(cwl_v1_0.Workflow, workflow).outputs, type_dict ) 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 + src_dict, cast(cwl_v1_1.Workflow, workflow).outputs, type_dict ) 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}") @@ -416,74 +426,86 @@ def type_for_step_output(step: WorkflowStep, sourcename: str, cwlVersion: str) - 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_v1_0.CommandOutputParameter + | cwl_v1_0.ExpressionToolOutputParameter + | cwl_v1_0.InputParameter + | cwl_v1_0.WorkflowOutputParameter ] - | cwl_utils.parser.cwl_v1_0.InputParameter - | cwl_utils.parser.cwl_v1_0.CommandOutputParameter + | cwl_v1_0.CommandOutputParameter + | cwl_v1_0.ExpressionToolOutputParameter + | cwl_v1_0.InputParameter + | cwl_v1_0.WorkflowOutputParameter ) | ( MutableSequence[ - cwl_utils.parser.cwl_v1_1.CommandInputParameter - | cwl_utils.parser.cwl_v1_1.CommandOutputParameter - | cwl_utils.parser.cwl_v1_1.WorkflowInputParameter + cwl_v1_1.CommandInputParameter + | cwl_v1_1.CommandOutputParameter + | cwl_v1_1.ExpressionToolOutputParameter + | cwl_v1_1.WorkflowInputParameter + | cwl_v1_1.WorkflowOutputParameter ] - | cwl_utils.parser.cwl_v1_1.CommandInputParameter - | cwl_utils.parser.cwl_v1_1.CommandOutputParameter - | cwl_utils.parser.cwl_v1_1.WorkflowInputParameter + | cwl_v1_1.CommandInputParameter + | cwl_v1_1.CommandOutputParameter + | cwl_v1_1.ExpressionToolOutputParameter + | cwl_v1_1.WorkflowInputParameter + | cwl_v1_1.WorkflowOutputParameter ) | ( MutableSequence[ - cwl_utils.parser.cwl_v1_2.CommandInputParameter - | cwl_utils.parser.cwl_v1_2.CommandOutputParameter - | cwl_utils.parser.cwl_v1_2.WorkflowInputParameter + cwl_v1_2.CommandInputParameter + | cwl_v1_2.CommandOutputParameter + | cwl_v1_2.ExpressionToolOutputParameter + | cwl_v1_2.OperationInputParameter + | cwl_v1_2.OperationOutputParameter + | cwl_v1_2.WorkflowInputParameter + | cwl_v1_2.WorkflowOutputParameter ] - | cwl_utils.parser.cwl_v1_2.CommandInputParameter - | cwl_utils.parser.cwl_v1_2.CommandOutputParameter - | cwl_utils.parser.cwl_v1_2.WorkflowInputParameter + | cwl_v1_2.CommandInputParameter + | cwl_v1_2.CommandOutputParameter + | cwl_v1_2.ExpressionToolOutputParameter + | cwl_v1_2.OperationInputParameter + | cwl_v1_2.OperationOutputParameter + | cwl_v1_2.WorkflowInputParameter + | cwl_v1_2.WorkflowOutputParameter ) ): match process.cwlVersion: case "v1.0": - return cwl_utils.parser.cwl_v1_0_utils.param_for_source_id( + return 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, + cwl_v1_0.CommandLineTool + | cwl_v1_0.Workflow + | cwl_v1_0.ExpressionTool, 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( + return 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, + cwl_v1_1.CommandLineTool + | cwl_v1_1.Workflow + | cwl_v1_1.ExpressionTool, 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( + 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/utils.py b/cwl_utils/utils.py index 0db35819..acc876b7 100644 --- a/cwl_utils/utils.py +++ b/cwl_utils/utils.py @@ -7,11 +7,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 @@ -381,11 +381,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 From 6feb025fe9a6e6db947025c9dafcf65b790477f7 Mon Sep 17 00:00:00 2001 From: GlassOfWhiskey Date: Fri, 19 Dec 2025 22:55:37 +0100 Subject: [PATCH 04/22] Regenerate parsers with native ints --- cwl_utils/parser/cwl_v1_0.py | 120 ++++++++++++------------ cwl_utils/parser/cwl_v1_0_utils.py | 18 ++-- cwl_utils/parser/cwl_v1_1.py | 138 ++++++++++++++-------------- cwl_utils/parser/cwl_v1_1_utils.py | 18 ++-- cwl_utils/parser/cwl_v1_2.py | 142 +++++++++++++++-------------- cwl_utils/parser/cwl_v1_2_utils.py | 38 ++++++-- 6 files changed, 253 insertions(+), 221 deletions(-) diff --git a/cwl_utils/parser/cwl_v1_0.py b/cwl_utils/parser/cwl_v1_0.py index 4aedf527..165e94df 100644 --- a/cwl_utils/parser/cwl_v1_0.py +++ b/cwl_utils/parser/cwl_v1_0.py @@ -18,7 +18,7 @@ from collections.abc import Collection # pylint: disable=unused-import # noqa: F401 from io import StringIO from itertools import chain -from mypy_extensions import trait +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 @@ -265,7 +265,7 @@ def load_field( save_type: TypeAlias = ( - None | MutableMapping[str, Any] | MutableSequence[Any] | int | float | bool | str + None | MutableMapping[str, Any] | MutableSequence[Any] | i32 | i64 | float | bool | str ) @@ -343,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)) @@ -1187,7 +1187,7 @@ def parser_info() -> str: @trait -class Documented(Saveable): +class Documented(Saveable, metaclass=ABCMeta): pass @@ -3974,7 +3974,7 @@ def __init__( nameroot: None | str = None, nameext: None | str = None, checksum: None | str = None, - size: None | int = None, + size: None | i32 = None, secondaryFiles: None | Sequence[Directory | File] = None, format: None | str = None, contents: None | str = None, @@ -3989,7 +3989,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#File" + self.class_: Final[str] = "File" self.location = location self.path = path self.basename = basename @@ -4395,7 +4395,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#Directory" + self.class_: Final[str] = "Directory" self.location = location self.path = path self.basename = basename @@ -4407,12 +4407,12 @@ def __init__( @trait -class SchemaBase(Saveable): +class SchemaBase(Saveable, metaclass=ABCMeta): pass @trait -class Parameter(SchemaBase): +class Parameter(SchemaBase, metaclass=ABCMeta): """ Define an input or output parameter to a process. @@ -4422,22 +4422,22 @@ class Parameter(SchemaBase): @trait -class InputBinding(Saveable): +class InputBinding(Saveable, metaclass=ABCMeta): pass @trait -class OutputBinding(Saveable): +class OutputBinding(Saveable, metaclass=ABCMeta): pass @trait -class InputSchema(SchemaBase): +class InputSchema(SchemaBase, metaclass=ABCMeta): pass @trait -class OutputSchema(SchemaBase): +class OutputSchema(SchemaBase, metaclass=ABCMeta): pass @@ -8281,7 +8281,7 @@ def __init__( @trait -class ProcessRequirement(Saveable): +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 @@ -8296,7 +8296,7 @@ class ProcessRequirement(Saveable): @trait -class Process(Saveable): +class Process(Saveable, metaclass=ABCMeta): """ The base executable type in CWL is the `Process` object defined by the @@ -8484,7 +8484,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#InlineJavascriptRequirement" + self.class_: Final[str] = "InlineJavascriptRequirement" self.expressionLib = expressionLib attrs: ClassVar[Collection[str]] = frozenset(["class", "expressionLib"]) @@ -8665,7 +8665,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#SchemaDefRequirement" + self.class_: Final[str] = "SchemaDefRequirement" self.types = types attrs: ClassVar[Collection[str]] = frozenset(["class", "types"]) @@ -9389,7 +9389,7 @@ def save( def __init__( self, loadContents: None | bool = None, - position: None | int = None, + position: None | i32 = None, prefix: None | str = None, separate: None | bool = None, itemSeparator: None | str = None, @@ -14687,9 +14687,9 @@ def __init__( stdin: None | str = None, stderr: None | str = None, stdout: None | str = None, - successCodes: None | Sequence[int] = None, - temporaryFailCodes: None | Sequence[int] = None, - permanentFailCodes: None | Sequence[int] = 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: @@ -14709,7 +14709,7 @@ def __init__( self.label = label self.doc = doc self.cwlVersion = cwlVersion - self.class_: Final[str] = "https://w3id.org/cwl/cwl#CommandLineTool" + self.class_: Final[str] = "CommandLineTool" self.baseCommand = baseCommand self.arguments = arguments self.stdin = stdin @@ -15243,7 +15243,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#DockerRequirement" + self.class_: Final[str] = "DockerRequirement" self.dockerPull = dockerPull self.dockerLoad = dockerLoad self.dockerFile = dockerFile @@ -15434,7 +15434,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#SoftwareRequirement" + self.class_: Final[str] = "SoftwareRequirement" self.packages = packages attrs: ClassVar[Collection[str]] = frozenset(["class", "packages"]) @@ -16132,7 +16132,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#InitialWorkDirRequirement" + self.class_: Final[str] = "InitialWorkDirRequirement" self.listing = listing attrs: ClassVar[Collection[str]] = frozenset(["class", "listing"]) @@ -16308,7 +16308,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#EnvVarRequirement" + self.class_: Final[str] = "EnvVarRequirement" self.envDef = envDef attrs: ClassVar[Collection[str]] = frozenset(["class", "envDef"]) @@ -16433,7 +16433,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#ShellCommandRequirement" + self.class_: Final[str] = "ShellCommandRequirement" attrs: ClassVar[Collection[str]] = frozenset(["class"]) @@ -17011,14 +17011,14 @@ def save( def __init__( self, - coresMin: None | int | str = None, - coresMax: None | int | str = None, - ramMin: None | int | str = None, - ramMax: None | int | str = None, - tmpdirMin: None | int | str = None, - tmpdirMax: None | int | str = None, - outdirMin: None | int | str = None, - outdirMax: None | int | str = None, + 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: @@ -17030,7 +17030,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#ResourceRequirement" + self.class_: Final[str] = "ResourceRequirement" self.coresMin = coresMin self.coresMax = coresMax self.ramMin = ramMin @@ -18270,7 +18270,7 @@ def __init__( self.label = label self.doc = doc self.cwlVersion = cwlVersion - self.class_: Final[str] = "https://w3id.org/cwl/cwl#ExpressionTool" + self.class_: Final[str] = "ExpressionTool" self.expression = expression attrs: ClassVar[Collection[str]] = frozenset( @@ -18982,7 +18982,7 @@ def __init__( @trait -class Sink(Saveable): +class Sink(Saveable, metaclass=ABCMeta): pass @@ -20995,7 +20995,7 @@ def __init__( self.label = label self.doc = doc self.cwlVersion = cwlVersion - self.class_: Final[str] = "https://w3id.org/cwl/cwl#Workflow" + self.class_: Final[str] = "Workflow" self.steps = steps attrs: ClassVar[Collection[str]] = frozenset( @@ -21128,7 +21128,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#SubworkflowFeatureRequirement" + self.class_: Final[str] = "SubworkflowFeatureRequirement" attrs: ClassVar[Collection[str]] = frozenset(["class"]) @@ -21247,7 +21247,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#ScatterFeatureRequirement" + self.class_: Final[str] = "ScatterFeatureRequirement" attrs: ClassVar[Collection[str]] = frozenset(["class"]) @@ -21366,7 +21366,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#MultipleInputFeatureRequirement" + self.class_: Final[str] = "MultipleInputFeatureRequirement" attrs: ClassVar[Collection[str]] = frozenset(["class"]) @@ -21485,7 +21485,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#StepInputExpressionRequirement" + self.class_: Final[str] = "StepInputExpressionRequirement" attrs: ClassVar[Collection[str]] = frozenset(["class"]) @@ -21659,7 +21659,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "http://commonwl.org/cwltool#LoadListingRequirement" + self.class_: Final[str] = "LoadListingRequirement" self.loadListing = loadListing attrs: ClassVar[Collection[str]] = frozenset(["class", "loadListing"]) @@ -21835,7 +21835,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "http://commonwl.org/cwltool#InplaceUpdateRequirement" + self.class_: Final[str] = "InplaceUpdateRequirement" self.inplaceUpdate = inplaceUpdate attrs: ClassVar[Collection[str]] = frozenset(["class", "inplaceUpdate"]) @@ -22004,7 +22004,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "http://commonwl.org/cwltool#Secrets" + self.class_: Final[str] = "Secrets" self.secrets = secrets attrs: ClassVar[Collection[str]] = frozenset(["class", "secrets"]) @@ -22175,7 +22175,7 @@ def save( def __init__( self, - timelimit: int | str, + timelimit: i32 | str, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -22187,7 +22187,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "http://commonwl.org/cwltool#TimeLimit" + self.class_: Final[str] = "TimeLimit" self.timelimit = timelimit attrs: ClassVar[Collection[str]] = frozenset(["class", "timelimit"]) @@ -22375,7 +22375,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "http://commonwl.org/cwltool#WorkReuse" + self.class_: Final[str] = "WorkReuse" self.enableReuse = enableReuse attrs: ClassVar[Collection[str]] = frozenset(["class", "enableReuse"]) @@ -22570,7 +22570,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "http://commonwl.org/cwltool#NetworkAccess" + self.class_: Final[str] = "NetworkAccess" self.networkAccess = networkAccess attrs: ClassVar[Collection[str]] = frozenset(["class", "networkAccess"]) @@ -23210,7 +23210,7 @@ def __init__( self.label = label self.doc = doc self.cwlVersion = cwlVersion - self.class_: Final[str] = "http://commonwl.org/cwltool#ProcessGenerator" + self.class_: Final[str] = "ProcessGenerator" self.run = run attrs: ClassVar[Collection[str]] = frozenset( @@ -23391,7 +23391,7 @@ def save( def __init__( self, - processes: int | str, + processes: i32 | str, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -23403,7 +23403,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "http://commonwl.org/cwltool#MPIRequirement" + self.class_: Final[str] = "MPIRequirement" self.processes = processes attrs: ClassVar[Collection[str]] = frozenset(["class", "processes"]) @@ -23751,8 +23751,8 @@ def __init__( self, cudaComputeCapability: Sequence[str] | str, cudaVersionMin: str, - cudaDeviceCountMax: None | int | str = None, - cudaDeviceCountMin: None | int | str = None, + cudaDeviceCountMax: None | i32 | str = None, + cudaDeviceCountMin: None | i32 | str = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -23764,7 +23764,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "http://commonwl.org/cwltool#CUDARequirement" + self.class_: Final[str] = "CUDARequirement" self.cudaComputeCapability = cudaComputeCapability self.cudaDeviceCountMax = cudaDeviceCountMax self.cudaDeviceCountMin = cudaDeviceCountMin @@ -23945,7 +23945,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "http://commonwl.org/cwltool#ShmSize" + self.class_: Final[str] = "ShmSize" self.shmSize = shmSize attrs: ClassVar[Collection[str]] = frozenset(["class", "shmSize"]) @@ -24197,11 +24197,12 @@ def __init__( }) strtype: Final = _PrimitiveLoader(str) -inttype: Final = _PrimitiveLoader(int) +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", @@ -25549,6 +25550,7 @@ def __init__( ( booltype, inttype, + longtype, floattype, strtype, FileLoader, @@ -25558,7 +25560,7 @@ def __init__( ) ) CWLObjectType: TypeAlias = ( - "Directory | File | Mapping[str, CWLObjectType | None] | Sequence[CWLObjectType | None] | bool | float | int | str" + "Directory | File | Mapping[str, CWLObjectType | None] | Sequence[CWLObjectType | None] | bool | float | i32 | i64 | str" ) diff --git a/cwl_utils/parser/cwl_v1_0_utils.py b/cwl_utils/parser/cwl_v1_0_utils.py index d9127536..974abcab 100644 --- a/cwl_utils/parser/cwl_v1_0_utils.py +++ b/cwl_utils/parser/cwl_v1_0_utils.py @@ -195,16 +195,9 @@ 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, Sequence): - 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: + if isinstance(sourceField, str): parm_id = sourceField if parm_id not in src_dict: raise SourceLine(sink, sourceName, ValidationException).makeError( @@ -212,6 +205,13 @@ def check_all_types( ) 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)], diff --git a/cwl_utils/parser/cwl_v1_1.py b/cwl_utils/parser/cwl_v1_1.py index d03c8932..7397d3a5 100644 --- a/cwl_utils/parser/cwl_v1_1.py +++ b/cwl_utils/parser/cwl_v1_1.py @@ -18,7 +18,7 @@ from collections.abc import Collection # pylint: disable=unused-import # noqa: F401 from io import StringIO from itertools import chain -from mypy_extensions import trait +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 @@ -265,7 +265,7 @@ def load_field( save_type: TypeAlias = ( - None | MutableMapping[str, Any] | MutableSequence[Any] | int | float | bool | str + None | MutableMapping[str, Any] | MutableSequence[Any] | i32 | i64 | float | bool | str ) @@ -343,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)) @@ -1187,7 +1187,7 @@ def parser_info() -> str: @trait -class Documented(Saveable): +class Documented(Saveable, metaclass=ABCMeta): pass @@ -3974,7 +3974,7 @@ def __init__( nameroot: None | str = None, nameext: None | str = None, checksum: None | str = None, - size: None | int = None, + size: None | i32 = None, secondaryFiles: None | Sequence[Directory | File] = None, format: None | str = None, contents: None | str = None, @@ -3989,7 +3989,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#File" + self.class_: Final[str] = "File" self.location = location self.path = path self.basename = basename @@ -4395,7 +4395,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#Directory" + self.class_: Final[str] = "Directory" self.location = location self.path = path self.basename = basename @@ -4407,42 +4407,42 @@ def __init__( @trait -class Labeled(Saveable): +class Labeled(Saveable, metaclass=ABCMeta): pass @trait -class Identified(Saveable): +class Identified(Saveable, metaclass=ABCMeta): pass @trait -class IdentifierRequired(Identified): +class IdentifierRequired(Identified, metaclass=ABCMeta): pass @trait -class LoadContents(Saveable): +class LoadContents(Saveable, metaclass=ABCMeta): pass @trait -class FieldBase(Labeled): +class FieldBase(Labeled, metaclass=ABCMeta): pass @trait -class InputFormat(Saveable): +class InputFormat(Saveable, metaclass=ABCMeta): pass @trait -class OutputFormat(Saveable): +class OutputFormat(Saveable, metaclass=ABCMeta): pass @trait -class Parameter(FieldBase, Documented, IdentifierRequired): +class Parameter(FieldBase, Documented, IdentifierRequired, metaclass=ABCMeta): """ Define an input or output parameter to a process. @@ -4599,17 +4599,17 @@ def __init__( @trait -class IOSchema(Labeled, Documented): +class IOSchema(Labeled, Documented, metaclass=ABCMeta): pass @trait -class InputSchema(IOSchema): +class InputSchema(IOSchema, metaclass=ABCMeta): pass @trait -class OutputSchema(IOSchema): +class OutputSchema(IOSchema, metaclass=ABCMeta): pass @@ -8032,17 +8032,17 @@ def __init__( @trait -class InputParameter(Parameter, InputFormat, LoadContents): +class InputParameter(Parameter, InputFormat, LoadContents, metaclass=ABCMeta): pass @trait -class OutputParameter(Parameter, OutputFormat): +class OutputParameter(Parameter, OutputFormat, metaclass=ABCMeta): pass @trait -class ProcessRequirement(Saveable): +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 @@ -8057,7 +8057,7 @@ class ProcessRequirement(Saveable): @trait -class Process(Identified, Labeled, Documented): +class Process(Identified, Labeled, Documented, metaclass=ABCMeta): """ The base executable type in CWL is the `Process` object defined by the @@ -8245,14 +8245,14 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#InlineJavascriptRequirement" + self.class_: Final[str] = "InlineJavascriptRequirement" self.expressionLib = expressionLib attrs: ClassVar[Collection[str]] = frozenset(["class", "expressionLib"]) @trait -class CommandInputSchema(Saveable): +class CommandInputSchema(Saveable, metaclass=ABCMeta): pass @@ -8431,7 +8431,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#SchemaDefRequirement" + self.class_: Final[str] = "SchemaDefRequirement" self.types = types attrs: ClassVar[Collection[str]] = frozenset(["class", "types"]) @@ -8812,7 +8812,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#LoadListingRequirement" + self.class_: Final[str] = "LoadListingRequirement" self.loadListing = loadListing attrs: ClassVar[Collection[str]] = frozenset(["class", "loadListing"]) @@ -9536,7 +9536,7 @@ def save( def __init__( self, loadContents: None | bool = None, - position: None | int | str = None, + position: None | i32 | str = None, prefix: None | str = None, separate: None | bool = None, itemSeparator: None | str = None, @@ -9911,7 +9911,7 @@ def __init__( @trait -class CommandLineBindable(Saveable): +class CommandLineBindable(Saveable, metaclass=ABCMeta): pass @@ -16004,9 +16004,9 @@ def __init__( stdin: None | str = None, stderr: None | str = None, stdout: None | str = None, - successCodes: None | Sequence[int] = None, - temporaryFailCodes: None | Sequence[int] = None, - permanentFailCodes: None | Sequence[int] = 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: @@ -16026,7 +16026,7 @@ def __init__( self.requirements = requirements self.hints = hints self.cwlVersion = cwlVersion - self.class_: Final[str] = "https://w3id.org/cwl/cwl#CommandLineTool" + self.class_: Final[str] = "CommandLineTool" self.baseCommand = baseCommand self.arguments = arguments self.stdin = stdin @@ -16578,7 +16578,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#DockerRequirement" + self.class_: Final[str] = "DockerRequirement" self.dockerPull = dockerPull self.dockerLoad = dockerLoad self.dockerFile = dockerFile @@ -16769,7 +16769,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#SoftwareRequirement" + self.class_: Final[str] = "SoftwareRequirement" self.packages = packages attrs: ClassVar[Collection[str]] = frozenset(["class", "packages"]) @@ -17467,7 +17467,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#InitialWorkDirRequirement" + self.class_: Final[str] = "InitialWorkDirRequirement" self.listing = listing attrs: ClassVar[Collection[str]] = frozenset(["class", "listing"]) @@ -17643,7 +17643,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#EnvVarRequirement" + self.class_: Final[str] = "EnvVarRequirement" self.envDef = envDef attrs: ClassVar[Collection[str]] = frozenset(["class", "envDef"]) @@ -17768,7 +17768,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#ShellCommandRequirement" + self.class_: Final[str] = "ShellCommandRequirement" attrs: ClassVar[Collection[str]] = frozenset(["class"]) @@ -18346,14 +18346,14 @@ def save( def __init__( self, - coresMin: None | int | str = None, - coresMax: None | int | str = None, - ramMin: None | int | str = None, - ramMax: None | int | str = None, - tmpdirMin: None | int | str = None, - tmpdirMax: None | int | str = None, - outdirMin: None | int | str = None, - outdirMax: None | int | str = None, + 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: @@ -18365,7 +18365,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#ResourceRequirement" + self.class_: Final[str] = "ResourceRequirement" self.coresMin = coresMin self.coresMax = coresMax self.ramMin = ramMin @@ -18572,7 +18572,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#WorkReuse" + self.class_: Final[str] = "WorkReuse" self.enableReuse = enableReuse attrs: ClassVar[Collection[str]] = frozenset(["class", "enableReuse"]) @@ -18767,7 +18767,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#NetworkAccess" + self.class_: Final[str] = "NetworkAccess" self.networkAccess = networkAccess attrs: ClassVar[Collection[str]] = frozenset(["class", "networkAccess"]) @@ -18977,7 +18977,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#InplaceUpdateRequirement" + self.class_: Final[str] = "InplaceUpdateRequirement" self.inplaceUpdate = inplaceUpdate attrs: ClassVar[Collection[str]] = frozenset(["class", "inplaceUpdate"]) @@ -19151,7 +19151,7 @@ def save( def __init__( self, - timelimit: int | str, + timelimit: i32 | str, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -19163,7 +19163,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#ToolTimeLimit" + self.class_: Final[str] = "ToolTimeLimit" self.timelimit = timelimit attrs: ClassVar[Collection[str]] = frozenset(["class", "timelimit"]) @@ -21073,7 +21073,7 @@ def __init__( self.requirements = requirements self.hints = hints self.cwlVersion = cwlVersion - self.class_: Final[str] = "https://w3id.org/cwl/cwl#ExpressionTool" + self.class_: Final[str] = "ExpressionTool" self.expression = expression attrs: ClassVar[Collection[str]] = frozenset( @@ -21727,7 +21727,7 @@ def __init__( @trait -class Sink(Saveable): +class Sink(Saveable, metaclass=ABCMeta): pass @@ -23939,7 +23939,7 @@ def __init__( self.requirements = requirements self.hints = hints self.cwlVersion = cwlVersion - self.class_: Final[str] = "https://w3id.org/cwl/cwl#Workflow" + self.class_: Final[str] = "Workflow" self.steps = steps attrs: ClassVar[Collection[str]] = frozenset( @@ -24072,7 +24072,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#SubworkflowFeatureRequirement" + self.class_: Final[str] = "SubworkflowFeatureRequirement" attrs: ClassVar[Collection[str]] = frozenset(["class"]) @@ -24191,7 +24191,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#ScatterFeatureRequirement" + self.class_: Final[str] = "ScatterFeatureRequirement" attrs: ClassVar[Collection[str]] = frozenset(["class"]) @@ -24310,7 +24310,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#MultipleInputFeatureRequirement" + self.class_: Final[str] = "MultipleInputFeatureRequirement" attrs: ClassVar[Collection[str]] = frozenset(["class"]) @@ -24429,7 +24429,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#StepInputExpressionRequirement" + self.class_: Final[str] = "StepInputExpressionRequirement" attrs: ClassVar[Collection[str]] = frozenset(["class"]) @@ -24597,7 +24597,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "http://commonwl.org/cwltool#Secrets" + self.class_: Final[str] = "Secrets" self.secrets = secrets attrs: ClassVar[Collection[str]] = frozenset(["class", "secrets"]) @@ -25239,7 +25239,7 @@ def __init__( self.requirements = requirements self.hints = hints self.cwlVersion = cwlVersion - self.class_: Final[str] = "http://commonwl.org/cwltool#ProcessGenerator" + self.class_: Final[str] = "ProcessGenerator" self.run = run attrs: ClassVar[Collection[str]] = frozenset( @@ -25420,7 +25420,7 @@ def save( def __init__( self, - processes: int | str, + processes: i32 | str, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -25432,7 +25432,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "http://commonwl.org/cwltool#MPIRequirement" + self.class_: Final[str] = "MPIRequirement" self.processes = processes attrs: ClassVar[Collection[str]] = frozenset(["class", "processes"]) @@ -25780,8 +25780,8 @@ def __init__( self, cudaComputeCapability: Sequence[str] | str, cudaVersionMin: str, - cudaDeviceCountMax: None | int | str = None, - cudaDeviceCountMin: None | int | str = None, + cudaDeviceCountMax: None | i32 | str = None, + cudaDeviceCountMin: None | i32 | str = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -25793,7 +25793,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "http://commonwl.org/cwltool#CUDARequirement" + self.class_: Final[str] = "CUDARequirement" self.cudaComputeCapability = cudaComputeCapability self.cudaDeviceCountMax = cudaDeviceCountMax self.cudaDeviceCountMin = cudaDeviceCountMin @@ -25974,7 +25974,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "http://commonwl.org/cwltool#ShmSize" + self.class_: Final[str] = "ShmSize" self.shmSize = shmSize attrs: ClassVar[Collection[str]] = frozenset(["class", "shmSize"]) @@ -26254,11 +26254,12 @@ def __init__( }) strtype: Final = _PrimitiveLoader(str) -inttype: Final = _PrimitiveLoader(int) +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", @@ -27707,6 +27708,7 @@ def __init__( ( booltype, inttype, + longtype, floattype, strtype, FileLoader, @@ -27716,7 +27718,7 @@ def __init__( ) ) CWLObjectType: TypeAlias = ( - "Directory | File | Mapping[str, CWLObjectType | None] | Sequence[CWLObjectType | None] | bool | float | int | str" + "Directory | File | Mapping[str, CWLObjectType | None] | Sequence[CWLObjectType | None] | bool | float | i32 | i64 | str" ) diff --git a/cwl_utils/parser/cwl_v1_1_utils.py b/cwl_utils/parser/cwl_v1_1_utils.py index af2ad7b8..20117145 100644 --- a/cwl_utils/parser/cwl_v1_1_utils.py +++ b/cwl_utils/parser/cwl_v1_1_utils.py @@ -195,16 +195,9 @@ 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, Sequence): - 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: + if isinstance(sourceField, str): parm_id = sourceField if parm_id not in src_dict: raise SourceLine(sink, sourceName, ValidationException).makeError( @@ -212,6 +205,13 @@ def check_all_types( ) 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)], diff --git a/cwl_utils/parser/cwl_v1_2.py b/cwl_utils/parser/cwl_v1_2.py index 77a7c937..25d55219 100644 --- a/cwl_utils/parser/cwl_v1_2.py +++ b/cwl_utils/parser/cwl_v1_2.py @@ -18,7 +18,7 @@ from collections.abc import Collection # pylint: disable=unused-import # noqa: F401 from io import StringIO from itertools import chain -from mypy_extensions import trait +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 @@ -265,7 +265,7 @@ def load_field( save_type: TypeAlias = ( - None | MutableMapping[str, Any] | MutableSequence[Any] | int | float | bool | str + None | MutableMapping[str, Any] | MutableSequence[Any] | i32 | i64 | float | bool | str ) @@ -343,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)) @@ -1187,7 +1187,7 @@ def parser_info() -> str: @trait -class Documented(Saveable): +class Documented(Saveable, metaclass=ABCMeta): pass @@ -3974,7 +3974,7 @@ def __init__( nameroot: None | str = None, nameext: None | str = None, checksum: None | str = None, - size: None | int = None, + size: None | i32 = None, secondaryFiles: None | Sequence[Directory | File] = None, format: None | str = None, contents: None | str = None, @@ -3989,7 +3989,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#File" + self.class_: Final[str] = "File" self.location = location self.path = path self.basename = basename @@ -4395,7 +4395,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#Directory" + self.class_: Final[str] = "Directory" self.location = location self.path = path self.basename = basename @@ -4407,42 +4407,42 @@ def __init__( @trait -class Labeled(Saveable): +class Labeled(Saveable, metaclass=ABCMeta): pass @trait -class Identified(Saveable): +class Identified(Saveable, metaclass=ABCMeta): pass @trait -class IdentifierRequired(Identified): +class IdentifierRequired(Identified, metaclass=ABCMeta): pass @trait -class LoadContents(Saveable): +class LoadContents(Saveable, metaclass=ABCMeta): pass @trait -class FieldBase(Labeled): +class FieldBase(Labeled, metaclass=ABCMeta): pass @trait -class InputFormat(Saveable): +class InputFormat(Saveable, metaclass=ABCMeta): pass @trait -class OutputFormat(Saveable): +class OutputFormat(Saveable, metaclass=ABCMeta): pass @trait -class Parameter(FieldBase, Documented, IdentifierRequired): +class Parameter(FieldBase, Documented, IdentifierRequired, metaclass=ABCMeta): """ Define an input or output parameter to a process. @@ -4599,17 +4599,17 @@ def __init__( @trait -class IOSchema(Labeled, Documented): +class IOSchema(Labeled, Documented, metaclass=ABCMeta): pass @trait -class InputSchema(IOSchema): +class InputSchema(IOSchema, metaclass=ABCMeta): pass @trait -class OutputSchema(IOSchema): +class OutputSchema(IOSchema, metaclass=ABCMeta): pass @@ -8032,17 +8032,17 @@ def __init__( @trait -class InputParameter(Parameter, InputFormat, LoadContents): +class InputParameter(Parameter, InputFormat, LoadContents, metaclass=ABCMeta): pass @trait -class OutputParameter(Parameter, OutputFormat): +class OutputParameter(Parameter, OutputFormat, metaclass=ABCMeta): pass @trait -class ProcessRequirement(Saveable): +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 @@ -8057,7 +8057,7 @@ class ProcessRequirement(Saveable): @trait -class Process(Identified, Labeled, Documented): +class Process(Identified, Labeled, Documented, metaclass=ABCMeta): """ The base executable type in CWL is the `Process` object defined by the @@ -8245,14 +8245,14 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#InlineJavascriptRequirement" + self.class_: Final[str] = "InlineJavascriptRequirement" self.expressionLib = expressionLib attrs: ClassVar[Collection[str]] = frozenset(["class", "expressionLib"]) @trait -class CommandInputSchema(Saveable): +class CommandInputSchema(Saveable, metaclass=ABCMeta): pass @@ -8436,7 +8436,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#SchemaDefRequirement" + self.class_: Final[str] = "SchemaDefRequirement" self.types = types attrs: ClassVar[Collection[str]] = frozenset(["class", "types"]) @@ -8834,7 +8834,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#LoadListingRequirement" + self.class_: Final[str] = "LoadListingRequirement" self.loadListing = loadListing attrs: ClassVar[Collection[str]] = frozenset(["class", "loadListing"]) @@ -9558,7 +9558,7 @@ def save( def __init__( self, loadContents: None | bool = None, - position: None | int | str = None, + position: None | i32 | str = None, prefix: None | str = None, separate: None | bool = None, itemSeparator: None | str = None, @@ -9933,7 +9933,7 @@ def __init__( @trait -class CommandLineBindable(Saveable): +class CommandLineBindable(Saveable, metaclass=ABCMeta): pass @@ -16080,9 +16080,9 @@ def __init__( stdin: None | str = None, stderr: None | str = None, stdout: None | str = None, - successCodes: None | Sequence[int] = None, - temporaryFailCodes: None | Sequence[int] = None, - permanentFailCodes: None | Sequence[int] = 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: @@ -16103,7 +16103,7 @@ def __init__( self.hints = hints self.cwlVersion = cwlVersion self.intent = intent - self.class_: Final[str] = "https://w3id.org/cwl/cwl#CommandLineTool" + self.class_: Final[str] = "CommandLineTool" self.baseCommand = baseCommand self.arguments = arguments self.stdin = stdin @@ -16656,7 +16656,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#DockerRequirement" + self.class_: Final[str] = "DockerRequirement" self.dockerPull = dockerPull self.dockerLoad = dockerLoad self.dockerFile = dockerFile @@ -16847,7 +16847,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#SoftwareRequirement" + self.class_: Final[str] = "SoftwareRequirement" self.packages = packages attrs: ClassVar[Collection[str]] = frozenset(["class", "packages"]) @@ -17550,7 +17550,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#InitialWorkDirRequirement" + self.class_: Final[str] = "InitialWorkDirRequirement" self.listing = listing attrs: ClassVar[Collection[str]] = frozenset(["class", "listing"]) @@ -17726,7 +17726,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#EnvVarRequirement" + self.class_: Final[str] = "EnvVarRequirement" self.envDef = envDef attrs: ClassVar[Collection[str]] = frozenset(["class", "envDef"]) @@ -17851,7 +17851,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#ShellCommandRequirement" + self.class_: Final[str] = "ShellCommandRequirement" attrs: ClassVar[Collection[str]] = frozenset(["class"]) @@ -18434,14 +18434,14 @@ def save( def __init__( self, - coresMin: None | float | int | str = None, - coresMax: None | float | int | str = None, - ramMin: None | float | int | str = None, - ramMax: None | float | int | str = None, - tmpdirMin: None | float | int | str = None, - tmpdirMax: None | float | int | str = None, - outdirMin: None | float | int | str = None, - outdirMax: None | float | int | str = None, + 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: @@ -18453,7 +18453,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#ResourceRequirement" + self.class_: Final[str] = "ResourceRequirement" self.coresMin = coresMin self.coresMax = coresMax self.ramMin = ramMin @@ -18660,7 +18660,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#WorkReuse" + self.class_: Final[str] = "WorkReuse" self.enableReuse = enableReuse attrs: ClassVar[Collection[str]] = frozenset(["class", "enableReuse"]) @@ -18855,7 +18855,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#NetworkAccess" + self.class_: Final[str] = "NetworkAccess" self.networkAccess = networkAccess attrs: ClassVar[Collection[str]] = frozenset(["class", "networkAccess"]) @@ -19065,7 +19065,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#InplaceUpdateRequirement" + self.class_: Final[str] = "InplaceUpdateRequirement" self.inplaceUpdate = inplaceUpdate attrs: ClassVar[Collection[str]] = frozenset(["class", "inplaceUpdate"]) @@ -19239,7 +19239,7 @@ def save( def __init__( self, - timelimit: int | str, + timelimit: i32 | str, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -19251,7 +19251,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#ToolTimeLimit" + self.class_: Final[str] = "ToolTimeLimit" self.timelimit = timelimit attrs: ClassVar[Collection[str]] = frozenset(["class", "timelimit"]) @@ -21216,7 +21216,7 @@ def __init__( self.hints = hints self.cwlVersion = cwlVersion self.intent = intent - self.class_: Final[str] = "https://w3id.org/cwl/cwl#ExpressionTool" + self.class_: Final[str] = "ExpressionTool" self.expression = expression attrs: ClassVar[Collection[str]] = frozenset( @@ -21931,7 +21931,7 @@ def __init__( @trait -class Sink(Saveable): +class Sink(Saveable, metaclass=ABCMeta): pass @@ -24407,7 +24407,7 @@ def __init__( self.hints = hints self.cwlVersion = cwlVersion self.intent = intent - self.class_: Final[str] = "https://w3id.org/cwl/cwl#Workflow" + self.class_: Final[str] = "Workflow" self.steps = steps attrs: ClassVar[Collection[str]] = frozenset( @@ -24541,7 +24541,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#SubworkflowFeatureRequirement" + self.class_: Final[str] = "SubworkflowFeatureRequirement" attrs: ClassVar[Collection[str]] = frozenset(["class"]) @@ -24660,7 +24660,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#ScatterFeatureRequirement" + self.class_: Final[str] = "ScatterFeatureRequirement" attrs: ClassVar[Collection[str]] = frozenset(["class"]) @@ -24779,7 +24779,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#MultipleInputFeatureRequirement" + self.class_: Final[str] = "MultipleInputFeatureRequirement" attrs: ClassVar[Collection[str]] = frozenset(["class"]) @@ -24898,7 +24898,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "https://w3id.org/cwl/cwl#StepInputExpressionRequirement" + self.class_: Final[str] = "StepInputExpressionRequirement" attrs: ClassVar[Collection[str]] = frozenset(["class"]) @@ -26753,7 +26753,7 @@ def __init__( self.hints = hints self.cwlVersion = cwlVersion self.intent = intent - self.class_: Final[str] = "https://w3id.org/cwl/cwl#Operation" + self.class_: Final[str] = "Operation" attrs: ClassVar[Collection[str]] = frozenset( [ @@ -26934,7 +26934,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "http://commonwl.org/cwltool#Secrets" + self.class_: Final[str] = "Secrets" self.secrets = secrets attrs: ClassVar[Collection[str]] = frozenset(["class", "secrets"]) @@ -27631,7 +27631,7 @@ def __init__( self.hints = hints self.cwlVersion = cwlVersion self.intent = intent - self.class_: Final[str] = "http://commonwl.org/cwltool#ProcessGenerator" + self.class_: Final[str] = "ProcessGenerator" self.run = run attrs: ClassVar[Collection[str]] = frozenset( @@ -27813,7 +27813,7 @@ def save( def __init__( self, - processes: int | str, + processes: i32 | str, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -27825,7 +27825,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "http://commonwl.org/cwltool#MPIRequirement" + self.class_: Final[str] = "MPIRequirement" self.processes = processes attrs: ClassVar[Collection[str]] = frozenset(["class", "processes"]) @@ -28173,8 +28173,8 @@ def __init__( self, cudaComputeCapability: Sequence[str] | str, cudaVersionMin: str, - cudaDeviceCountMax: None | int | str = None, - cudaDeviceCountMin: None | int | str = None, + cudaDeviceCountMax: None | i32 | str = None, + cudaDeviceCountMin: None | i32 | str = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -28186,7 +28186,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "http://commonwl.org/cwltool#CUDARequirement" + self.class_: Final[str] = "CUDARequirement" self.cudaComputeCapability = cudaComputeCapability self.cudaDeviceCountMax = cudaDeviceCountMax self.cudaDeviceCountMin = cudaDeviceCountMin @@ -28941,7 +28941,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "http://commonwl.org/cwltool#Loop" + self.class_: Final[str] = "Loop" self.loop = loop self.loopWhen = loopWhen self.outputMethod = outputMethod @@ -29115,7 +29115,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.class_: Final[str] = "http://commonwl.org/cwltool#ShmSize" + self.class_: Final[str] = "ShmSize" self.shmSize = shmSize attrs: ClassVar[Collection[str]] = frozenset(["class", "shmSize"]) @@ -29429,11 +29429,12 @@ def __init__( }) strtype: Final = _PrimitiveLoader(str) -inttype: Final = _PrimitiveLoader(int) +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", @@ -30966,6 +30967,7 @@ def __init__( ( booltype, inttype, + longtype, floattype, strtype, FileLoader, @@ -30975,7 +30977,7 @@ def __init__( ) ) CWLObjectType: TypeAlias = ( - "Directory | File | Mapping[str, CWLObjectType | None] | Sequence[CWLObjectType | None] | bool | float | int | str" + "Directory | File | Mapping[str, CWLObjectType | None] | Sequence[CWLObjectType | None] | bool | float | i32 | i64 | str" ) diff --git a/cwl_utils/parser/cwl_v1_2_utils.py b/cwl_utils/parser/cwl_v1_2_utils.py index 6eb28cc8..551df2ba 100644 --- a/cwl_utils/parser/cwl_v1_2_utils.py +++ b/cwl_utils/parser/cwl_v1_2_utils.py @@ -219,7 +219,7 @@ 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, Sequence) and len (sourceField) > 1: linkMerge: str | None = sink.linkMerge or ( @@ -256,10 +256,10 @@ def check_all_types( items=src_typ, type_="array" ) else: - if isinstance(sourceField, MutableSequence): - parm_id = cast(str, sourceField[0]) + if isinstance(sourceField, Sequence): + parm_id = sourceField[0] else: - parm_id = cast(str, sourceField) + parm_id = sourceField if parm_id not in src_dict: raise SourceLine(sink, sourceName, ValidationException).makeError( f"{sourceName} not found: {parm_id}" @@ -281,8 +281,8 @@ def check_all_types( if "null" not in src_typ: src_typ = ["null"] + cast(list[Any], src_typ) if ( - not isinstance(snk_typ, MutableSequence) - or "null" not in snk_typ + not isinstance(snk_typ, MutableSequence) + or "null" not in snk_typ ): validation["warning"].append( SrcSink( @@ -298,6 +298,32 @@ def check_all_types( type_dict[src_dict[parm_id].id] = cwl.ArraySchema( items=src_typ, type_="array" ) + else: + 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" + ) for src in srcs_of_sink: check_result = check_types( type_dict[cast(str, src.id)], From bf0cebb1c5c469c143d5768df79e33ef890d87f3 Mon Sep 17 00:00:00 2001 From: "Michael R. Crusoe" Date: Sat, 20 Dec 2025 12:02:03 +0100 Subject: [PATCH 05/22] ProcessGenerator schema improvement --- cwl_utils/parser/cwl_v1_0.py | 4 ++-- cwl_utils/parser/cwl_v1_1.py | 8 ++++---- cwl_utils/parser/cwl_v1_2.py | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cwl_utils/parser/cwl_v1_0.py b/cwl_utils/parser/cwl_v1_0.py index 165e94df..406bcd7d 100644 --- a/cwl_utils/parser/cwl_v1_0.py +++ b/cwl_utils/parser/cwl_v1_0.py @@ -22751,7 +22751,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") @@ -23183,7 +23183,7 @@ def save( def __init__( self, inputs: Sequence[InputParameter], - outputs: Sequence[OutputParameter], + 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, diff --git a/cwl_utils/parser/cwl_v1_1.py b/cwl_utils/parser/cwl_v1_1.py index 7397d3a5..0f4004c0 100644 --- a/cwl_utils/parser/cwl_v1_1.py +++ b/cwl_utils/parser/cwl_v1_1.py @@ -24824,7 +24824,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") @@ -24872,7 +24872,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") @@ -25211,8 +25211,8 @@ def save( def __init__( self, - inputs: Sequence[CommandInputParameter | WorkflowInputParameter], - outputs: Sequence[CommandOutputParameter | ExpressionToolOutputParameter | WorkflowOutputParameter], + inputs: Sequence[WorkflowInputParameter], + outputs: Sequence[ExpressionToolOutputParameter], run: CommandLineTool | ExpressionTool | ProcessGenerator | Workflow | str, id: None | str = None, label: None | str = None, diff --git a/cwl_utils/parser/cwl_v1_2.py b/cwl_utils/parser/cwl_v1_2.py index 25d55219..167ed57b 100644 --- a/cwl_utils/parser/cwl_v1_2.py +++ b/cwl_utils/parser/cwl_v1_2.py @@ -27163,7 +27163,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") @@ -27211,7 +27211,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") @@ -27601,8 +27601,8 @@ def save( def __init__( self, - inputs: Sequence[CommandInputParameter | OperationInputParameter | WorkflowInputParameter], - outputs: Sequence[CommandOutputParameter | ExpressionToolOutputParameter | OperationOutputParameter | WorkflowOutputParameter], + inputs: Sequence[WorkflowInputParameter], + outputs: Sequence[ExpressionToolOutputParameter], run: CommandLineTool | ExpressionTool | Operation | ProcessGenerator | Workflow | str, id: None | str = None, label: None | str = None, From 20530907c880a460ca1cfa203b2fcc0e3c87e900 Mon Sep 17 00:00:00 2001 From: "Michael R. Crusoe" Date: Sat, 20 Dec 2025 11:38:47 +0100 Subject: [PATCH 06/22] finish type fixing cwl_v1_0_expression_refactor --- cwl_utils/cwl_v1_0_expression_refactor.py | 797 +++++++++------------- cwl_utils/parser/cwl_v1_0_utils.py | 2 +- cwl_utils/parser/cwl_v1_2_utils.py | 8 +- 3 files changed, 339 insertions(+), 468 deletions(-) diff --git a/cwl_utils/cwl_v1_0_expression_refactor.py b/cwl_utils/cwl_v1_0_expression_refactor.py index 03628bb7..2d84bc5d 100755 --- a/cwl_utils/cwl_v1_0_expression_refactor.py +++ b/cwl_utils/cwl_v1_0_expression_refactor.py @@ -76,6 +76,46 @@ def escape_expression_field(contents: str) -> str: InputTypeSchemas: TypeAlias = ( BasicInputTypeSchemas | Sequence[BasicInputTypeSchemas] | None ) +BasicCommandInputTypeSchemas: TypeAlias = ( + cwl.CommandInputArraySchema + | cwl.CommandInputEnumSchema + | cwl.CommandInputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] +) +CommandInputTypeSchemas: TypeAlias = ( + BasicCommandInputTypeSchemas | Sequence[BasicCommandInputTypeSchemas] | None +) +BasicOutputTypeSchemas: TypeAlias = ( + cwl.OutputArraySchema + | cwl.OutputEnumSchema + | cwl.OutputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] +) +OutputTypeSchemas: TypeAlias = ( + BasicOutputTypeSchemas | Sequence[BasicOutputTypeSchemas] | None +) BasicCommandOutputTypeSchemas: TypeAlias = ( cwl.CommandOutputArraySchema | cwl.CommandOutputEnumSchema @@ -215,41 +255,9 @@ def get_expression( return None -def _plain_input_type_to_clt_input( - input_type: ( - cwl.InputArraySchema - | cwl.InputEnumSchema - | cwl.InputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | str - ), -) -> ( - cwl.CommandInputArraySchema - | cwl.CommandInputEnumSchema - | cwl.CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | str -): +def _plain_input_schema_to_clt_input_schema( + input_type: BasicInputTypeSchemas, +) -> BasicCommandInputTypeSchemas: match input_type: case cwl.InputArraySchema(): return cwl.CommandInputArraySchema.fromDoc( @@ -274,122 +282,22 @@ def _plain_input_type_to_clt_input( raise WorkflowException(f"Unexpected ExpressionTool input type: {input_type}.") -def plain_input_type_to_clt_input( - input_type: ( - cwl.InputArraySchema - | cwl.InputEnumSchema - | cwl.InputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | None - | Sequence[ - cwl.InputArraySchema - | cwl.InputEnumSchema - | cwl.InputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | str - ] - | str - ), -) -> ( - cwl.CommandInputArraySchema - | cwl.CommandInputEnumSchema - | cwl.CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | None - | Sequence[ - cwl.CommandInputArraySchema - | cwl.CommandInputEnumSchema - | cwl.CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | str - ] - | str -): +def plain_input_schema_to_clt_input_schema( + input_type: InputTypeSchemas, +) -> CommandInputTypeSchemas: if isinstance(input_type, Sequence): return [ - _plain_input_type_to_clt_input(input_type_item) + _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_type_to_clt_input(input_type) - - -def _plain_input_type_to_plain_output( - input_type: ( - cwl.InputArraySchema - | cwl.InputEnumSchema - | cwl.InputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | str - ), -) -> ( - cwl.OutputArraySchema - | cwl.OutputEnumSchema - | cwl.OutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | str -): + 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( @@ -414,122 +322,22 @@ def _plain_input_type_to_plain_output( raise WorkflowException(f"Unexpected ExpressionTool input type: {input_type}.") -def plain_input_type_to_plain_output( - input_type: ( - cwl.InputArraySchema - | cwl.InputEnumSchema - | cwl.InputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | None - | Sequence[ - cwl.InputArraySchema - | cwl.InputEnumSchema - | cwl.InputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | str - ] - | str - ), -) -> ( - cwl.OutputArraySchema - | cwl.OutputEnumSchema - | cwl.OutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | None - | Sequence[ - cwl.OutputArraySchema - | cwl.OutputEnumSchema - | cwl.OutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | str - ] - | str -): +def plain_input_schema_to_plain_output_schema( + input_type: InputTypeSchemas, +) -> OutputTypeSchemas: if isinstance(input_type, Sequence): return [ - _plain_input_type_to_plain_output(input_type_item) + _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_type_to_plain_output(input_type) - - -def _plain_output_type_to_clt_output( - output_type: ( - cwl.OutputArraySchema - | cwl.OutputEnumSchema - | cwl.OutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | str - ), -) -> ( - cwl.CommandOutputArraySchema - | cwl.CommandOutputEnumSchema - | cwl.CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | str -): + 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( @@ -554,85 +362,31 @@ def _plain_output_type_to_clt_output( raise WorkflowException(f"Unexpected ExpressionTool output type: {output_type}.") -def plain_output_type_to_clt_output( - output_type: ( - cwl.OutputArraySchema - | cwl.OutputEnumSchema - | cwl.OutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | None - | Sequence[ - cwl.OutputArraySchema - | cwl.OutputEnumSchema - | cwl.OutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | str - ] - | str - ), -) -> ( - cwl.CommandOutputArraySchema - | cwl.CommandOutputEnumSchema - | cwl.CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | None - | Sequence[ - cwl.CommandOutputArraySchema - | cwl.CommandOutputEnumSchema - | cwl.CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | str - ] - | str -): +def plain_output_type_to_clt_output_type( + output_type: OutputTypeSchemas, +) -> CommandOutputTypeSchemas: if isinstance(output_type, Sequence): return [ - _plain_output_type_to_clt_output(output_type_item) + _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(output_type) + 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( @@ -640,12 +394,7 @@ def parameters_to_plain_input_paramaters( cwl.InputParameter | cwl.CommandInputParameter | cwl.CommandOutputParameter ], ) -> Sequence[cwl.InputParameter]: - return [ - cwl.InputParameter.fromDoc( - parameter.save(), parameter.loadingOptions.baseuri, parameter.loadingOptions - ) - for parameter in parameters - ] + return [parameter_to_plain_input_paramater(parameter) for parameter in parameters] def etool_to_cltool( @@ -663,7 +412,7 @@ def etool_to_cltool( doc=inp.doc, format=inp.format, default=inp.default, - type_=plain_input_type_to_clt_input(inp.type_), + type_=plain_input_schema_to_clt_input_schema(inp.type_), extension_fields=inp.extension_fields, loadingOptions=inp.loadingOptions, ) @@ -678,7 +427,7 @@ def etool_to_cltool( streamable=outp.streamable, doc=outp.doc, format=outp.format, - type_=plain_output_type_to_clt_output(outp.type_), + type_=plain_output_type_to_clt_output_type(outp.type_), extension_fields=outp.extension_fields, loadingOptions=outp.loadingOptions, ) @@ -841,14 +590,21 @@ 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 + assert self_type is not None new_type: InputTypeSchemas if isinstance(self_type, Sequence): new_type_list: MutableSequence[BasicInputTypeSchemas] = [] @@ -890,7 +646,7 @@ def generate_etool_from_expr( ), ) ) - outputs = yaml.comments.CommentedSeq() + outputs: list[cwl.ExpressionToolOutputParameter] = [] outputs.append( cwl.ExpressionToolOutputParameter( id="result", @@ -899,7 +655,7 @@ def generate_etool_from_expr( streamable=target.streamable, doc=target.doc, format=target.format[0] if target.format else None, - type_=plain_input_type_to_plain_output(target.type_), + type_=plain_input_schema_to_plain_output_schema(target.type_), extension_fields=target.extension_fields, loadingOptions=target.loadingOptions, ) @@ -983,23 +739,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( @@ -1050,7 +818,11 @@ 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]: @@ -1526,6 +1298,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]] = [] @@ -1535,6 +1308,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): @@ -1555,11 +1329,12 @@ def process_level_reqs( replace_etool, process, ) - new_requirements = list(target_process.requirements) - new_requirements[req_index][ + cast( + cwl.EnvVarRequirement, + target_process.requirements[req_index], + ).envDef[ env_index ].envValue = f"$(inputs._envDef{env_index})" - target_process.requirements = new_requirements generated_envVar_reqs.append((etool_id, env_index)) case cwl.ResourceRequirement(): for attr in cwl.ResourceRequirement.attrs: @@ -1572,7 +1347,7 @@ def process_level_reqs( 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, @@ -1610,15 +1385,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", @@ -1651,9 +1429,19 @@ 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) ) @@ -1698,7 +1486,7 @@ def process_level_reqs( step_name, listing_index ) - replace_clt_hintreq_expr_with_etool( + replace_step_process_hintreq_expr_with_etool( new_expression, etool_id, parent, @@ -1706,9 +1494,13 @@ 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( @@ -1736,26 +1528,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 @@ -1764,13 +1570,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( @@ -1802,20 +1610,24 @@ def traverse_CommandLineTool( 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) @@ -1828,18 +1640,24 @@ def traverse_CommandLineTool( 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) @@ -1855,12 +1673,16 @@ def traverse_CommandLineTool( 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( @@ -1875,12 +1697,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: @@ -1889,21 +1718,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")] + 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 = [ { @@ -1930,31 +1766,42 @@ def traverse_CommandLineTool( 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 isinstance(orig_step_input.source, Sequence): + 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 = ( @@ -1973,8 +1820,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: @@ -2002,13 +1849,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: @@ -2039,24 +1890,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_: @@ -2072,7 +1932,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( @@ -2083,7 +1945,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) @@ -2091,7 +1953,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) @@ -2110,7 +1972,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] ) @@ -2124,8 +1987,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, @@ -2133,9 +1997,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, @@ -2146,7 +2011,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] ) @@ -2160,8 +2026,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, @@ -2169,30 +2036,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 @@ -2207,10 +2077,11 @@ def cltool_step_outputs_to_workflow_outputs( 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] @@ -2264,7 +2135,7 @@ def generate_etool_from_expr2( streamable=target.streamable, doc=target.doc, format=target.format[0] if target.format else None, - type_=plain_input_type_to_plain_output(target.type_), + type_=plain_input_schema_to_plain_output_schema(target.type_), ) ) expression = "${" @@ -2468,34 +2339,34 @@ def traverse_step( def workflow_step_to_InputParameters( step_ins: Sequence[cwl.WorkflowStepInput], parent: cwl.Workflow, except_in_id: str -) -> list[cwl.InputParameter | cwl.CommandOutputParameter]: - """Create InputParameters to match the given WorkflowStep inputs.""" +) -> 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 isinstance(param, Sequence): 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 diff --git a/cwl_utils/parser/cwl_v1_0_utils.py b/cwl_utils/parser/cwl_v1_0_utils.py index 974abcab..9362d4ee 100644 --- a/cwl_utils/parser/cwl_v1_0_utils.py +++ b/cwl_utils/parser/cwl_v1_0_utils.py @@ -5,7 +5,7 @@ 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, cast from urllib.parse import urldefrag from schema_salad.exceptions import ValidationException diff --git a/cwl_utils/parser/cwl_v1_2_utils.py b/cwl_utils/parser/cwl_v1_2_utils.py index 551df2ba..94f79bdb 100644 --- a/cwl_utils/parser/cwl_v1_2_utils.py +++ b/cwl_utils/parser/cwl_v1_2_utils.py @@ -281,8 +281,8 @@ def check_all_types( if "null" not in src_typ: src_typ = ["null"] + cast(list[Any], src_typ) if ( - not isinstance(snk_typ, MutableSequence) - or "null" not in snk_typ + not isinstance(snk_typ, MutableSequence) + or "null" not in snk_typ ): validation["warning"].append( SrcSink( @@ -308,8 +308,8 @@ def check_all_types( 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 + _is_conditional_step(param_to_step, parm_id) + and sink.pickValue is not None ): validation["warning"].append( SrcSink( From f9f5ad9b75fd989102c70fc2007924c5701e6748 Mon Sep 17 00:00:00 2001 From: "Michael R. Crusoe" Date: Sat, 20 Dec 2025 15:28:55 +0100 Subject: [PATCH 07/22] finish type fixing cwl_v1_1_expression_refactor --- cwl_utils/cwl_v1_0_expression_refactor.py | 2 +- cwl_utils/cwl_v1_1_expression_refactor.py | 1133 ++++++++++++++------- cwl_utils/parser/cwl_v1_1_utils.py | 12 +- 3 files changed, 798 insertions(+), 349 deletions(-) diff --git a/cwl_utils/cwl_v1_0_expression_refactor.py b/cwl_utils/cwl_v1_0_expression_refactor.py index 2d84bc5d..81692534 100755 --- a/cwl_utils/cwl_v1_0_expression_refactor.py +++ b/cwl_utils/cwl_v1_0_expression_refactor.py @@ -2386,7 +2386,7 @@ def replace_step_valueFrom_expr_with_etool( source_type: ( cwl.InputParameter | cwl.CommandOutputParameter - | MutableSequence[cwl.InputParameter | cwl.CommandOutputParameter] + | Sequence[cwl.InputParameter | cwl.CommandOutputParameter] | None ) = None, ) -> None: diff --git a/cwl_utils/cwl_v1_1_expression_refactor.py b/cwl_utils/cwl_v1_1_expression_refactor.py index 453e4124..40b19923 100755 --- a/cwl_utils/cwl_v1_1_expression_refactor.py +++ b/cwl_utils/cwl_v1_1_expression_refactor.py @@ -8,7 +8,7 @@ import uuid from collections.abc import MutableSequence, Sequence from contextlib import suppress -from typing import Any, cast +from typing import Any, Literal, TypeAlias, TypeVar, cast from ruamel import yaml from schema_salad.sourceline import SourceLine @@ -45,7 +45,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 @@ -56,33 +56,153 @@ 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: +BasicInputTypeSchemas: TypeAlias = ( + cwl.InputArraySchema + | cwl.InputEnumSchema + | cwl.InputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + "stdin", + ] +) +InputTypeSchemas: TypeAlias = BasicInputTypeSchemas | Sequence[BasicInputTypeSchemas] +BasicCommandInputTypeSchemas: TypeAlias = ( + cwl.CommandInputArraySchema + | cwl.CommandInputEnumSchema + | cwl.CommandInputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + "stdin", + ] +) +CommandInputTypeSchemas: TypeAlias = ( + BasicCommandInputTypeSchemas | Sequence[BasicCommandInputTypeSchemas] +) +BasicOutputTypeSchemas: TypeAlias = ( + cwl.OutputArraySchema + | cwl.OutputEnumSchema + | cwl.OutputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + "stdout", + "stderr", + ] +) +OutputTypeSchemas: TypeAlias = BasicOutputTypeSchemas | Sequence[BasicOutputTypeSchemas] +BasicCommandOutputTypeSchemas: TypeAlias = ( + cwl.CommandOutputArraySchema + | cwl.CommandOutputEnumSchema + | cwl.CommandOutputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + "stdout", + "stderr", + ] +) +CommandOutputTypeSchemas: TypeAlias = ( + BasicCommandOutputTypeSchemas | Sequence[BasicCommandOutputTypeSchemas] +) +AnyTypeSchema = TypeVar( + "AnyTypeSchema", bound=InputTypeSchemas | CommandOutputTypeSchemas +) + + +def _clean_type_ids( + cwltype: InputTypeSchemas | CommandOutputTypeSchemas, +) -> None: + if isinstance(cwltype, cwl.ArraySchema): + if isinstance(cwltype.items, Sequence): + 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 isinstance(result, Sequence): + 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 isinstance(field, Sequence): + 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. @@ -137,6 +257,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 isinstance(input_type, Sequence): + 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 isinstance(input_type, Sequence): + 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 isinstance(output_type, Sequence): + 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: @@ -152,7 +412,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, ) @@ -167,7 +427,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, ) @@ -330,20 +590,33 @@ 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 isinstance(self_type, Sequence): + new_type_list: MutableSequence[BasicInputTypeSchemas] = [] + for entry in self_type: + clean_type = clean_type_ids(entry.type_) + if isinstance(clean_type, Sequence): + 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( @@ -373,7 +646,7 @@ def generate_etool_from_expr( ), ) ) - outputs = yaml.comments.CommentedSeq() + outputs: list[cwl.ExpressionToolOutputParameter] = [] outputs.append( cwl.ExpressionToolOutputParameter( id="result", @@ -381,8 +654,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, ) @@ -411,18 +684,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 @@ -431,7 +710,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: """ @@ -456,23 +739,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( @@ -483,14 +778,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( @@ -521,26 +818,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 @@ -617,18 +921,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, @@ -637,7 +940,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, @@ -646,6 +949,7 @@ def process_workflow_inputs_and_outputs( f"Entry {index}," + TOPLEVEL_SF_EXPR_ERROR.format(param.id.split("#")[-1]) ) + return modified @@ -690,7 +994,7 @@ def process_workflow_reqs_and_hints( if expression: modified = True target = cwl.WorkflowInputParameter( - id=None, + id="", type_="string", ) etool_id = ( @@ -711,7 +1015,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: @@ -720,9 +1026,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 ) @@ -747,7 +1051,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 ), @@ -768,18 +1072,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, @@ -789,17 +1093,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="", @@ -809,7 +1115,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( @@ -820,38 +1126,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, @@ -861,24 +1167,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, @@ -887,10 +1193,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: @@ -905,14 +1213,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: @@ -923,15 +1235,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: @@ -943,32 +1259,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, @@ -988,6 +1311,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]] = [] @@ -997,6 +1321,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): @@ -1004,7 +1329,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 ) @@ -1017,7 +1342,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)) @@ -1028,11 +1356,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, @@ -1057,7 +1385,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 ) @@ -1070,15 +1398,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", @@ -1086,15 +1417,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 = ( @@ -1111,31 +1442,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} ; @@ -1151,14 +1492,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, @@ -1166,22 +1507,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( @@ -1196,26 +1541,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 @@ -1224,13 +1583,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( @@ -1258,24 +1619,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) @@ -1284,22 +1649,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) @@ -1310,17 +1681,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( @@ -1335,12 +1710,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: @@ -1349,21 +1731,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 = [ { @@ -1387,34 +1776,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 isinstance(orig_step_input.source, Sequence): + 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 = ( @@ -1433,8 +1833,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: @@ -1462,12 +1862,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: @@ -1498,24 +1903,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_: @@ -1531,7 +1945,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( @@ -1542,7 +1958,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) @@ -1550,7 +1966,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) @@ -1563,13 +1979,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] ) @@ -1583,8 +2000,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, @@ -1592,9 +2010,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, @@ -1605,7 +2024,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] ) @@ -1619,8 +2039,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, @@ -1628,30 +2049,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 @@ -1659,17 +2083,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] @@ -1697,14 +2122,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, @@ -1718,8 +2149,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 = "${" @@ -1734,19 +2165,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)) @@ -1755,7 +2214,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, @@ -1777,43 +2236,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 isinstance(scattered_source_type, list): + 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 @@ -1822,42 +2267,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 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="", + type_=cwl.InputArraySchema(source_types, "array"), + ) # target.id = target.id.split('#')[-1] if isinstance(original_process, cwl.ExpressionTool): found_JSReq = False @@ -1873,9 +2308,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, @@ -1892,6 +2329,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, @@ -1917,29 +2355,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 isinstance(param, Sequence): 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 @@ -1950,15 +2394,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 @@ -1995,22 +2441,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)) @@ -2026,7 +2469,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, @@ -2036,6 +2480,7 @@ def replace_step_valueFrom_expr_with_etool( scatterMethod=step.scatterMethod, ) ) + workflow.steps = new_steps def traverse_workflow( @@ -2068,7 +2513,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/parser/cwl_v1_1_utils.py b/cwl_utils/parser/cwl_v1_1_utils.py index 20117145..44633281 100644 --- a/cwl_utils/parser/cwl_v1_1_utils.py +++ b/cwl_utils/parser/cwl_v1_1_utils.py @@ -430,8 +430,10 @@ def type_for_step_output( def type_for_source( - process: cwl.CommandLineTool | cwl.Workflow | cwl.ExpressionTool, - sourcenames: str | list[str], + process: ( + cwl.CommandLineTool | cwl.Workflow | cwl.ExpressionTool | cwl.ProcessGenerator + ), + sourcenames: str | Sequence[str], parent: cwl.Workflow | None = None, linkMerge: str | None = None, ) -> Any: @@ -482,8 +484,10 @@ def type_for_source( def param_for_source_id( - process: cwl.CommandLineTool | cwl.Workflow | cwl.ExpressionTool, - sourcenames: str | list[str], + process: ( + cwl.CommandLineTool | cwl.Workflow | cwl.ExpressionTool | cwl.ProcessGenerator + ), + sourcenames: str | Sequence[str], parent: cwl.Workflow | None = None, scatter_context: list[tuple[int, str] | None] | None = None, ) -> ( From 414544189132898e20ca6d971983a76e13f4c22d Mon Sep 17 00:00:00 2001 From: "Michael R. Crusoe" Date: Sat, 20 Dec 2025 16:11:10 +0100 Subject: [PATCH 08/22] finish type fixing cwl_v1_2_expression_refactor --- cwl_utils/cwl_v1_2_expression_refactor.py | 1328 ++++++++++++++------- cwl_utils/parser/cwl_v1_2_utils.py | 16 +- 2 files changed, 895 insertions(+), 449 deletions(-) diff --git a/cwl_utils/cwl_v1_2_expression_refactor.py b/cwl_utils/cwl_v1_2_expression_refactor.py index 1b667304..47709bbe 100755 --- a/cwl_utils/cwl_v1_2_expression_refactor.py +++ b/cwl_utils/cwl_v1_2_expression_refactor.py @@ -6,9 +6,9 @@ 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 +from typing import Any, Literal, TypeAlias, TypeVar, cast from ruamel import yaml from schema_salad.sourceline import SourceLine @@ -25,6 +25,7 @@ CWLOutputType, CWLParameterContext, CWLRuntimeParameterContext, + is_file_or_directory, ) @@ -44,7 +45,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 +56,153 @@ 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: +BasicInputTypeSchemas: TypeAlias = ( + cwl.InputArraySchema + | cwl.InputEnumSchema + | cwl.InputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + "stdin", + ] +) +InputTypeSchemas: TypeAlias = BasicInputTypeSchemas | Sequence[BasicInputTypeSchemas] +BasicCommandInputTypeSchemas: TypeAlias = ( + cwl.CommandInputArraySchema + | cwl.CommandInputEnumSchema + | cwl.CommandInputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + "stdin", + ] +) +CommandInputTypeSchemas: TypeAlias = ( + BasicCommandInputTypeSchemas | Sequence[BasicCommandInputTypeSchemas] +) +BasicOutputTypeSchemas: TypeAlias = ( + cwl.OutputArraySchema + | cwl.OutputEnumSchema + | cwl.OutputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + "stdout", + "stderr", + ] +) +OutputTypeSchemas: TypeAlias = BasicOutputTypeSchemas | Sequence[BasicOutputTypeSchemas] +BasicCommandOutputTypeSchemas: TypeAlias = ( + cwl.CommandOutputArraySchema + | cwl.CommandOutputEnumSchema + | cwl.CommandOutputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + "stdout", + "stderr", + ] +) +CommandOutputTypeSchemas: TypeAlias = ( + BasicCommandOutputTypeSchemas | Sequence[BasicCommandOutputTypeSchemas] +) +AnyTypeSchema = TypeVar( + "AnyTypeSchema", bound=InputTypeSchemas | CommandOutputTypeSchemas +) + + +def _clean_type_ids( + cwltype: InputTypeSchemas | CommandOutputTypeSchemas, +) -> None: + if isinstance(cwltype, cwl.ArraySchema): + if isinstance(cwltype.items, Sequence): + 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 isinstance(result, Sequence): + 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 isinstance(field, Sequence): + 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 +257,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 isinstance(input_type, Sequence): + 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 isinstance(input_type, Sequence): + 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 isinstance(input_type, Sequence): + 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 isinstance(output_type, Sequence): + 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: @@ -151,7 +452,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 +467,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, ) @@ -326,53 +627,71 @@ 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 isinstance(self_type, Sequence): + new_type_list: MutableSequence[BasicInputTypeSchemas] = [] + for entry in self_type: + clean_type = clean_type_ids(entry.type_) + if isinstance(clean_type, Sequence): + 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 isinstance(self_type, Sequence) else None, secondaryFiles=( self_type.secondaryFiles - if not isinstance(self_type, list) + if not isinstance(self_type, Sequence) else None ), streamable=( - self_type.streamable if not isinstance(self_type, list) else None + self_type.streamable + if not isinstance(self_type, Sequence) + else None + ), + doc=self_type.doc if not isinstance(self_type, Sequence) else None, + format=( + self_type.format if not isinstance(self_type, Sequence) else None ), - doc=self_type.doc if not isinstance(self_type, list) else None, - format=self_type.format if not isinstance(self_type, list) else None, type_=new_type, extension_fields=( self_type.extension_fields - if not isinstance(self_type, list) + if not isinstance(self_type, Sequence) else None ), loadingOptions=( self_type.loadingOptions - if not isinstance(self_type, list) + if not isinstance(self_type, Sequence) else None ), ) ) - outputs = yaml.comments.CommentedSeq() + outputs: list[cwl.ExpressionToolOutputParameter] = [] outputs.append( cwl.ExpressionToolOutputParameter( id="result", @@ -380,8 +699,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 +729,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 @@ -430,7 +759,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: """ @@ -452,26 +786,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( @@ -482,14 +831,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 +871,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 @@ -660,18 +1019,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, @@ -680,7 +1038,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, @@ -709,26 +1067,31 @@ 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 isinstance(param2.outputSource, Sequence): 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 isinstance(source_type_items.items, Sequence): 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): + elif isinstance(source_type_items, Sequence): 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, @@ -786,7 +1149,7 @@ def process_workflow_reqs_and_hints( if expression: modified = True target = cwl.WorkflowInputParameter( - id=None, + id="", type_="string", ) etool_id = ( @@ -807,7 +1170,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: @@ -816,9 +1181,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 ) @@ -843,7 +1206,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 ), @@ -864,18 +1227,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, @@ -885,17 +1248,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="", @@ -903,16 +1268,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( @@ -923,38 +1281,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, @@ -964,24 +1322,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, @@ -990,10 +1348,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: @@ -1008,14 +1368,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: @@ -1026,15 +1390,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: @@ -1046,32 +1414,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, @@ -1091,6 +1470,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]] = [] @@ -1100,6 +1480,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): @@ -1107,7 +1488,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 ) @@ -1120,7 +1501,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)) @@ -1131,11 +1515,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, @@ -1160,7 +1544,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 ) @@ -1173,15 +1557,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", @@ -1189,15 +1576,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 = ( @@ -1214,31 +1601,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} ; @@ -1254,14 +1651,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, @@ -1269,22 +1666,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( @@ -1299,26 +1700,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 @@ -1327,13 +1742,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( @@ -1361,24 +1778,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) @@ -1387,22 +1808,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) @@ -1413,17 +1840,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( @@ -1438,12 +1869,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: @@ -1452,21 +1890,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 = [ { @@ -1490,34 +1935,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 isinstance(orig_step_input.source, Sequence): + 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 = ( @@ -1536,8 +1992,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: @@ -1565,12 +2021,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: @@ -1601,24 +2062,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_: @@ -1634,7 +2104,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( @@ -1645,7 +2117,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) @@ -1653,7 +2125,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) @@ -1666,13 +2138,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] ) @@ -1686,8 +2159,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, @@ -1695,9 +2169,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, @@ -1708,7 +2183,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] ) @@ -1722,8 +2198,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, @@ -1731,30 +2208,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 @@ -1762,17 +2246,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] @@ -1800,14 +2285,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, @@ -1821,8 +2313,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 = "${" @@ -1837,19 +2329,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)) @@ -1858,7 +2380,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, @@ -1880,43 +2402,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 isinstance(scattered_source_type, Sequence): + 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 @@ -1925,42 +2433,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 isinstance(temp_type, Sequence): + 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 @@ -1976,9 +2474,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, @@ -1994,15 +2494,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, @@ -2028,29 +2521,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 isinstance(param, Sequence): 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 @@ -2061,15 +2560,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 @@ -2106,22 +2611,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)) @@ -2137,7 +2639,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, @@ -2147,72 +2650,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( @@ -2245,7 +2683,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/parser/cwl_v1_2_utils.py b/cwl_utils/parser/cwl_v1_2_utils.py index 94f79bdb..eb0c2902 100644 --- a/cwl_utils/parser/cwl_v1_2_utils.py +++ b/cwl_utils/parser/cwl_v1_2_utils.py @@ -554,8 +554,14 @@ def type_for_step_output( def type_for_source( - process: cwl.CommandLineTool | cwl.Workflow | cwl.ExpressionTool, - sourcenames: str | list[str], + process: ( + cwl.CommandLineTool + | cwl.Workflow + | cwl.ExpressionTool + | cwl.ProcessGenerator + | cwl.Operation + ), + sourcenames: str | Sequence[str], parent: cwl.Workflow | None = None, linkMerge: str | None = None, pickValue: str | None = None, @@ -614,8 +620,10 @@ def type_for_source( def param_for_source_id( - process: cwl.CommandLineTool | cwl.Workflow | cwl.ExpressionTool, - sourcenames: str | list[str], + process: ( + cwl.CommandLineTool | cwl.Workflow | cwl.ExpressionTool | cwl.ProcessGenerator + ), + sourcenames: str | Sequence[str], parent: cwl.Workflow | None = None, scatter_context: list[tuple[int, str] | None] | None = None, ) -> ( From 9cc48d1d585fa89d069fd5f512f2a202bab6d207 Mon Sep 17 00:00:00 2001 From: GlassOfWhiskey Date: Sat, 20 Dec 2025 21:53:30 +0100 Subject: [PATCH 09/22] Regenerate parsers --- cwl_utils/parser/cwl_v1_0.py | 555 ++++++++++----------- cwl_utils/parser/cwl_v1_1.py | 656 +++++++++++++------------ cwl_utils/parser/cwl_v1_2.py | 742 +++++++++++++++-------------- cwl_utils/parser/cwl_v1_2_utils.py | 2 +- 4 files changed, 1018 insertions(+), 937 deletions(-) diff --git a/cwl_utils/parser/cwl_v1_0.py b/cwl_utils/parser/cwl_v1_0.py index 406bcd7d..9f1ee3e5 100644 --- a/cwl_utils/parser/cwl_v1_0.py +++ b/cwl_utils/parser/cwl_v1_0.py @@ -1188,7 +1188,7 @@ def parser_info() -> str: @trait class Documented(Saveable, metaclass=ABCMeta): - pass + doc: None | Sequence[str] | str class RecordField(Documented): @@ -1456,9 +1456,9 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name - 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"]) @@ -1656,8 +1656,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields = fields - self.type_ = type_ + self.fields: None | Sequence[RecordField] = fields + self.type_: Literal["record"] = type_ attrs: ClassVar[Collection[str]] = frozenset(["fields", "type"]) @@ -1928,9 +1928,9 @@ 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.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"]) @@ -2128,8 +2128,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items - self.type_ = type_ + 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"]) @@ -2327,8 +2327,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.type_ = type_ - self.values = values + 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"]) @@ -2526,8 +2526,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.names = names - 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"]) @@ -2725,8 +2725,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items - 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"]) @@ -2992,9 +2992,9 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name - 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"]) @@ -3192,8 +3192,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields = fields - self.type_ = type_ + self.fields: None | Sequence[CWLRecordField] = fields + self.type_: Literal["record"] = type_ attrs: ClassVar[Collection[str]] = frozenset(["fields", "type"]) @@ -3990,17 +3990,17 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "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 + 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( [ @@ -4396,10 +4396,10 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "Directory" - self.location = location - self.path = path - self.basename = basename - self.listing = listing + 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"] @@ -4408,7 +4408,7 @@ def __init__( @trait class SchemaBase(Saveable, metaclass=ABCMeta): - pass + label: None | str @trait @@ -4418,12 +4418,15 @@ class Parameter(SchemaBase, metaclass=ABCMeta): """ - pass + label: None | str + secondaryFiles: None | Sequence[str] | str + streamable: None | bool + doc: None | Sequence[str] | str @trait class InputBinding(Saveable, metaclass=ABCMeta): - pass + loadContents: None | bool @trait @@ -4433,12 +4436,12 @@ class OutputBinding(Saveable, metaclass=ABCMeta): @trait class InputSchema(SchemaBase, metaclass=ABCMeta): - pass + label: None | str @trait class OutputSchema(SchemaBase, metaclass=ABCMeta): - pass + label: None | str class InputRecordField(CWLRecordField): @@ -4813,11 +4816,11 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name - self.type_ = type_ - self.inputBinding = inputBinding - self.label = label + 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"] @@ -5139,10 +5142,10 @@ 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.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"]) @@ -5521,11 +5524,11 @@ 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.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"] @@ -5839,10 +5842,10 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items - self.type_ = type_ - self.label = label - self.inputBinding = inputBinding + 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"] @@ -6167,10 +6170,10 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name - self.type_ = type_ - self.outputBinding = outputBinding + 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"] @@ -6427,9 +6430,9 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields = fields - self.type_ = type_ - self.label = label + self.fields: None | Sequence[OutputRecordField] = fields + self.type_: Literal["record"] = type_ + self.label: None | str = label attrs: ClassVar[Collection[str]] = frozenset(["fields", "type", "label"]) @@ -6808,11 +6811,11 @@ 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.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"] @@ -7126,10 +7129,10 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items - self.type_ = type_ - self.label = label - self.outputBinding = outputBinding + 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"] @@ -7740,15 +7743,15 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id - self.format = format - self.inputBinding = inputBinding - self.default = default - self.type_ = type_ + 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( [ @@ -8259,13 +8262,13 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id - self.outputBinding = outputBinding - self.format = format + 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( [ @@ -8305,7 +8308,14 @@ class Process(Saveable, metaclass=ABCMeta): """ - 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["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"] | None class InlineJavascriptRequirement(ProcessRequirement): @@ -8485,7 +8495,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "InlineJavascriptRequirement" - self.expressionLib = expressionLib + self.expressionLib: None | Sequence[str] = expressionLib attrs: ClassVar[Collection[str]] = frozenset(["class", "expressionLib"]) @@ -8666,7 +8676,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "SchemaDefRequirement" - self.types = types + self.types: Sequence[InputArraySchema | InputEnumSchema | InputRecordSchema] = types attrs: ClassVar[Collection[str]] = frozenset(["class", "types"]) @@ -8874,8 +8884,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.envName = envName - self.envValue = envValue + self.envName: str = envName + self.envValue: str = envValue attrs: ClassVar[Collection[str]] = frozenset(["envName", "envValue"]) @@ -9406,13 +9416,13 @@ def __init__( 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 + 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( [ @@ -9696,9 +9706,9 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.glob = glob - self.loadContents = loadContents - self.outputEval = outputEval + 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"]) @@ -10075,11 +10085,11 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name - self.type_ = type_ - self.inputBinding = inputBinding - self.label = label + 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"] @@ -10401,10 +10411,10 @@ 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.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"]) @@ -10783,11 +10793,11 @@ 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.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"] @@ -11101,10 +11111,10 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items - self.type_ = type_ - self.label = label - self.inputBinding = inputBinding + 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"] @@ -11429,10 +11439,10 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name - self.type_ = type_ - self.outputBinding = outputBinding + 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"] @@ -11754,10 +11764,10 @@ 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.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"]) @@ -12136,11 +12146,11 @@ 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.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"] @@ -12454,10 +12464,10 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items - self.type_ = type_ - self.label = label - self.outputBinding = outputBinding + 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"] @@ -13072,15 +13082,15 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id - self.format = format - self.inputBinding = inputBinding - self.default = default - self.type_ = type_ + 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( [ @@ -13650,14 +13660,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 - self.outputBinding = outputBinding - self.format = format - self.type_ = type_ + 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( [ @@ -14701,23 +14711,23 @@ 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.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["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"] | None = cwlVersion self.class_: Final[str] = "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 + 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( [ @@ -15244,12 +15254,12 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "DockerRequirement" - self.dockerPull = dockerPull - self.dockerLoad = dockerLoad - self.dockerFile = dockerFile - self.dockerImport = dockerImport - self.dockerImageId = dockerImageId - self.dockerOutputDirectory = dockerOutputDirectory + 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( [ @@ -15435,7 +15445,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "SoftwareRequirement" - self.packages = packages + self.packages: Sequence[SoftwarePackage] = packages attrs: ClassVar[Collection[str]] = frozenset(["class", "packages"]) @@ -15689,9 +15699,9 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.package = package - self.version = version - self.specs = specs + self.package: str = package + self.version: None | Sequence[str] = version + self.specs: None | Sequence[str] = specs attrs: ClassVar[Collection[str]] = frozenset(["package", "version", "specs"]) @@ -15957,9 +15967,9 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.entryname = entryname - self.entry = entry - self.writable = writable + self.entryname: None | str = entryname + self.entry: str = entry + self.writable: None | bool = writable attrs: ClassVar[Collection[str]] = frozenset(["entryname", "entry", "writable"]) @@ -16133,7 +16143,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "InitialWorkDirRequirement" - self.listing = listing + self.listing: Sequence[Directory | Dirent | File | str] | str = listing attrs: ClassVar[Collection[str]] = frozenset(["class", "listing"]) @@ -16309,7 +16319,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "EnvVarRequirement" - self.envDef = envDef + self.envDef: Sequence[EnvironmentDef] = envDef attrs: ClassVar[Collection[str]] = frozenset(["class", "envDef"]) @@ -17031,14 +17041,14 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "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 + 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( [ @@ -17604,14 +17614,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 - self.outputBinding = outputBinding - self.format = format - self.type_ = type_ + 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( [ @@ -18262,16 +18272,16 @@ 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.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["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"] | None = cwlVersion self.class_: Final[str] = "ExpressionTool" - self.expression = expression + self.expression: str = expression attrs: ClassVar[Collection[str]] = frozenset( [ @@ -18954,16 +18964,16 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id - self.outputBinding = outputBinding - self.format = format - self.outputSource = outputSource - self.linkMerge = linkMerge - self.type_ = type_ + 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( [ @@ -18983,7 +18993,8 @@ def __init__( @trait class Sink(Saveable, metaclass=ABCMeta): - pass + source: None | Sequence[str] | str + linkMerge: Literal["merge_nested", "merge_flattened"] | None class WorkflowStepInput(Sink): @@ -19398,11 +19409,11 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.source = source - self.linkMerge = linkMerge - self.id = id - self.default = default - self.valueFrom = valueFrom + 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"] @@ -19565,7 +19576,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.id = id + self.id: str = id attrs: ClassVar[Collection[str]] = frozenset(["id"]) @@ -20284,16 +20295,16 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.id = id - 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 + 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( [ @@ -20987,16 +20998,16 @@ 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.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["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"] | None = cwlVersion self.class_: Final[str] = "Workflow" - self.steps = steps + self.steps: Sequence[WorkflowStep] = steps attrs: ClassVar[Collection[str]] = frozenset( [ @@ -21660,7 +21671,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "LoadListingRequirement" - self.loadListing = loadListing + self.loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] = loadListing attrs: ClassVar[Collection[str]] = frozenset(["class", "loadListing"]) @@ -21836,7 +21847,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "InplaceUpdateRequirement" - self.inplaceUpdate = inplaceUpdate + self.inplaceUpdate: bool = inplaceUpdate attrs: ClassVar[Collection[str]] = frozenset(["class", "inplaceUpdate"]) @@ -22005,7 +22016,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "Secrets" - self.secrets = secrets + self.secrets: Sequence[str] = secrets attrs: ClassVar[Collection[str]] = frozenset(["class", "secrets"]) @@ -22188,7 +22199,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "TimeLimit" - self.timelimit = timelimit + self.timelimit: i32 | str = timelimit attrs: ClassVar[Collection[str]] = frozenset(["class", "timelimit"]) @@ -22376,7 +22387,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "WorkReuse" - self.enableReuse = enableReuse + self.enableReuse: bool | str = enableReuse attrs: ClassVar[Collection[str]] = frozenset(["class", "enableReuse"]) @@ -22571,7 +22582,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "NetworkAccess" - self.networkAccess = networkAccess + self.networkAccess: bool | str = networkAccess attrs: ClassVar[Collection[str]] = frozenset(["class", "networkAccess"]) @@ -23202,16 +23213,16 @@ 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.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["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"] | None = cwlVersion self.class_: Final[str] = "ProcessGenerator" - self.run = run + self.run: CommandLineTool | ExpressionTool | ProcessGenerator | Workflow | str = run attrs: ClassVar[Collection[str]] = frozenset( [ @@ -23404,7 +23415,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "MPIRequirement" - self.processes = processes + self.processes: i32 | str = processes attrs: ClassVar[Collection[str]] = frozenset(["class", "processes"]) @@ -23765,10 +23776,10 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "CUDARequirement" - self.cudaComputeCapability = cudaComputeCapability - self.cudaDeviceCountMax = cudaDeviceCountMax - self.cudaDeviceCountMin = cudaDeviceCountMin - self.cudaVersionMin = cudaVersionMin + 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( [ @@ -23946,7 +23957,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "ShmSize" - self.shmSize = shmSize + self.shmSize: str = shmSize attrs: ClassVar[Collection[str]] = frozenset(["class", "shmSize"]) diff --git a/cwl_utils/parser/cwl_v1_1.py b/cwl_utils/parser/cwl_v1_1.py index 0f4004c0..f75e9657 100644 --- a/cwl_utils/parser/cwl_v1_1.py +++ b/cwl_utils/parser/cwl_v1_1.py @@ -1188,7 +1188,7 @@ def parser_info() -> str: @trait class Documented(Saveable, metaclass=ABCMeta): - pass + doc: None | Sequence[str] | str class RecordField(Documented): @@ -1456,9 +1456,9 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name - 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"]) @@ -1656,8 +1656,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields = fields - self.type_ = type_ + self.fields: None | Sequence[RecordField] = fields + self.type_: Literal["record"] = type_ attrs: ClassVar[Collection[str]] = frozenset(["fields", "type"]) @@ -1928,9 +1928,9 @@ 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.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"]) @@ -2128,8 +2128,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items - self.type_ = type_ + 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"]) @@ -2327,8 +2327,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.type_ = type_ - self.values = values + 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"]) @@ -2526,8 +2526,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.names = names - 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"]) @@ -2725,8 +2725,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items - 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"]) @@ -2992,9 +2992,9 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name - 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"]) @@ -3192,8 +3192,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields = fields - self.type_ = type_ + self.fields: None | Sequence[CWLRecordField] = fields + self.type_: Literal["record"] = type_ attrs: ClassVar[Collection[str]] = frozenset(["fields", "type"]) @@ -3990,17 +3990,17 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "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 + 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( [ @@ -4396,10 +4396,10 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "Directory" - self.location = location - self.path = path - self.basename = basename - self.listing = listing + 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"] @@ -4408,37 +4408,40 @@ def __init__( @trait class Labeled(Saveable, metaclass=ABCMeta): - pass + label: None | str @trait class Identified(Saveable, metaclass=ABCMeta): - pass + id: None | str @trait class IdentifierRequired(Identified, metaclass=ABCMeta): - pass + id: str @trait class LoadContents(Saveable, metaclass=ABCMeta): - pass + loadContents: None | bool + loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None @trait class FieldBase(Labeled, metaclass=ABCMeta): - pass + label: None | str + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] + streamable: None | bool @trait class InputFormat(Saveable, metaclass=ABCMeta): - pass + format: None | Sequence[str] | str @trait class OutputFormat(Saveable, metaclass=ABCMeta): - pass + format: None | str @trait @@ -4448,7 +4451,11 @@ class Parameter(FieldBase, Documented, IdentifierRequired, metaclass=ABCMeta): """ - pass + label: None | str + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] + streamable: None | bool + doc: None | Sequence[str] | str + id: str class InputBinding(Saveable): @@ -4593,24 +4600,30 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.loadContents = loadContents + self.loadContents: None | bool = loadContents attrs: ClassVar[Collection[str]] = frozenset(["loadContents"]) @trait class IOSchema(Labeled, Documented, metaclass=ABCMeta): - pass + label: None | str + doc: None | Sequence[str] | str + name: None | str @trait class InputSchema(IOSchema, metaclass=ABCMeta): - pass + label: None | str + doc: None | Sequence[str] | str + name: None | str @trait class OutputSchema(IOSchema, metaclass=ABCMeta): - pass + label: None | str + doc: None | Sequence[str] | str + name: None | str class InputRecordField(CWLRecordField, FieldBase, InputFormat, LoadContents): @@ -5221,15 +5234,15 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name - self.type_ = type_ - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.format = format - self.loadContents = loadContents - self.loadListing = loadListing + 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( [ @@ -5615,11 +5628,11 @@ 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.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"] @@ -5995,11 +6008,11 @@ 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.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"] @@ -6375,11 +6388,11 @@ 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.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"] @@ -6878,13 +6891,13 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name - self.type_ = type_ - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.format = format + 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"] @@ -7260,11 +7273,11 @@ 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.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"] @@ -7640,11 +7653,11 @@ 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.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"] @@ -8020,11 +8033,11 @@ 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.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"] @@ -8033,12 +8046,25 @@ def __init__( @trait class InputParameter(Parameter, InputFormat, LoadContents, metaclass=ABCMeta): - pass + 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): - pass + label: None | str + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] + streamable: None | bool + doc: None | Sequence[str] | str + id: str + format: None | str @trait @@ -8066,7 +8092,14 @@ class Process(Identified, Labeled, Documented, metaclass=ABCMeta): """ - 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["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"] | None class InlineJavascriptRequirement(ProcessRequirement): @@ -8246,7 +8279,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "InlineJavascriptRequirement" - self.expressionLib = expressionLib + self.expressionLib: None | Sequence[str] = expressionLib attrs: ClassVar[Collection[str]] = frozenset(["class", "expressionLib"]) @@ -8432,7 +8465,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "SchemaDefRequirement" - self.types = types + self.types: Sequence[CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema] = types attrs: ClassVar[Collection[str]] = frozenset(["class", "types"]) @@ -8632,8 +8665,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.pattern = pattern - self.required = required + self.pattern: str = pattern + self.required: None | bool | str = required attrs: ClassVar[Collection[str]] = frozenset(["pattern", "required"]) @@ -8813,7 +8846,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "LoadListingRequirement" - self.loadListing = loadListing + self.loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = loadListing attrs: ClassVar[Collection[str]] = frozenset(["class", "loadListing"]) @@ -9021,8 +9054,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.envName = envName - self.envValue = envValue + self.envName: str = envName + self.envValue: str = envValue attrs: ClassVar[Collection[str]] = frozenset(["envName", "envValue"]) @@ -9553,13 +9586,13 @@ def __init__( 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 + 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( [ @@ -9900,10 +9933,10 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.loadContents = loadContents - self.loadListing = loadListing - self.glob = glob - self.outputEval = outputEval + 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"] @@ -9912,7 +9945,7 @@ def __init__( @trait class CommandLineBindable(Saveable, metaclass=ABCMeta): - pass + inputBinding: CommandLineBinding | None class CommandInputRecordField(InputRecordField, CommandLineBindable): @@ -10581,16 +10614,16 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name - 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.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( [ @@ -11045,12 +11078,12 @@ 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.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"] @@ -11492,12 +11525,12 @@ 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.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"] @@ -11934,12 +11967,12 @@ 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.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"] @@ -12496,14 +12529,14 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name - self.type_ = type_ - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.format = format - self.outputBinding = outputBinding + 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( [ @@ -12888,11 +12921,11 @@ 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.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"] @@ -13268,11 +13301,11 @@ 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.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"] @@ -13648,11 +13681,11 @@ 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.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"] @@ -14384,17 +14417,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id - 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 | 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( [ @@ -14967,14 +15000,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 - self.format = format - self.type_ = type_ - self.outputBinding = outputBinding + 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( [ @@ -16018,23 +16051,23 @@ 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.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["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"] | None = cwlVersion self.class_: Final[str] = "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 + 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( [ @@ -16579,12 +16612,12 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "DockerRequirement" - self.dockerPull = dockerPull - self.dockerLoad = dockerLoad - self.dockerFile = dockerFile - self.dockerImport = dockerImport - self.dockerImageId = dockerImageId - self.dockerOutputDirectory = dockerOutputDirectory + 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( [ @@ -16770,7 +16803,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "SoftwareRequirement" - self.packages = packages + self.packages: Sequence[SoftwarePackage] = packages attrs: ClassVar[Collection[str]] = frozenset(["class", "packages"]) @@ -17024,9 +17057,9 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.package = package - self.version = version - self.specs = specs + self.package: str = package + self.version: None | Sequence[str] = version + self.specs: None | Sequence[str] = specs attrs: ClassVar[Collection[str]] = frozenset(["package", "version", "specs"]) @@ -17292,9 +17325,9 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.entryname = entryname - self.entry = entry - self.writable = writable + self.entryname: None | str = entryname + self.entry: str = entry + self.writable: None | bool = writable attrs: ClassVar[Collection[str]] = frozenset(["entryname", "entry", "writable"]) @@ -17468,7 +17501,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "InitialWorkDirRequirement" - self.listing = listing + self.listing: Sequence[Directory | Dirent | File | None | Sequence[Directory | File] | str] | str = listing attrs: ClassVar[Collection[str]] = frozenset(["class", "listing"]) @@ -17644,7 +17677,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "EnvVarRequirement" - self.envDef = envDef + self.envDef: Sequence[EnvironmentDef] = envDef attrs: ClassVar[Collection[str]] = frozenset(["class", "envDef"]) @@ -18366,14 +18399,14 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "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 + 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( [ @@ -18573,7 +18606,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "WorkReuse" - self.enableReuse = enableReuse + self.enableReuse: bool | str = enableReuse attrs: ClassVar[Collection[str]] = frozenset(["class", "enableReuse"]) @@ -18768,7 +18801,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "NetworkAccess" - self.networkAccess = networkAccess + self.networkAccess: bool | str = networkAccess attrs: ClassVar[Collection[str]] = frozenset(["class", "networkAccess"]) @@ -18978,7 +19011,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "InplaceUpdateRequirement" - self.inplaceUpdate = inplaceUpdate + self.inplaceUpdate: bool = inplaceUpdate attrs: ClassVar[Collection[str]] = frozenset(["class", "inplaceUpdate"]) @@ -19164,7 +19197,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "ToolTimeLimit" - self.timelimit = timelimit + self.timelimit: i32 | str = timelimit attrs: ClassVar[Collection[str]] = frozenset(["class", "timelimit"]) @@ -19661,13 +19694,13 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id - self.format = format - self.type_ = type_ + 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"] @@ -20395,17 +20428,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id - 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 | 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( [ @@ -21065,16 +21098,16 @@ 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.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["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"] | None = cwlVersion self.class_: Final[str] = "ExpressionTool" - self.expression = expression + self.expression: str = expression attrs: ClassVar[Collection[str]] = frozenset( [ @@ -21701,15 +21734,15 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id - self.format = format - self.outputSource = outputSource - self.linkMerge = linkMerge - self.type_ = type_ + 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( [ @@ -21728,7 +21761,8 @@ def __init__( @trait class Sink(Saveable, metaclass=ABCMeta): - pass + source: None | Sequence[str] | str + linkMerge: Literal["merge_nested", "merge_flattened"] | None class WorkflowStepInput(IdentifierRequired, Sink, LoadContents, Labeled): @@ -22324,14 +22358,14 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.id = id - self.source = source - self.linkMerge = linkMerge - self.loadContents = loadContents - self.loadListing = loadListing - self.label = label - self.default = default - self.valueFrom = valueFrom + 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( [ @@ -22507,7 +22541,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.id = id + self.id: str = id attrs: ClassVar[Collection[str]] = frozenset(["id"]) @@ -23228,16 +23262,16 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.id = id - 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 + 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( [ @@ -23931,16 +23965,16 @@ 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.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["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"] | None = cwlVersion self.class_: Final[str] = "Workflow" - self.steps = steps + self.steps: Sequence[WorkflowStep] = steps attrs: ClassVar[Collection[str]] = frozenset( [ @@ -24598,7 +24632,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "Secrets" - self.secrets = secrets + self.secrets: Sequence[str] = secrets attrs: ClassVar[Collection[str]] = frozenset(["class", "secrets"]) @@ -25231,16 +25265,16 @@ 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.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["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"] | None = cwlVersion self.class_: Final[str] = "ProcessGenerator" - self.run = run + self.run: CommandLineTool | ExpressionTool | ProcessGenerator | Workflow | str = run attrs: ClassVar[Collection[str]] = frozenset( [ @@ -25433,7 +25467,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "MPIRequirement" - self.processes = processes + self.processes: i32 | str = processes attrs: ClassVar[Collection[str]] = frozenset(["class", "processes"]) @@ -25794,10 +25828,10 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "CUDARequirement" - self.cudaComputeCapability = cudaComputeCapability - self.cudaDeviceCountMax = cudaDeviceCountMax - self.cudaDeviceCountMin = cudaDeviceCountMin - self.cudaVersionMin = cudaVersionMin + 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( [ @@ -25975,7 +26009,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "ShmSize" - self.shmSize = shmSize + self.shmSize: str = shmSize attrs: ClassVar[Collection[str]] = frozenset(["class", "shmSize"]) diff --git a/cwl_utils/parser/cwl_v1_2.py b/cwl_utils/parser/cwl_v1_2.py index 167ed57b..34e379b2 100644 --- a/cwl_utils/parser/cwl_v1_2.py +++ b/cwl_utils/parser/cwl_v1_2.py @@ -1188,7 +1188,7 @@ def parser_info() -> str: @trait class Documented(Saveable, metaclass=ABCMeta): - pass + doc: None | Sequence[str] | str class RecordField(Documented): @@ -1456,9 +1456,9 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name - 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"]) @@ -1656,8 +1656,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields = fields - self.type_ = type_ + self.fields: None | Sequence[RecordField] = fields + self.type_: Literal["record"] = type_ attrs: ClassVar[Collection[str]] = frozenset(["fields", "type"]) @@ -1928,9 +1928,9 @@ 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.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"]) @@ -2128,8 +2128,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items - self.type_ = type_ + 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"]) @@ -2327,8 +2327,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.type_ = type_ - self.values = values + 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"]) @@ -2526,8 +2526,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.names = names - 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"]) @@ -2725,8 +2725,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.items = items - 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"]) @@ -2992,9 +2992,9 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name - 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"]) @@ -3192,8 +3192,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields = fields - self.type_ = type_ + self.fields: None | Sequence[CWLRecordField] = fields + self.type_: Literal["record"] = type_ attrs: ClassVar[Collection[str]] = frozenset(["fields", "type"]) @@ -3990,17 +3990,17 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "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 + 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( [ @@ -4396,10 +4396,10 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "Directory" - self.location = location - self.path = path - self.basename = basename - self.listing = listing + 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"] @@ -4408,37 +4408,40 @@ def __init__( @trait class Labeled(Saveable, metaclass=ABCMeta): - pass + label: None | str @trait class Identified(Saveable, metaclass=ABCMeta): - pass + id: None | str @trait class IdentifierRequired(Identified, metaclass=ABCMeta): - pass + id: str @trait class LoadContents(Saveable, metaclass=ABCMeta): - pass + loadContents: None | bool + loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None @trait class FieldBase(Labeled, metaclass=ABCMeta): - pass + label: None | str + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] + streamable: None | bool @trait class InputFormat(Saveable, metaclass=ABCMeta): - pass + format: None | Sequence[str] | str @trait class OutputFormat(Saveable, metaclass=ABCMeta): - pass + format: None | str @trait @@ -4448,7 +4451,11 @@ class Parameter(FieldBase, Documented, IdentifierRequired, metaclass=ABCMeta): """ - pass + label: None | str + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] + streamable: None | bool + doc: None | Sequence[str] | str + id: str class InputBinding(Saveable): @@ -4593,24 +4600,30 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.loadContents = loadContents + self.loadContents: None | bool = loadContents attrs: ClassVar[Collection[str]] = frozenset(["loadContents"]) @trait class IOSchema(Labeled, Documented, metaclass=ABCMeta): - pass + label: None | str + doc: None | Sequence[str] | str + name: None | str @trait class InputSchema(IOSchema, metaclass=ABCMeta): - pass + label: None | str + doc: None | Sequence[str] | str + name: None | str @trait class OutputSchema(IOSchema, metaclass=ABCMeta): - pass + label: None | str + doc: None | Sequence[str] | str + name: None | str class InputRecordField(CWLRecordField, FieldBase, InputFormat, LoadContents): @@ -5221,15 +5234,15 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name - self.type_ = type_ - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.format = format - self.loadContents = loadContents - self.loadListing = loadListing + 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( [ @@ -5615,11 +5628,11 @@ 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.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"] @@ -5995,11 +6008,11 @@ 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.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"] @@ -6375,11 +6388,11 @@ 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.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"] @@ -6878,13 +6891,13 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name - self.type_ = type_ - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.format = format + 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"] @@ -7260,11 +7273,11 @@ 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.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"] @@ -7640,11 +7653,11 @@ 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.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"] @@ -8020,11 +8033,11 @@ 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.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"] @@ -8033,12 +8046,25 @@ def __init__( @trait class InputParameter(Parameter, InputFormat, LoadContents, metaclass=ABCMeta): - pass + 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): - pass + label: None | str + secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] + streamable: None | bool + doc: None | Sequence[str] | str + id: str + format: None | str @trait @@ -8066,7 +8092,15 @@ class Process(Identified, Labeled, Documented, metaclass=ABCMeta): """ - 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["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"] | None + intent: None | Sequence[str] class InlineJavascriptRequirement(ProcessRequirement): @@ -8246,7 +8280,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "InlineJavascriptRequirement" - self.expressionLib = expressionLib + self.expressionLib: None | Sequence[str] = expressionLib attrs: ClassVar[Collection[str]] = frozenset(["class", "expressionLib"]) @@ -8437,7 +8471,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "SchemaDefRequirement" - self.types = types + self.types: Sequence[CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema] = types attrs: ClassVar[Collection[str]] = frozenset(["class", "types"]) @@ -8654,8 +8688,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.pattern = pattern - self.required = required + self.pattern: str = pattern + self.required: None | bool | str = required attrs: ClassVar[Collection[str]] = frozenset(["pattern", "required"]) @@ -8835,7 +8869,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "LoadListingRequirement" - self.loadListing = loadListing + self.loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = loadListing attrs: ClassVar[Collection[str]] = frozenset(["class", "loadListing"]) @@ -9043,8 +9077,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.envName = envName - self.envValue = envValue + self.envName: str = envName + self.envValue: str = envValue attrs: ClassVar[Collection[str]] = frozenset(["envName", "envValue"]) @@ -9575,13 +9609,13 @@ def __init__( 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 + 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( [ @@ -9922,10 +9956,10 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.loadContents = loadContents - self.loadListing = loadListing - self.glob = glob - self.outputEval = outputEval + 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"] @@ -9934,7 +9968,7 @@ def __init__( @trait class CommandLineBindable(Saveable, metaclass=ABCMeta): - pass + inputBinding: CommandLineBinding | None class CommandInputRecordField(InputRecordField, CommandLineBindable): @@ -10603,16 +10637,16 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name - 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.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( [ @@ -11067,12 +11101,12 @@ 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.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"] @@ -11514,12 +11548,12 @@ 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.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"] @@ -11956,12 +11990,12 @@ 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.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"] @@ -12518,14 +12552,14 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.doc = doc - self.name = name - self.type_ = type_ - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.format = format - self.outputBinding = outputBinding + 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( [ @@ -12910,11 +12944,11 @@ 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.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"] @@ -13290,11 +13324,11 @@ 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.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"] @@ -13670,11 +13704,11 @@ 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.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"] @@ -14406,17 +14440,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id - 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 | 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( [ @@ -14989,14 +15023,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 - self.format = format - self.type_ = type_ - self.outputBinding = outputBinding + 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( [ @@ -16094,24 +16128,24 @@ 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.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["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"] | None = cwlVersion + self.intent: None | Sequence[str] = intent self.class_: Final[str] = "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 + 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( [ @@ -16657,12 +16691,12 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "DockerRequirement" - self.dockerPull = dockerPull - self.dockerLoad = dockerLoad - self.dockerFile = dockerFile - self.dockerImport = dockerImport - self.dockerImageId = dockerImageId - self.dockerOutputDirectory = dockerOutputDirectory + 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( [ @@ -16848,7 +16882,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "SoftwareRequirement" - self.packages = packages + self.packages: Sequence[SoftwarePackage] = packages attrs: ClassVar[Collection[str]] = frozenset(["class", "packages"]) @@ -17102,9 +17136,9 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.package = package - self.version = version - self.specs = specs + self.package: str = package + self.version: None | Sequence[str] = version + self.specs: None | Sequence[str] = specs attrs: ClassVar[Collection[str]] = frozenset(["package", "version", "specs"]) @@ -17374,9 +17408,9 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.entryname = entryname - self.entry = entry - self.writable = writable + self.entryname: None | str = entryname + self.entry: str = entry + self.writable: None | bool = writable attrs: ClassVar[Collection[str]] = frozenset(["entryname", "entry", "writable"]) @@ -17551,7 +17585,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "InitialWorkDirRequirement" - self.listing = listing + self.listing: Sequence[Directory | Dirent | File | None | Sequence[Directory | File] | str] | str = listing attrs: ClassVar[Collection[str]] = frozenset(["class", "listing"]) @@ -17727,7 +17761,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "EnvVarRequirement" - self.envDef = envDef + self.envDef: Sequence[EnvironmentDef] = envDef attrs: ClassVar[Collection[str]] = frozenset(["class", "envDef"]) @@ -18454,14 +18488,14 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "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 + 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( [ @@ -18661,7 +18695,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "WorkReuse" - self.enableReuse = enableReuse + self.enableReuse: bool | str = enableReuse attrs: ClassVar[Collection[str]] = frozenset(["class", "enableReuse"]) @@ -18856,7 +18890,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "NetworkAccess" - self.networkAccess = networkAccess + self.networkAccess: bool | str = networkAccess attrs: ClassVar[Collection[str]] = frozenset(["class", "networkAccess"]) @@ -19066,7 +19100,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "InplaceUpdateRequirement" - self.inplaceUpdate = inplaceUpdate + self.inplaceUpdate: bool = inplaceUpdate attrs: ClassVar[Collection[str]] = frozenset(["class", "inplaceUpdate"]) @@ -19252,7 +19286,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "ToolTimeLimit" - self.timelimit = timelimit + self.timelimit: i32 | str = timelimit attrs: ClassVar[Collection[str]] = frozenset(["class", "timelimit"]) @@ -19749,13 +19783,13 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id - self.format = format - self.type_ = type_ + 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"] @@ -20483,17 +20517,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id - 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 | 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( [ @@ -21207,17 +21241,17 @@ 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.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["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"] | None = cwlVersion + self.intent: None | Sequence[str] = intent self.class_: Final[str] = "ExpressionTool" - self.expression = expression + self.expression: str = expression attrs: ClassVar[Collection[str]] = frozenset( [ @@ -21903,16 +21937,16 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id - self.format = format - self.outputSource = outputSource - self.linkMerge = linkMerge - self.pickValue = pickValue - self.type_ = type_ + 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( [ @@ -21932,7 +21966,9 @@ def __init__( @trait class Sink(Saveable, metaclass=ABCMeta): - pass + 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): @@ -22648,15 +22684,15 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.id = id - self.source = source - self.linkMerge = linkMerge - self.pickValue = pickValue - self.loadContents = loadContents - self.loadListing = loadListing - self.label = label - self.default = default - self.valueFrom = valueFrom + 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( [ @@ -22833,7 +22869,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.id = id + self.id: str = id attrs: ClassVar[Collection[str]] = frozenset(["id"]) @@ -23633,17 +23669,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.id = id - 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 + 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( [ @@ -24398,17 +24434,17 @@ 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.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["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"] | None = cwlVersion + self.intent: None | Sequence[str] = intent self.class_: Final[str] = "Workflow" - self.steps = steps + self.steps: Sequence[WorkflowStep] = steps attrs: ClassVar[Collection[str]] = frozenset( [ @@ -25571,16 +25607,16 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id - self.format = format - self.loadContents = loadContents - self.loadListing = loadListing - self.default = default - self.type_ = type_ + 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( [ @@ -26095,13 +26131,13 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.label = label - self.secondaryFiles = secondaryFiles - self.streamable = streamable - self.doc = doc - self.id = id - self.format = format - self.type_ = type_ + 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"] @@ -26744,15 +26780,15 @@ 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.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["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"] | None = cwlVersion + self.intent: None | Sequence[str] = intent self.class_: Final[str] = "Operation" attrs: ClassVar[Collection[str]] = frozenset( @@ -26935,7 +26971,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "Secrets" - self.secrets = secrets + self.secrets: Sequence[str] = secrets attrs: ClassVar[Collection[str]] = frozenset(["class", "secrets"]) @@ -27622,17 +27658,17 @@ 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.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["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"] | None = cwlVersion + self.intent: None | Sequence[str] = intent self.class_: Final[str] = "ProcessGenerator" - self.run = run + self.run: CommandLineTool | ExpressionTool | Operation | ProcessGenerator | Workflow | str = run attrs: ClassVar[Collection[str]] = frozenset( [ @@ -27826,7 +27862,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "MPIRequirement" - self.processes = processes + self.processes: i32 | str = processes attrs: ClassVar[Collection[str]] = frozenset(["class", "processes"]) @@ -28187,10 +28223,10 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "CUDARequirement" - self.cudaComputeCapability = cudaComputeCapability - self.cudaDeviceCountMax = cudaDeviceCountMax - self.cudaDeviceCountMin = cudaDeviceCountMin - self.cudaVersionMin = cudaVersionMin + 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( [ @@ -28633,12 +28669,12 @@ def __init__( 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 + 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"] @@ -28942,9 +28978,9 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "Loop" - self.loop = loop - self.loopWhen = loopWhen - self.outputMethod = outputMethod + self.loop: Sequence[LoopInput] = loop + self.loopWhen: str = loopWhen + self.outputMethod: Literal["last", "all"] = outputMethod attrs: ClassVar[Collection[str]] = frozenset( ["class", "loop", "loopWhen", "outputMethod"] @@ -29116,7 +29152,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "ShmSize" - self.shmSize = shmSize + self.shmSize: str = shmSize attrs: ClassVar[Collection[str]] = frozenset(["class", "shmSize"]) diff --git a/cwl_utils/parser/cwl_v1_2_utils.py b/cwl_utils/parser/cwl_v1_2_utils.py index eb0c2902..5afbfdb7 100644 --- a/cwl_utils/parser/cwl_v1_2_utils.py +++ b/cwl_utils/parser/cwl_v1_2_utils.py @@ -299,7 +299,7 @@ def check_all_types( items=src_typ, type_="array" ) else: - linkMerge: str | None = sink.linkMerge or ( + linkMerge = sink.linkMerge or ( "merge_nested" if len(sourceField) > 1 else None ) if sink.pickValue in ("first_non_null", "the_only_non_null"): From c2f605680b364ef96e7aabe0393b7604550dfee7 Mon Sep 17 00:00:00 2001 From: "Michael R. Crusoe" Date: Sun, 21 Dec 2025 11:31:15 +0100 Subject: [PATCH 10/22] expression-refactor: fix detection of non-string Sequences --- cwl_utils/cwl_v1_0_expression_refactor.py | 45 ++++++++-------- cwl_utils/cwl_v1_1_expression_refactor.py | 45 ++++++++-------- cwl_utils/cwl_v1_2_expression_refactor.py | 62 +++++++++++------------ cwl_utils/types.py | 10 ++-- 4 files changed, 76 insertions(+), 86 deletions(-) diff --git a/cwl_utils/cwl_v1_0_expression_refactor.py b/cwl_utils/cwl_v1_0_expression_refactor.py index 81692534..a3dd1002 100755 --- a/cwl_utils/cwl_v1_0_expression_refactor.py +++ b/cwl_utils/cwl_v1_0_expression_refactor.py @@ -26,6 +26,7 @@ CWLParameterContext, CWLRuntimeParameterContext, is_file_or_directory, + is_sequence, ) @@ -145,7 +146,7 @@ def _clean_type_ids( cwltype: InputTypeSchemas | CommandOutputTypeSchemas, ) -> None: if isinstance(cwltype, cwl.ArraySchema): - if isinstance(cwltype.items, Sequence): + if is_sequence(cwltype.items): for item in cwltype.items: if hasattr(item, "id"): item.id = item.id.split("#")[-1] @@ -174,7 +175,7 @@ def clean_type_ids( ) -> AnyTypeSchema: """Simplify type identifiers.""" result = copy.deepcopy(cwltype) - if isinstance(result, Sequence): + if is_sequence(result): for item in result: _clean_type_ids(item) else: @@ -191,7 +192,7 @@ def _has_expression(string: str) -> bool: def has_expression(field: str | Sequence[str]) -> bool: - if isinstance(field, Sequence): + if is_sequence(field): for entry in field: if _has_expression(entry): return True @@ -285,7 +286,7 @@ def _plain_input_schema_to_clt_input_schema( def plain_input_schema_to_clt_input_schema( input_type: InputTypeSchemas, ) -> CommandInputTypeSchemas: - if isinstance(input_type, Sequence): + if is_sequence(input_type): return [ _plain_input_schema_to_clt_input_schema(input_type_item) for input_type_item in input_type @@ -325,7 +326,7 @@ def _plain_input_schema_to_plain_output_schema( def plain_input_schema_to_plain_output_schema( input_type: InputTypeSchemas, ) -> OutputTypeSchemas: - if isinstance(input_type, Sequence): + if is_sequence(input_type): return [ _plain_input_schema_to_plain_output_schema(input_type_item) for input_type_item in input_type @@ -365,7 +366,7 @@ def _plain_output_type_to_clt_output_type( def plain_output_type_to_clt_output_type( output_type: OutputTypeSchemas, ) -> CommandOutputTypeSchemas: - if isinstance(output_type, Sequence): + if is_sequence(output_type): return [ _plain_output_type_to_clt_output_type(output_type_item) for output_type_item in output_type @@ -606,11 +607,11 @@ def generate_etool_from_expr( self_type = target assert self_type is not None new_type: InputTypeSchemas - if isinstance(self_type, Sequence): + if is_sequence(self_type): new_type_list: MutableSequence[BasicInputTypeSchemas] = [] for entry in self_type: clean_type = clean_type_ids(entry.type_) - if isinstance(clean_type, Sequence): + if is_sequence(clean_type): new_type_list.extend(clean_type) elif clean_type is None: pass @@ -622,27 +623,21 @@ def generate_etool_from_expr( 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 ), ) ) @@ -1783,7 +1778,7 @@ def traverse_CommandLineTool( sub_wf_inputs = process_inputs_to_etool_inputs(clt) orig_step_inputs = copy.deepcopy(step.in_) for orig_step_input in orig_step_inputs: - if isinstance(orig_step_input.source, Sequence): + 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): new_orig_step_input_source[index] = source.split("#")[ @@ -2239,7 +2234,7 @@ def traverse_step( ) else: scattered_source_type = utils.type_for_source(parent, source) - if isinstance(scattered_source_type, list): + if is_sequence(scattered_source_type): for stype in scattered_source_type: self.append(example_input(stype.type_)) else: @@ -2265,7 +2260,7 @@ def traverse_step( 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): + if is_sequence(temp_type): for ttype in temp_type: if ttype not in source_types: source_types.append(ttype) @@ -2348,7 +2343,7 @@ def workflow_step_to_InputParameters( param = copy.deepcopy( utils.param_for_source_id(parent, sourcenames=inp.source) ) - if isinstance(param, Sequence): + if is_sequence(param): for p in param: if not p.type_: raise WorkflowException( diff --git a/cwl_utils/cwl_v1_1_expression_refactor.py b/cwl_utils/cwl_v1_1_expression_refactor.py index 40b19923..4a5104e1 100755 --- a/cwl_utils/cwl_v1_1_expression_refactor.py +++ b/cwl_utils/cwl_v1_1_expression_refactor.py @@ -26,6 +26,7 @@ CWLParameterContext, CWLRuntimeParameterContext, is_file_or_directory, + is_sequence, ) @@ -147,7 +148,7 @@ def _clean_type_ids( cwltype: InputTypeSchemas | CommandOutputTypeSchemas, ) -> None: if isinstance(cwltype, cwl.ArraySchema): - if isinstance(cwltype.items, Sequence): + if is_sequence(cwltype.items): for item in cwltype.items: if hasattr(item, "id"): item.id = item.id.split("#")[-1] @@ -176,7 +177,7 @@ def clean_type_ids( ) -> AnyTypeSchema: """Simplify type identifiers.""" result = copy.deepcopy(cwltype) - if isinstance(result, Sequence): + if is_sequence(result): for item in result: _clean_type_ids(item) else: @@ -193,7 +194,7 @@ def _has_expression(string: str) -> bool: def has_expression(field: str | Sequence[str]) -> bool: - if isinstance(field, Sequence): + if is_sequence(field): for entry in field: if _has_expression(entry): return True @@ -287,7 +288,7 @@ def _plain_input_schema_to_clt_input_schema( def plain_input_schema_to_clt_input_schema( input_type: InputTypeSchemas, ) -> CommandInputTypeSchemas: - if isinstance(input_type, Sequence): + if is_sequence(input_type): return [ _plain_input_schema_to_clt_input_schema(input_type_item) for input_type_item in input_type @@ -325,7 +326,7 @@ def _plain_input_schema_to_plain_output_schema( def plain_input_schema_to_plain_output_schema( input_type: InputTypeSchemas, ) -> OutputTypeSchemas: - if isinstance(input_type, Sequence): + if is_sequence(input_type): return [ _plain_input_schema_to_plain_output_schema(input_type_item) for input_type_item in input_type @@ -363,7 +364,7 @@ def _plain_output_type_to_clt_output_type( def plain_output_type_to_clt_output_type( output_type: OutputTypeSchemas, ) -> CommandOutputTypeSchemas: - if isinstance(output_type, Sequence): + if is_sequence(output_type): return [ _plain_output_type_to_clt_output_type(output_type_item) for output_type_item in output_type @@ -606,11 +607,11 @@ def generate_etool_from_expr( self_type = target assert self_type is not None new_type: InputTypeSchemas - if isinstance(self_type, Sequence): + if is_sequence(self_type): new_type_list: MutableSequence[BasicInputTypeSchemas] = [] for entry in self_type: clean_type = clean_type_ids(entry.type_) - if isinstance(clean_type, Sequence): + if is_sequence(clean_type): new_type_list.extend(clean_type) elif clean_type is None: pass @@ -622,27 +623,21 @@ def generate_etool_from_expr( 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 ), ) ) @@ -1796,7 +1791,7 @@ def traverse_CommandLineTool( sub_wf_inputs = process_inputs_to_etool_inputs(clt) orig_step_inputs = copy.deepcopy(step.in_) for orig_step_input in orig_step_inputs: - if isinstance(orig_step_input.source, Sequence): + 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): new_orig_step_input_source[index] = source.split("#")[ @@ -2254,7 +2249,7 @@ def traverse_step( ) else: scattered_source_type = utils.type_for_source(parent, source) - if isinstance(scattered_source_type, list): + if is_sequence(scattered_source_type): for stype in scattered_source_type: self.append(example_input(stype.type_)) else: @@ -2282,7 +2277,7 @@ def traverse_step( 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): + if is_sequence(temp_type): for ttype in temp_type: if ttype not in source_types: source_types.append(ttype) @@ -2365,7 +2360,7 @@ def workflow_step_to_WorkflowInputParameters( param = copy.deepcopy( utils.param_for_source_id(parent, sourcenames=inp.source) ) - if isinstance(param, Sequence): + if is_sequence(param): for p in param: if not p.type_: raise WorkflowException( diff --git a/cwl_utils/cwl_v1_2_expression_refactor.py b/cwl_utils/cwl_v1_2_expression_refactor.py index 47709bbe..e66102bd 100755 --- a/cwl_utils/cwl_v1_2_expression_refactor.py +++ b/cwl_utils/cwl_v1_2_expression_refactor.py @@ -26,6 +26,7 @@ CWLParameterContext, CWLRuntimeParameterContext, is_file_or_directory, + is_sequence, ) @@ -147,7 +148,7 @@ def _clean_type_ids( cwltype: InputTypeSchemas | CommandOutputTypeSchemas, ) -> None: if isinstance(cwltype, cwl.ArraySchema): - if isinstance(cwltype.items, Sequence): + if is_sequence(cwltype.items): for item in cwltype.items: if hasattr(item, "id"): item.id = item.id.split("#")[-1] @@ -176,7 +177,7 @@ def clean_type_ids( ) -> AnyTypeSchema: """Simplify type identifiers.""" result = copy.deepcopy(cwltype) - if isinstance(result, Sequence): + if is_sequence(result): for item in result: _clean_type_ids(item) else: @@ -193,7 +194,7 @@ def _has_expression(string: str) -> bool: def has_expression(field: str | Sequence[str]) -> bool: - if isinstance(field, Sequence): + if is_sequence(field): for entry in field: if _has_expression(entry): return True @@ -287,7 +288,7 @@ def _plain_input_schema_to_clt_input_schema( def plain_input_schema_to_clt_input_schema( input_type: InputTypeSchemas, ) -> CommandInputTypeSchemas: - if isinstance(input_type, Sequence): + if is_sequence(input_type): return [ _plain_input_schema_to_clt_input_schema(input_type_item) for input_type_item in input_type @@ -325,7 +326,7 @@ def _plain_input_schema_to_plain_output_schema( def plain_input_schema_to_plain_output_schema( input_type: InputTypeSchemas, ) -> OutputTypeSchemas: - if isinstance(input_type, Sequence): + if is_sequence(input_type): return [ _plain_input_schema_to_plain_output_schema(input_type_item) for input_type_item in input_type @@ -363,7 +364,7 @@ def _plain_output_schema_to_plain_input_schema( def plain_output_schema_to_plain_input_schema( input_type: OutputTypeSchemas, ) -> InputTypeSchemas: - if isinstance(input_type, Sequence): + if is_sequence(input_type): return [ _plain_output_schema_to_plain_input_schema(input_type_item) for input_type_item in input_type @@ -401,7 +402,7 @@ def _plain_output_type_to_clt_output_type( def plain_output_type_to_clt_output_type( output_type: OutputTypeSchemas, ) -> CommandOutputTypeSchemas: - if isinstance(output_type, Sequence): + if is_sequence(output_type): return [ _plain_output_type_to_clt_output_type(output_type_item) for output_type_item in output_type @@ -647,11 +648,11 @@ def generate_etool_from_expr( self_type = target assert self_type is not None new_type: InputTypeSchemas - if isinstance(self_type, Sequence): + if is_sequence(self_type): new_type_list: MutableSequence[BasicInputTypeSchemas] = [] for entry in self_type: clean_type = clean_type_ids(entry.type_) - if isinstance(clean_type, Sequence): + if is_sequence(clean_type): new_type_list.extend(clean_type) elif clean_type is None: pass @@ -663,31 +664,21 @@ def generate_etool_from_expr( inputs.append( cwl.WorkflowInputParameter( id="self", - label=self_type.label if not isinstance(self_type, Sequence) else None, + label=self_type.label if not is_sequence(self_type) else None, secondaryFiles=( - self_type.secondaryFiles - if not isinstance(self_type, Sequence) - else None + self_type.secondaryFiles if not is_sequence(self_type) else None ), streamable=( - self_type.streamable - if not isinstance(self_type, Sequence) - else None - ), - doc=self_type.doc if not isinstance(self_type, Sequence) else None, - format=( - self_type.format if not isinstance(self_type, Sequence) else None + self_type.streamable if not is_sequence(self_type) 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, Sequence) - else None + self_type.extension_fields if not is_sequence(self_type) else None ), loadingOptions=( - self_type.loadingOptions - if not isinstance(self_type, Sequence) - else None + self_type.loadingOptions if not is_sequence(self_type) else None ), ) ) @@ -1071,20 +1062,25 @@ def process_workflow_inputs_and_outputs( id="", type_=plain_output_schema_to_plain_input_schema(target_type) ) assert param2.outputSource is not None - if not isinstance(param2.outputSource, Sequence): + 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, Sequence): + if is_sequence(source_type_items.items): if "null" not in source_type_items.items: 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, Sequence): + 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: new_source_type_items = list(source_type_items) new_source_type_items.append("null") @@ -1955,7 +1951,7 @@ def traverse_CommandLineTool( sub_wf_inputs = process_inputs_to_etool_inputs(clt) orig_step_inputs = copy.deepcopy(step.in_) for orig_step_input in orig_step_inputs: - if isinstance(orig_step_input.source, Sequence): + 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): new_orig_step_input_source[index] = source.split("#")[ @@ -2420,7 +2416,7 @@ def traverse_step( ) else: scattered_source_type = utils.type_for_source(parent, source) - if isinstance(scattered_source_type, Sequence): + if is_sequence(scattered_source_type): for stype in scattered_source_type: self.append(example_input(stype.type_)) else: @@ -2448,7 +2444,7 @@ def traverse_step( 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, Sequence): + if is_sequence(temp_type): for ttype in temp_type: if ttype not in source_types: source_types.append(ttype) @@ -2531,7 +2527,7 @@ def workflow_step_to_WorkflowInputParameters( param = copy.deepcopy( utils.param_for_source_id(parent, sourcenames=inp.source) ) - if isinstance(param, Sequence): + if is_sequence(param): for p in param: if not p.type_: raise WorkflowException( diff --git a/cwl_utils/types.py b/cwl_utils/types.py index 6b7b0d83..dbc291f6 100644 --- a/cwl_utils/types.py +++ b/cwl_utils/types.py @@ -3,13 +3,13 @@ """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 @@ -161,3 +161,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) From 7a34d2b7725f936237fc42aeed4601655695e132 Mon Sep 17 00:00:00 2001 From: "Michael R. Crusoe" Date: Sun, 21 Dec 2025 12:01:33 +0100 Subject: [PATCH 11/22] bandit: allow asserts --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 33edce87..539210af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -140,3 +140,4 @@ ignore = [ [tool.bandit] exclude_dirs = ["cwl_utils/tests"] +skips = ["B101"] From 510ae16b25817d5f6f06938ecd2304c37c5863e4 Mon Sep 17 00:00:00 2001 From: "Michael R. Crusoe" Date: Sun, 21 Dec 2025 14:19:28 +0100 Subject: [PATCH 12/22] inputs_schema_gen: type fixes --- cwl_utils/inputs_schema_gen.py | 73 ++++++++++++++++++++-------------- 1 file changed, 43 insertions(+), 30 deletions(-) diff --git a/cwl_utils/inputs_schema_gen.py b/cwl_utils/inputs_schema_gen.py index e42be946..24de43e3 100644 --- a/cwl_utils/inputs_schema_gen.py +++ b/cwl_utils/inputs_schema_gen.py @@ -6,9 +6,11 @@ """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 @@ -17,6 +19,7 @@ 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 ( @@ -35,6 +38,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, @@ -253,7 +257,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( @@ -264,27 +272,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 = [] @@ -317,8 +325,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], @@ -326,7 +343,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. @@ -387,11 +404,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 @@ -416,11 +431,9 @@ def get_complex_schema_values(idx_iter: str) -> InputRecordSchema: ) workflow_schema_definitions_list.extend( - list( - map( - generate_definition_from_schema, - schema_def_requirement.types, - ) + map( + generate_definition_from_schema, + schema_def_requirement.types, ) ) @@ -433,7 +446,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), ) ) From 202802ed37ce4456a6a70e22fad19e1f119a0b10 Mon Sep 17 00:00:00 2001 From: GlassOfWhiskey Date: Sun, 21 Dec 2025 22:01:17 +0100 Subject: [PATCH 13/22] Using LoadContents in type alias --- cwl_utils/parser/__init__.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/cwl_utils/parser/__init__.py b/cwl_utils/parser/__init__.py index 3ff92077..df29b820 100644 --- a/cwl_utils/parser/__init__.py +++ b/cwl_utils/parser/__init__.py @@ -226,16 +226,8 @@ class NoType(ABC): 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 + cwl_v1_1.LoadContents + | cwl_v1_2.LoadContents ) """Type Union for a CWL v1.x LoadContents object.""" SchemaDefRequirement: TypeAlias = ( From a73b6a845e50a556cecdca8291aec67bbb87329a Mon Sep 17 00:00:00 2001 From: "Michael R. Crusoe" Date: Sun, 21 Dec 2025 16:27:52 +0100 Subject: [PATCH 14/22] WIP --- cwl_utils/cwl_v1_0_expression_refactor.py | 102 +------ cwl_utils/cwl_v1_1_expression_refactor.py | 102 +------ cwl_utils/cwl_v1_2_expression_refactor.py | 100 +------ cwl_utils/parser/__init__.py | 65 +++- cwl_utils/parser/cwl_v1_0_utils.py | 331 ++++++++++++++++++--- cwl_utils/parser/cwl_v1_1_utils.py | 332 ++++++++++++++++++--- cwl_utils/parser/cwl_v1_2_utils.py | 343 +++++++++++++++++++--- 7 files changed, 995 insertions(+), 380 deletions(-) diff --git a/cwl_utils/cwl_v1_0_expression_refactor.py b/cwl_utils/cwl_v1_0_expression_refactor.py index a3dd1002..4b1eeaf4 100755 --- a/cwl_utils/cwl_v1_0_expression_refactor.py +++ b/cwl_utils/cwl_v1_0_expression_refactor.py @@ -8,7 +8,7 @@ import uuid from collections.abc import MutableSequence, Sequence from contextlib import suppress -from typing import Any, Literal, TypeAlias, TypeVar, cast +from typing import Any, cast from ruamel import yaml from schema_salad.sourceline import SourceLine @@ -18,6 +18,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, @@ -57,91 +68,6 @@ def escape_expression_field(contents: str) -> str: return contents.replace("${", "$/{").replace("$(", "$/(") -BasicInputTypeSchemas: TypeAlias = ( - cwl.InputArraySchema - | cwl.InputEnumSchema - | cwl.InputRecordSchema - | str - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] -) -InputTypeSchemas: TypeAlias = ( - BasicInputTypeSchemas | Sequence[BasicInputTypeSchemas] | None -) -BasicCommandInputTypeSchemas: TypeAlias = ( - cwl.CommandInputArraySchema - | cwl.CommandInputEnumSchema - | cwl.CommandInputRecordSchema - | str - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] -) -CommandInputTypeSchemas: TypeAlias = ( - BasicCommandInputTypeSchemas | Sequence[BasicCommandInputTypeSchemas] | None -) -BasicOutputTypeSchemas: TypeAlias = ( - cwl.OutputArraySchema - | cwl.OutputEnumSchema - | cwl.OutputRecordSchema - | str - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] -) -OutputTypeSchemas: TypeAlias = ( - BasicOutputTypeSchemas | Sequence[BasicOutputTypeSchemas] | None -) -BasicCommandOutputTypeSchemas: TypeAlias = ( - cwl.CommandOutputArraySchema - | cwl.CommandOutputEnumSchema - | cwl.CommandOutputRecordSchema - | str - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] -) -CommandOutputTypeSchemas: TypeAlias = ( - BasicCommandOutputTypeSchemas | Sequence[BasicCommandOutputTypeSchemas] | None -) -AnyTypeSchema = TypeVar( - "AnyTypeSchema", bound=InputTypeSchemas | CommandOutputTypeSchemas -) - - def _clean_type_ids( cwltype: InputTypeSchemas | CommandOutputTypeSchemas, ) -> None: @@ -163,8 +89,6 @@ def _clean_type_ids( for field in cwltype.items.fields: field.name = field.name.split("/")[-1] 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] @@ -687,7 +611,7 @@ def get_input_for_id( """Determine the CommandInputParameter for the given input name.""" name = name.split("/")[-1] - for inp in cast(list[cwl.InputParameter], tool.inputs): + for inp in cast(list[cwl.CommandInputParameter], tool.inputs): if inp.id and inp.id.split("#")[-1].split("/")[-1] == name: return cwl.CommandInputParameter.fromDoc( inp.save(), inp.loadingOptions.baseuri, inp.loadingOptions diff --git a/cwl_utils/cwl_v1_1_expression_refactor.py b/cwl_utils/cwl_v1_1_expression_refactor.py index 4a5104e1..0e077ab9 100755 --- a/cwl_utils/cwl_v1_1_expression_refactor.py +++ b/cwl_utils/cwl_v1_1_expression_refactor.py @@ -8,7 +8,7 @@ import uuid from collections.abc import MutableSequence, Sequence from contextlib import suppress -from typing import Any, Literal, TypeAlias, TypeVar, cast +from typing import Any, cast from ruamel import yaml from schema_salad.sourceline import SourceLine @@ -18,6 +18,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, @@ -57,93 +68,6 @@ def escape_expression_field(contents: str) -> str: return contents.replace("${", "$/{").replace("$(", "$/(") -BasicInputTypeSchemas: TypeAlias = ( - cwl.InputArraySchema - | cwl.InputEnumSchema - | cwl.InputRecordSchema - | str - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - "stdin", - ] -) -InputTypeSchemas: TypeAlias = BasicInputTypeSchemas | Sequence[BasicInputTypeSchemas] -BasicCommandInputTypeSchemas: TypeAlias = ( - cwl.CommandInputArraySchema - | cwl.CommandInputEnumSchema - | cwl.CommandInputRecordSchema - | str - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - "stdin", - ] -) -CommandInputTypeSchemas: TypeAlias = ( - BasicCommandInputTypeSchemas | Sequence[BasicCommandInputTypeSchemas] -) -BasicOutputTypeSchemas: TypeAlias = ( - cwl.OutputArraySchema - | cwl.OutputEnumSchema - | cwl.OutputRecordSchema - | str - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - "stdout", - "stderr", - ] -) -OutputTypeSchemas: TypeAlias = BasicOutputTypeSchemas | Sequence[BasicOutputTypeSchemas] -BasicCommandOutputTypeSchemas: TypeAlias = ( - cwl.CommandOutputArraySchema - | cwl.CommandOutputEnumSchema - | cwl.CommandOutputRecordSchema - | str - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - "stdout", - "stderr", - ] -) -CommandOutputTypeSchemas: TypeAlias = ( - BasicCommandOutputTypeSchemas | Sequence[BasicCommandOutputTypeSchemas] -) -AnyTypeSchema = TypeVar( - "AnyTypeSchema", bound=InputTypeSchemas | CommandOutputTypeSchemas -) - - def _clean_type_ids( cwltype: InputTypeSchemas | CommandOutputTypeSchemas, ) -> None: @@ -165,8 +89,6 @@ def _clean_type_ids( for field in cwltype.items.fields: field.name = field.name.split("/")[-1] 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] diff --git a/cwl_utils/cwl_v1_2_expression_refactor.py b/cwl_utils/cwl_v1_2_expression_refactor.py index e66102bd..f4a5a195 100755 --- a/cwl_utils/cwl_v1_2_expression_refactor.py +++ b/cwl_utils/cwl_v1_2_expression_refactor.py @@ -8,7 +8,7 @@ import uuid from collections.abc import MutableSequence, Sequence from contextlib import suppress -from typing import Any, Literal, TypeAlias, TypeVar, cast +from typing import Any, cast from ruamel import yaml from schema_salad.sourceline import SourceLine @@ -18,6 +18,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, @@ -57,93 +68,6 @@ def escape_expression_field(contents: str) -> str: return contents.replace("${", "$/{").replace("$(", "$/(") -BasicInputTypeSchemas: TypeAlias = ( - cwl.InputArraySchema - | cwl.InputEnumSchema - | cwl.InputRecordSchema - | str - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - "stdin", - ] -) -InputTypeSchemas: TypeAlias = BasicInputTypeSchemas | Sequence[BasicInputTypeSchemas] -BasicCommandInputTypeSchemas: TypeAlias = ( - cwl.CommandInputArraySchema - | cwl.CommandInputEnumSchema - | cwl.CommandInputRecordSchema - | str - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - "stdin", - ] -) -CommandInputTypeSchemas: TypeAlias = ( - BasicCommandInputTypeSchemas | Sequence[BasicCommandInputTypeSchemas] -) -BasicOutputTypeSchemas: TypeAlias = ( - cwl.OutputArraySchema - | cwl.OutputEnumSchema - | cwl.OutputRecordSchema - | str - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - "stdout", - "stderr", - ] -) -OutputTypeSchemas: TypeAlias = BasicOutputTypeSchemas | Sequence[BasicOutputTypeSchemas] -BasicCommandOutputTypeSchemas: TypeAlias = ( - cwl.CommandOutputArraySchema - | cwl.CommandOutputEnumSchema - | cwl.CommandOutputRecordSchema - | str - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - "stdout", - "stderr", - ] -) -CommandOutputTypeSchemas: TypeAlias = ( - BasicCommandOutputTypeSchemas | Sequence[BasicCommandOutputTypeSchemas] -) -AnyTypeSchema = TypeVar( - "AnyTypeSchema", bound=InputTypeSchemas | CommandOutputTypeSchemas -) - - def _clean_type_ids( cwltype: InputTypeSchemas | CommandOutputTypeSchemas, ) -> None: diff --git a/cwl_utils/parser/__init__.py b/cwl_utils/parser/__init__.py index df29b820..70fc71f2 100644 --- a/cwl_utils/parser/__init__.py +++ b/cwl_utils/parser/__init__.py @@ -2,9 +2,9 @@ import os from abc import ABC -from collections.abc import MutableMapping, MutableSequence +from collections.abc import MutableMapping, MutableSequence, Sequence from pathlib import Path -from typing import Any, Optional, TypeAlias, cast +from typing import Any, Literal, Optional, TypeAlias, cast from urllib.parse import unquote_plus, urlparse from schema_salad.exceptions import ValidationException @@ -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,9 +68,34 @@ 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 ) +BasicOutputTypeSchemas: TypeAlias = ( + OutputArraySchema + | OutputEnumSchema + | OutputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + "stderr", + "stdout", + ] +) +OutputTypeSchemas: TypeAlias = BasicOutputTypeSchemas | Sequence[BasicOutputTypeSchemas] """Type union for a CWL v1.x OutputSchema object.""" Workflow: TypeAlias = cwl_v1_0.Workflow | cwl_v1_1.Workflow | cwl_v1_2.Workflow WorkflowTypes = (cwl_v1_0.Workflow, cwl_v1_1.Workflow, cwl_v1_2.Workflow) @@ -215,6 +250,27 @@ class NoType(ABC): cwl_v1_2.InputRecordSchema, ) """Type Union for a CWL v1.x RecordSchema object.""" + +BasicInputTypeSchemas: TypeAlias = ( + InputArraySchema + | InputEnumSchema + | InputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + "stdin", + ] +) +InputTypeSchemas: TypeAlias = BasicInputTypeSchemas | Sequence[BasicInputTypeSchemas] + 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,10 +281,7 @@ 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.LoadContents - | cwl_v1_2.LoadContents -) +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 diff --git a/cwl_utils/parser/cwl_v1_0_utils.py b/cwl_utils/parser/cwl_v1_0_utils.py index 9362d4ee..65d59b7b 100644 --- a/cwl_utils/parser/cwl_v1_0_utils.py +++ b/cwl_utils/parser/cwl_v1_0_utils.py @@ -5,7 +5,7 @@ from collections.abc import MutableMapping, MutableSequence, Sequence from io import StringIO from pathlib import Path -from typing import IO, Any, 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,214 @@ 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 _input_type_schema_to_cwl_v1_0_input_type_schema( + input_type: cwl_utils.parser.BasicInputTypeSchemas, + loading_options: cwl.LoadingOptions, +) -> BasicInputTypeSchemas: + if isinstance(input_type, cwl_utils.parser.InputArraySchemaTypes): + return cwl.InputArraySchema.fromDoc( + input_type.save(), + loading_options.baseuri, + loading_options, + ) + if isinstance(input_type, cwl_utils.parser.InputEnumSchemaTypes): + return cwl.InputEnumSchema.fromDoc( + input_type.save(), + loading_options.baseuri, + loading_options, + ) + if isinstance(input_type, cwl_utils.parser.InputRecordSchemaTypes): + return cwl.InputRecordSchema.fromDoc( + input_type.save(), + loading_options.baseuri, + loading_options, + ) + if isinstance(input_type, str): + return input_type + raise WorkflowException(f"Unexpected input type: {input_type}.") + + +def input_type_schema_to_cwl_v1_0_input_type_schema( + input_type: cwl_utils.parser.InputTypeSchemas, loading_options: cwl.LoadingOptions +) -> InputTypeSchemas: + if is_sequence(input_type): + return [ + _input_type_schema_to_cwl_v1_0_input_type_schema( + input_type_item, loading_options + ) + for input_type_item in input_type + ] + return _input_type_schema_to_cwl_v1_0_input_type_schema(input_type, loading_options) + + +def _output_type_schema_to_cwl_v1_0_output_type_schema( + output_type: cwl_utils.parser.BasicOutputTypeSchemas, + loading_options: cwl.LoadingOptions, +) -> BasicOutputTypeSchemas: + if isinstance(output_type, cwl_utils.parser.OutputArraySchemaTypes): + return cwl.OutputArraySchema.fromDoc( + output_type.save(), + loading_options.baseuri, + loading_options, + ) + if isinstance(output_type, cwl_utils.parser.OutputEnumSchemaTypes): + return cwl.OutputEnumSchema.fromDoc( + output_type.save(), + loading_options.baseuri, + loading_options, + ) + if isinstance(output_type, cwl_utils.parser.OutputRecordSchemaTypes): + return cwl.OutputRecordSchema.fromDoc( + output_type.save(), + loading_options.baseuri, + loading_options, + ) + if isinstance(output_type, str): + return output_type + raise WorkflowException(f"Unexpected output type: {output_type}.") + + +def output_type_schema_to_cwl_v1_0_output_type_schema( + output_type: cwl_utils.parser.OutputTypeSchemas, loading_options: cwl.LoadingOptions +) -> OutputTypeSchemas: + if is_sequence(output_type): + return [ + _output_type_schema_to_cwl_v1_0_output_type_schema( + output_type_item, loading_options + ) + for output_type_item in output_type + ] + return _output_type_schema_to_cwl_v1_0_output_type_schema( + output_type, loading_options + ) + + +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 @@ -367,7 +576,7 @@ def merge_flatten_type(src: Any) -> Any: def type_for_step_input( step: cwl.WorkflowStep, in_: cwl.WorkflowStepInput, -) -> Any: +) -> InputTypeSchemas: """Determine the type for the given step input.""" if in_.valueFrom is not None: return "Any" @@ -376,10 +585,15 @@ def type_for_step_input( if step_run and step_run.inputs: for step_input in step_run.inputs: if step_input.id.split("#")[-1] == in_.id.split("#")[-1]: - input_type = step_input.type_ + if step_input.type_ is not None: + step_input_type = input_type_schema_to_cwl_v1_0_input_type_schema( + step_input.type_, step.loadingOptions + ) + else: + step_input_type = "null" 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 + return cwl.InputArraySchema(items=step_input_type, type_="array") + return step_input_type return "Any" @@ -391,21 +605,31 @@ def type_for_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: + for output in step_run.outputs: if ( - step_output.id.split("#")[-1].split("/")[-1] + output.id.split("#")[-1].split("/")[-1] == sourcename.split("#")[-1].split("/")[-1] ): - output_type = step_output.type_ + output_type = output.type_ if step.scatter is not None: + if output_type is not None: + output_type_type = ( + output_type_schema_to_cwl_v1_0_output_type_schema( + output_type, step.loadingOptions + ) + ) + else: + output_type_type = "null" if step.scatterMethod == "nested_crossproduct": for _ in range(len(aslist(step.scatter))): - output_type = cwl.ArraySchema( - items=output_type, type_="array" + output_type_type = cwl.OutputArraySchema( + items=output_type_type, type_="array" ) + return output_type_type else: - output_type = cwl.ArraySchema(items=output_type, type_="array") - return output_type + return cwl.OutputArraySchema( + items=output_type_type, type_="array" + ) raise ValidationException( "param {} not found in {}.".format( sourcename, @@ -415,35 +639,52 @@ def type_for_step_output( def type_for_source( - process: ( - cwl.CommandLineTool | cwl.Workflow | cwl.ExpressionTool | cwl.ProcessGenerator - ), + 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: @@ -452,25 +693,45 @@ 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 | cwl.ProcessGenerator - ), + process: cwl.Process, sourcenames: str | Sequence[str], parent: cwl.Workflow | None = None, scatter_context: list[tuple[int, str] | None] | None = None, diff --git a/cwl_utils/parser/cwl_v1_1_utils.py b/cwl_utils/parser/cwl_v1_1_utils.py index 44633281..61b3d6b6 100644 --- a/cwl_utils/parser/cwl_v1_1_utils.py +++ b/cwl_utils/parser/cwl_v1_1_utils.py @@ -5,7 +5,7 @@ from collections.abc import MutableMapping, MutableSequence, Sequence from io import StringIO from pathlib import Path -from typing import IO, Any, 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,220 @@ 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", + "stdin", + ] +) +InputTypeSchemas: TypeAlias = BasicInputTypeSchemas | Sequence[BasicInputTypeSchemas] +BasicCommandInputTypeSchemas: TypeAlias = ( + cwl.CommandInputArraySchema + | cwl.CommandInputEnumSchema + | cwl.CommandInputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + "stdin", + ] +) +CommandInputTypeSchemas: TypeAlias = ( + BasicCommandInputTypeSchemas | Sequence[BasicCommandInputTypeSchemas] +) +BasicOutputTypeSchemas: TypeAlias = ( + cwl.OutputArraySchema + | cwl.OutputEnumSchema + | cwl.OutputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + "stdout", + "stderr", + ] +) +OutputTypeSchemas: TypeAlias = BasicOutputTypeSchemas | Sequence[BasicOutputTypeSchemas] +BasicCommandOutputTypeSchemas: TypeAlias = ( + cwl.CommandOutputArraySchema + | cwl.CommandOutputEnumSchema + | cwl.CommandOutputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + "stdout", + "stderr", + ] +) +CommandOutputTypeSchemas: TypeAlias = ( + BasicCommandOutputTypeSchemas | Sequence[BasicCommandOutputTypeSchemas] +) +AnyTypeSchema = TypeVar( + "AnyTypeSchema", bound=InputTypeSchemas | CommandOutputTypeSchemas +) + + +def _input_type_schema_to_cwl_v1_1_input_type_schema( + input_type: cwl_utils.parser.BasicInputTypeSchemas, + loading_options: cwl.LoadingOptions, +) -> BasicInputTypeSchemas: + if isinstance(input_type, cwl_utils.parser.InputArraySchemaTypes): + return cwl.InputArraySchema.fromDoc( + input_type.save(), + loading_options.baseuri, + loading_options, + ) + if isinstance(input_type, cwl_utils.parser.InputEnumSchemaTypes): + return cwl.InputEnumSchema.fromDoc( + input_type.save(), + loading_options.baseuri, + loading_options, + ) + if isinstance(input_type, cwl_utils.parser.InputRecordSchemaTypes): + return cwl.InputRecordSchema.fromDoc( + input_type.save(), + loading_options.baseuri, + loading_options, + ) + if isinstance(input_type, str): + return input_type + raise WorkflowException(f"Unexpected input type: {input_type}.") + + +def input_type_schema_to_cwl_v1_1_input_type_schema( + input_type: cwl_utils.parser.InputTypeSchemas, loading_options: cwl.LoadingOptions +) -> InputTypeSchemas: + if is_sequence(input_type): + return [ + _input_type_schema_to_cwl_v1_1_input_type_schema( + input_type_item, loading_options + ) + for input_type_item in input_type + ] + return _input_type_schema_to_cwl_v1_1_input_type_schema(input_type, loading_options) + + +def _output_type_schema_to_cwl_v1_1_output_type_schema( + output_type: cwl_utils.parser.BasicOutputTypeSchemas, + loading_options: cwl.LoadingOptions, +) -> BasicOutputTypeSchemas: + if isinstance(output_type, cwl_utils.parser.OutputArraySchemaTypes): + return cwl.OutputArraySchema.fromDoc( + output_type.save(), + loading_options.baseuri, + loading_options, + ) + if isinstance(output_type, cwl_utils.parser.OutputEnumSchemaTypes): + return cwl.OutputEnumSchema.fromDoc( + output_type.save(), + loading_options.baseuri, + loading_options, + ) + if isinstance(output_type, cwl_utils.parser.OutputRecordSchemaTypes): + return cwl.OutputRecordSchema.fromDoc( + output_type.save(), + loading_options.baseuri, + loading_options, + ) + if isinstance(output_type, str): + return output_type + raise WorkflowException(f"Unexpected output type: {output_type}.") + + +def output_type_schema_to_cwl_v1_1_output_type_schema( + output_type: cwl_utils.parser.OutputTypeSchemas, loading_options: cwl.LoadingOptions +) -> OutputTypeSchemas: + if is_sequence(output_type): + return [ + _output_type_schema_to_cwl_v1_1_output_type_schema( + output_type_item, loading_options + ) + for output_type_item in output_type + ] + return _output_type_schema_to_cwl_v1_1_output_type_schema( + output_type, loading_options + ) + + +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 @@ -382,7 +597,7 @@ def merge_flatten_type(src: Any) -> Any: def type_for_step_input( step: cwl.WorkflowStep, in_: cwl.WorkflowStepInput, -) -> Any: +) -> InputTypeSchemas: """Determine the type for the given step input.""" if in_.valueFrom is not None: return "Any" @@ -391,10 +606,15 @@ def type_for_step_input( if step_run and step_run.inputs: for step_input in step_run.inputs: if step_input.id.split("#")[-1] == in_.id.split("#")[-1]: - input_type = step_input.type_ + if step_input.type_ is not None: + step_input_type = input_type_schema_to_cwl_v1_1_input_type_schema( + step_input.type_, step.loadingOptions + ) + else: + step_input_type = "null" 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 + return cwl.InputArraySchema(items=step_input_type, type_="array") + return step_input_type return "Any" @@ -413,14 +633,24 @@ def type_for_step_output( ): output_type = output.type_ if step.scatter is not None: + if output_type is not None: + output_type_type = ( + output_type_schema_to_cwl_v1_1_output_type_schema( + output_type, step.loadingOptions + ) + ) + else: + output_type_type = "null" if step.scatterMethod == "nested_crossproduct": for _ in range(len(aslist(step.scatter))): - output_type = cwl.ArraySchema( - items=output_type, type_="array" + output_type_type = cwl.OutputArraySchema( + items=output_type_type, type_="array" ) + return output_type_type else: - output_type = cwl.ArraySchema(items=output_type, type_="array") - return output_type + return cwl.OutputArraySchema( + items=output_type_type, type_="array" + ) raise ValidationException( "param {} not found in {}.".format( sourcename, @@ -430,35 +660,52 @@ def type_for_step_output( def type_for_source( - process: ( - cwl.CommandLineTool | cwl.Workflow | cwl.ExpressionTool | cwl.ProcessGenerator - ), + 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: @@ -467,26 +714,45 @@ 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 | cwl.ProcessGenerator - ), + process: cwl.Process, sourcenames: str | Sequence[str], parent: cwl.Workflow | None = None, scatter_context: list[tuple[int, str] | None] | None = None, diff --git a/cwl_utils/parser/cwl_v1_2_utils.py b/cwl_utils/parser/cwl_v1_2_utils.py index 5afbfdb7..343e5191 100644 --- a/cwl_utils/parser/cwl_v1_2_utils.py +++ b/cwl_utils/parser/cwl_v1_2_utils.py @@ -5,7 +5,7 @@ from collections.abc import Mapping, MutableMapping, MutableSequence, Sequence from io import StringIO from pathlib import Path -from typing import IO, Any, 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,220 @@ 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", + "stdin", + ] +) +InputTypeSchemas: TypeAlias = BasicInputTypeSchemas | Sequence[BasicInputTypeSchemas] +BasicCommandInputTypeSchemas: TypeAlias = ( + cwl.CommandInputArraySchema + | cwl.CommandInputEnumSchema + | cwl.CommandInputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + "stdin", + ] +) +CommandInputTypeSchemas: TypeAlias = ( + BasicCommandInputTypeSchemas | Sequence[BasicCommandInputTypeSchemas] +) +BasicOutputTypeSchemas: TypeAlias = ( + cwl.OutputArraySchema + | cwl.OutputEnumSchema + | cwl.OutputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + "stdout", + "stderr", + ] +) +OutputTypeSchemas: TypeAlias = BasicOutputTypeSchemas | Sequence[BasicOutputTypeSchemas] +BasicCommandOutputTypeSchemas: TypeAlias = ( + cwl.CommandOutputArraySchema + | cwl.CommandOutputEnumSchema + | cwl.CommandOutputRecordSchema + | str + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + "stdout", + "stderr", + ] +) +CommandOutputTypeSchemas: TypeAlias = ( + BasicCommandOutputTypeSchemas | Sequence[BasicCommandOutputTypeSchemas] +) +AnyTypeSchema = TypeVar( + "AnyTypeSchema", bound=InputTypeSchemas | CommandOutputTypeSchemas +) + + +def _input_type_schema_to_cwl_v1_2_input_type_schema( + input_type: cwl_utils.parser.BasicInputTypeSchemas, + loading_options: cwl.LoadingOptions, +) -> BasicInputTypeSchemas: + if isinstance(input_type, cwl_utils.parser.InputArraySchemaTypes): + return cwl.InputArraySchema.fromDoc( + input_type.save(), + loading_options.baseuri, + loading_options, + ) + if isinstance(input_type, cwl_utils.parser.InputEnumSchemaTypes): + return cwl.InputEnumSchema.fromDoc( + input_type.save(), + loading_options.baseuri, + loading_options, + ) + if isinstance(input_type, cwl_utils.parser.InputRecordSchemaTypes): + return cwl.InputRecordSchema.fromDoc( + input_type.save(), + loading_options.baseuri, + loading_options, + ) + if isinstance(input_type, str): + return input_type + raise WorkflowException(f"Unexpected input type: {input_type}.") + + +def input_type_schema_to_cwl_v1_2_input_type_schema( + input_type: cwl_utils.parser.InputTypeSchemas, loading_options: cwl.LoadingOptions +) -> InputTypeSchemas: + if is_sequence(input_type): + return [ + _input_type_schema_to_cwl_v1_2_input_type_schema( + input_type_item, loading_options + ) + for input_type_item in input_type + ] + return _input_type_schema_to_cwl_v1_2_input_type_schema(input_type, loading_options) + + +def _output_type_schema_to_cwl_v1_2_output_type_schema( + output_type: cwl_utils.parser.BasicOutputTypeSchemas, + loading_options: cwl.LoadingOptions, +) -> BasicOutputTypeSchemas: + if isinstance(output_type, cwl_utils.parser.OutputArraySchemaTypes): + return cwl.OutputArraySchema.fromDoc( + output_type.save(), + loading_options.baseuri, + loading_options, + ) + if isinstance(output_type, cwl_utils.parser.OutputEnumSchemaTypes): + return cwl.OutputEnumSchema.fromDoc( + output_type.save(), + loading_options.baseuri, + loading_options, + ) + if isinstance(output_type, cwl_utils.parser.OutputRecordSchemaTypes): + return cwl.OutputRecordSchema.fromDoc( + output_type.save(), + loading_options.baseuri, + loading_options, + ) + if isinstance(output_type, str): + return output_type + raise WorkflowException(f"Unexpected output type: {output_type}.") + + +def output_type_schema_to_cwl_v1_2_output_type_schema( + output_type: cwl_utils.parser.OutputTypeSchemas, loading_options: cwl.LoadingOptions +) -> OutputTypeSchemas: + if is_sequence(output_type): + return [ + _output_type_schema_to_cwl_v1_2_output_type_schema( + output_type_item, loading_options + ) + for output_type_item in output_type + ] + return _output_type_schema_to_cwl_v1_2_output_type_schema( + output_type, loading_options + ) + + +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 @@ -506,7 +721,7 @@ def merge_flatten_type(src: Any) -> Any: def type_for_step_input( step: cwl.WorkflowStep, in_: cwl.WorkflowStepInput, -) -> Any: +) -> InputTypeSchemas: """Determine the type for the given step input.""" if in_.valueFrom is not None: return "Any" @@ -515,10 +730,15 @@ def type_for_step_input( if step_run and step_run.inputs: for step_input in step_run.inputs: if step_input.id.split("#")[-1] == in_.id.split("#")[-1]: - input_type = step_input.type_ + if step_input.type_ is not None: + step_input_type = input_type_schema_to_cwl_v1_2_input_type_schema( + step_input.type_, step.loadingOptions + ) + else: + step_input_type = "null" 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 + return cwl.InputArraySchema(items=step_input_type, type_="array") + return step_input_type return "Any" @@ -537,14 +757,24 @@ def type_for_step_output( ): output_type = output.type_ if step.scatter is not None: + if output_type is not None: + output_type_type = ( + output_type_schema_to_cwl_v1_2_output_type_schema( + output_type, step.loadingOptions + ) + ) + else: + output_type_type = "null" if step.scatterMethod == "nested_crossproduct": for _ in range(len(aslist(step.scatter))): - output_type = cwl.ArraySchema( - items=output_type, type_="array" + output_type_type = cwl.OutputArraySchema( + items=output_type_type, type_="array" ) + return output_type_type else: - output_type = cwl.ArraySchema(items=output_type, type_="array") - return output_type + return cwl.OutputArraySchema( + items=output_type_type, type_="array" + ) raise ValidationException( "param {} not found in {}.".format( sourcename, @@ -554,44 +784,57 @@ def type_for_step_output( def type_for_source( - process: ( - cwl.CommandLineTool - | cwl.Workflow - | cwl.ExpressionTool - | cwl.ProcessGenerator - | cwl.Operation - ), + 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: @@ -600,29 +843,49 @@ 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 | cwl.ProcessGenerator - ), + process: cwl.Process, sourcenames: str | Sequence[str], parent: cwl.Workflow | None = None, scatter_context: list[tuple[int, str] | None] | None = None, @@ -651,6 +914,8 @@ def param_for_source_id( cwl.CommandInputParameter | cwl.CommandOutputParameter | cwl.ExpressionToolOutputParameter + | cwl.OperationInputParameter + | cwl.OperationOutputParameter | cwl.WorkflowInputParameter | cwl.WorkflowOutputParameter ] = [] From a2853a0ad01a956ad51e36a4041ba63886eb81d9 Mon Sep 17 00:00:00 2001 From: GlassOfWhiskey Date: Fri, 26 Dec 2025 10:47:23 +0100 Subject: [PATCH 15/22] Make `param_for_source_id` return any CWL parameter --- cwl_utils/parser/__init__.py | 4 ++ cwl_utils/parser/cwl_v1_0_utils.py | 33 +++++++++------ cwl_utils/parser/cwl_v1_1_utils.py | 36 +++++++++------- cwl_utils/parser/cwl_v1_2_utils.py | 42 +++++++++---------- cwl_utils/parser/utils.py | 67 ++++++++++-------------------- 5 files changed, 90 insertions(+), 92 deletions(-) diff --git a/cwl_utils/parser/__init__.py b/cwl_utils/parser/__init__.py index 70fc71f2..587a70c7 100644 --- a/cwl_utils/parser/__init__.py +++ b/cwl_utils/parser/__init__.py @@ -132,6 +132,10 @@ class NoType(ABC): | cwl_v1_2.WorkflowStepOutput ) """Type union for a CWL v1.x WorkflowStepOutput object.""" +OperationInputParameter: TypeAlias = cwl_v1_2.OperationInputParameter +"""Type union for a CWL v1.x WorkflowInputParameter object.""" +OperationOutputParameter: TypeAlias = cwl_v1_2.OperationOutputParameter +"""Type union for a CWL v1.x WorkflowOutputParameter object.""" CommandLineTool: TypeAlias = ( cwl_v1_0.CommandLineTool | cwl_v1_1.CommandLineTool | cwl_v1_2.CommandLineTool ) diff --git a/cwl_utils/parser/cwl_v1_0_utils.py b/cwl_utils/parser/cwl_v1_0_utils.py index 65d59b7b..d4991d4f 100644 --- a/cwl_utils/parser/cwl_v1_0_utils.py +++ b/cwl_utils/parser/cwl_v1_0_utils.py @@ -736,25 +736,34 @@ def param_for_source_id( parent: cwl.Workflow | None = None, scatter_context: list[tuple[int, str] | None] | None = None, ) -> ( - cwl.CommandOutputParameter - | cwl.ExpressionToolOutputParameter - | cwl.InputParameter - | cwl.WorkflowOutputParameter + 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.CommandOutputParameter - | cwl.ExpressionToolOutputParameter - | cwl.InputParameter - | cwl.WorkflowOutputParameter + 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.CommandOutputParameter - | cwl.ExpressionToolOutputParameter - | cwl.InputParameter - | cwl.WorkflowOutputParameter + 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): diff --git a/cwl_utils/parser/cwl_v1_1_utils.py b/cwl_utils/parser/cwl_v1_1_utils.py index 61b3d6b6..42cad4dc 100644 --- a/cwl_utils/parser/cwl_v1_1_utils.py +++ b/cwl_utils/parser/cwl_v1_1_utils.py @@ -757,28 +757,34 @@ def param_for_source_id( parent: cwl.Workflow | None = None, scatter_context: list[tuple[int, str] | None] | None = None, ) -> ( - cwl.CommandInputParameter - | cwl.CommandOutputParameter - | cwl.ExpressionToolOutputParameter - | cwl.WorkflowInputParameter - | cwl.WorkflowOutputParameter + 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.ExpressionToolOutputParameter - | cwl.WorkflowInputParameter - | cwl.WorkflowOutputParameter + 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.ExpressionToolOutputParameter - | cwl.WorkflowInputParameter - | cwl.WorkflowOutputParameter + 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): diff --git a/cwl_utils/parser/cwl_v1_2_utils.py b/cwl_utils/parser/cwl_v1_2_utils.py index 343e5191..d6003ca3 100644 --- a/cwl_utils/parser/cwl_v1_2_utils.py +++ b/cwl_utils/parser/cwl_v1_2_utils.py @@ -890,34 +890,34 @@ def param_for_source_id( parent: cwl.Workflow | None = None, scatter_context: list[tuple[int, str] | None] | None = None, ) -> ( - cwl.CommandInputParameter - | cwl.CommandOutputParameter - | cwl.ExpressionToolOutputParameter - | cwl.OperationInputParameter - | cwl.OperationOutputParameter - | cwl.WorkflowInputParameter - | cwl.WorkflowOutputParameter + 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.ExpressionToolOutputParameter - | cwl.OperationInputParameter - | cwl.OperationOutputParameter - | cwl.WorkflowInputParameter - | cwl.WorkflowOutputParameter + 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.ExpressionToolOutputParameter - | cwl.OperationInputParameter - | cwl.OperationOutputParameter - | cwl.WorkflowInputParameter - | cwl.WorkflowOutputParameter + 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): diff --git a/cwl_utils/parser/utils.py b/cwl_utils/parser/utils.py index d47c8a68..52fbb696 100644 --- a/cwl_utils/parser/utils.py +++ b/cwl_utils/parser/utils.py @@ -27,6 +27,13 @@ cwl_v1_2, cwl_v1_2_utils, load_document_by_uri, + CommandInputParameter, + CommandOutputParameter, + ExpressionToolOutputParameter, + OperationInputParameter, + OperationOutputParameter, + WorkflowInputParameter, + WorkflowOutputParameter, ) _logger = logging.getLogger("cwl_utils") @@ -431,50 +438,22 @@ def param_for_source_id( parent: Workflow | None = None, scatter_context: list[tuple[int, str] | None] | None = None, ) -> ( - ( - MutableSequence[ - cwl_v1_0.CommandOutputParameter - | cwl_v1_0.ExpressionToolOutputParameter - | cwl_v1_0.InputParameter - | cwl_v1_0.WorkflowOutputParameter - ] - | cwl_v1_0.CommandOutputParameter - | cwl_v1_0.ExpressionToolOutputParameter - | cwl_v1_0.InputParameter - | cwl_v1_0.WorkflowOutputParameter - ) - | ( - MutableSequence[ - cwl_v1_1.CommandInputParameter - | cwl_v1_1.CommandOutputParameter - | cwl_v1_1.ExpressionToolOutputParameter - | cwl_v1_1.WorkflowInputParameter - | cwl_v1_1.WorkflowOutputParameter - ] - | cwl_v1_1.CommandInputParameter - | cwl_v1_1.CommandOutputParameter - | cwl_v1_1.ExpressionToolOutputParameter - | cwl_v1_1.WorkflowInputParameter - | cwl_v1_1.WorkflowOutputParameter - ) - | ( - MutableSequence[ - cwl_v1_2.CommandInputParameter - | cwl_v1_2.CommandOutputParameter - | cwl_v1_2.ExpressionToolOutputParameter - | cwl_v1_2.OperationInputParameter - | cwl_v1_2.OperationOutputParameter - | cwl_v1_2.WorkflowInputParameter - | cwl_v1_2.WorkflowOutputParameter - ] - | cwl_v1_2.CommandInputParameter - | cwl_v1_2.CommandOutputParameter - | cwl_v1_2.ExpressionToolOutputParameter - | cwl_v1_2.OperationInputParameter - | cwl_v1_2.OperationOutputParameter - | cwl_v1_2.WorkflowInputParameter - | cwl_v1_2.WorkflowOutputParameter - ) + CommandInputParameter + | CommandOutputParameter + | ExpressionToolOutputParameter + | OperationInputParameter + | OperationOutputParameter + | WorkflowInputParameter + | WorkflowOutputParameter + | MutableSequence[ + CommandInputParameter + | CommandOutputParameter + | ExpressionToolOutputParameter + | OperationInputParameter + | OperationOutputParameter + | WorkflowInputParameter + | WorkflowOutputParameter + ] ): match process.cwlVersion: case "v1.0": From ac5ef6110f6a141d031c63dfc9a62bd18da8fa16 Mon Sep 17 00:00:00 2001 From: GlassOfWhiskey Date: Fri, 26 Dec 2025 17:29:02 +0100 Subject: [PATCH 16/22] Regenerate prsers with fixed CWL versions --- cwl_utils/parser/__init__.py | 50 +------- cwl_utils/parser/cwl_v1_0.py | 60 ++------- cwl_utils/parser/cwl_v1_0_utils.py | 194 ++++++++--------------------- cwl_utils/parser/cwl_v1_1.py | 66 ++-------- cwl_utils/parser/cwl_v1_1_utils.py | 193 +++++++++------------------- cwl_utils/parser/cwl_v1_2.py | 88 ++----------- cwl_utils/parser/cwl_v1_2_utils.py | 193 +++++++++------------------- cwl_utils/parser/utils.py | 153 +++++++++++++++++------ 8 files changed, 326 insertions(+), 671 deletions(-) diff --git a/cwl_utils/parser/__init__.py b/cwl_utils/parser/__init__.py index 587a70c7..be8c41ef 100644 --- a/cwl_utils/parser/__init__.py +++ b/cwl_utils/parser/__init__.py @@ -2,9 +2,9 @@ import os from abc import ABC -from collections.abc import MutableMapping, MutableSequence, Sequence +from collections.abc import MutableMapping, MutableSequence from pathlib import Path -from typing import Any, Literal, Optional, TypeAlias, cast +from typing import Any, Optional, TypeAlias, cast from urllib.parse import unquote_plus, urlparse from schema_salad.exceptions import ValidationException @@ -76,26 +76,6 @@ class NoType(ABC): OutputSchema: TypeAlias = ( cwl_v1_0.OutputSchema | cwl_v1_1.OutputSchema | cwl_v1_2.OutputSchema ) -BasicOutputTypeSchemas: TypeAlias = ( - OutputArraySchema - | OutputEnumSchema - | OutputRecordSchema - | str - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - "stderr", - "stdout", - ] -) -OutputTypeSchemas: TypeAlias = BasicOutputTypeSchemas | Sequence[BasicOutputTypeSchemas] """Type union for a CWL v1.x OutputSchema object.""" Workflow: TypeAlias = cwl_v1_0.Workflow | cwl_v1_1.Workflow | cwl_v1_2.Workflow WorkflowTypes = (cwl_v1_0.Workflow, cwl_v1_1.Workflow, cwl_v1_2.Workflow) @@ -132,10 +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 WorkflowInputParameter object.""" +"""Type union for a CWL v1.x OperationInputParameter object.""" OperationOutputParameter: TypeAlias = cwl_v1_2.OperationOutputParameter -"""Type union for a CWL v1.x WorkflowOutputParameter object.""" +"""Type union for a CWL v1.x OperationOutputParameter object.""" CommandLineTool: TypeAlias = ( cwl_v1_0.CommandLineTool | cwl_v1_1.CommandLineTool | cwl_v1_2.CommandLineTool ) @@ -255,26 +237,6 @@ class NoType(ABC): ) """Type Union for a CWL v1.x RecordSchema object.""" -BasicInputTypeSchemas: TypeAlias = ( - InputArraySchema - | InputEnumSchema - | InputRecordSchema - | str - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - "stdin", - ] -) -InputTypeSchemas: TypeAlias = BasicInputTypeSchemas | Sequence[BasicInputTypeSchemas] - 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 = ( diff --git a/cwl_utils/parser/cwl_v1_0.py b/cwl_utils/parser/cwl_v1_0.py index 9f1ee3e5..6a6e814b 100644 --- a/cwl_utils/parser/cwl_v1_0.py +++ b/cwl_utils/parser/cwl_v1_0.py @@ -8315,7 +8315,7 @@ class Process(Saveable, metaclass=ABCMeta): 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["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"] | None + cwlVersion: Literal["v1.0"] | None class InlineJavascriptRequirement(ProcessRequirement): @@ -14691,7 +14691,7 @@ def __init__( 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["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"] | None = None, + cwlVersion: Literal["v1.0"] | None = None, baseCommand: None | Sequence[str] | str = None, arguments: None | Sequence[CommandLineBinding | str] = None, stdin: None | str = None, @@ -14718,7 +14718,7 @@ def __init__( 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["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"] | None = cwlVersion + 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 @@ -18260,7 +18260,7 @@ def __init__( 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["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"] | None = None, + cwlVersion: Literal["v1.0"] | None = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -18279,7 +18279,7 @@ def __init__( 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["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"] | None = cwlVersion + self.cwlVersion: Literal["v1.0"] | None = cwlVersion self.class_: Final[str] = "ExpressionTool" self.expression: str = expression @@ -20986,7 +20986,7 @@ def __init__( 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["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"] | None = None, + cwlVersion: Literal["v1.0"] | None = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -21005,7 +21005,7 @@ def __init__( 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["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"] | None = cwlVersion + self.cwlVersion: Literal["v1.0"] | None = cwlVersion self.class_: Final[str] = "Workflow" self.steps: Sequence[WorkflowStep] = steps @@ -23201,7 +23201,7 @@ def __init__( 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["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"] | None = None, + cwlVersion: Literal["v1.0"] | None = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -23220,7 +23220,7 @@ def __init__( 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["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"] | None = cwlVersion + self.cwlVersion: Literal["v1.0"] | None = cwlVersion self.class_: Final[str] = "ProcessGenerator" self.run: CommandLineTool | ExpressionTool | ProcessGenerator | Workflow | str = run @@ -24054,16 +24054,6 @@ def __init__( "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", @@ -24082,7 +24072,6 @@ def __init__( "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.update({ "https://w3id.org/cwl/salad#Any": "Any", @@ -24176,16 +24165,6 @@ def __init__( "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", @@ -24204,7 +24183,6 @@ def __init__( "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: Final = _PrimitiveLoader(str) @@ -24288,25 +24266,9 @@ def __init__( union_of_None_type_or_CWLObjectTypeLoader, "CWLInputFile", "@list", True ) CWLInputFileLoader: Final = map_of_union_of_None_type_or_CWLObjectTypeLoader -CWLVersionLoader: Final = _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", -) +CWLVersionLoader: Final = _EnumLoader(("v1.0",), "CWLVersion") """ -Version symbols for published CWL document versions. +Current version symbol for CWL documents. """ ExpressionLoader: Final = _ExpressionLoader(str) InputRecordFieldLoader: Final = _RecordLoader(InputRecordField, None, None) diff --git a/cwl_utils/parser/cwl_v1_0_utils.py b/cwl_utils/parser/cwl_v1_0_utils.py index d4991d4f..38e3e320 100644 --- a/cwl_utils/parser/cwl_v1_0_utils.py +++ b/cwl_utils/parser/cwl_v1_0_utils.py @@ -106,88 +106,6 @@ ) -def _input_type_schema_to_cwl_v1_0_input_type_schema( - input_type: cwl_utils.parser.BasicInputTypeSchemas, - loading_options: cwl.LoadingOptions, -) -> BasicInputTypeSchemas: - if isinstance(input_type, cwl_utils.parser.InputArraySchemaTypes): - return cwl.InputArraySchema.fromDoc( - input_type.save(), - loading_options.baseuri, - loading_options, - ) - if isinstance(input_type, cwl_utils.parser.InputEnumSchemaTypes): - return cwl.InputEnumSchema.fromDoc( - input_type.save(), - loading_options.baseuri, - loading_options, - ) - if isinstance(input_type, cwl_utils.parser.InputRecordSchemaTypes): - return cwl.InputRecordSchema.fromDoc( - input_type.save(), - loading_options.baseuri, - loading_options, - ) - if isinstance(input_type, str): - return input_type - raise WorkflowException(f"Unexpected input type: {input_type}.") - - -def input_type_schema_to_cwl_v1_0_input_type_schema( - input_type: cwl_utils.parser.InputTypeSchemas, loading_options: cwl.LoadingOptions -) -> InputTypeSchemas: - if is_sequence(input_type): - return [ - _input_type_schema_to_cwl_v1_0_input_type_schema( - input_type_item, loading_options - ) - for input_type_item in input_type - ] - return _input_type_schema_to_cwl_v1_0_input_type_schema(input_type, loading_options) - - -def _output_type_schema_to_cwl_v1_0_output_type_schema( - output_type: cwl_utils.parser.BasicOutputTypeSchemas, - loading_options: cwl.LoadingOptions, -) -> BasicOutputTypeSchemas: - if isinstance(output_type, cwl_utils.parser.OutputArraySchemaTypes): - return cwl.OutputArraySchema.fromDoc( - output_type.save(), - loading_options.baseuri, - loading_options, - ) - if isinstance(output_type, cwl_utils.parser.OutputEnumSchemaTypes): - return cwl.OutputEnumSchema.fromDoc( - output_type.save(), - loading_options.baseuri, - loading_options, - ) - if isinstance(output_type, cwl_utils.parser.OutputRecordSchemaTypes): - return cwl.OutputRecordSchema.fromDoc( - output_type.save(), - loading_options.baseuri, - loading_options, - ) - if isinstance(output_type, str): - return output_type - raise WorkflowException(f"Unexpected output type: {output_type}.") - - -def output_type_schema_to_cwl_v1_0_output_type_schema( - output_type: cwl_utils.parser.OutputTypeSchemas, loading_options: cwl.LoadingOptions -) -> OutputTypeSchemas: - if is_sequence(output_type): - return [ - _output_type_schema_to_cwl_v1_0_output_type_schema( - output_type_item, loading_options - ) - for output_type_item in output_type - ] - return _output_type_schema_to_cwl_v1_0_output_type_schema( - output_type, loading_options - ) - - def _in_output_type_schema_to_output_type_schema( schema_type: BasicInputTypeSchemas | BasicOutputTypeSchemas, loading_options: cwl.LoadingOptions, @@ -573,63 +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, -) -> InputTypeSchemas: +) -> 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 step_input.id.split("#")[-1] == in_.id.split("#")[-1]: - if step_input.type_ is not None: - step_input_type = input_type_schema_to_cwl_v1_0_input_type_schema( - step_input.type_, step.loadingOptions - ) - else: - step_input_type = "null" - if step.scatter is not None and in_.id in aslist(step.scatter): - return cwl.InputArraySchema(items=step_input_type, type_="array") - return step_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 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 output_type is not None: - output_type_type = ( - output_type_schema_to_cwl_v1_0_output_type_schema( - output_type, step.loadingOptions - ) - ) - else: - output_type_type = "null" - if step.scatterMethod == "nested_crossproduct": - for _ in range(len(aslist(step.scatter))): - output_type_type = cwl.OutputArraySchema( - items=output_type_type, type_="array" - ) - return output_type_type - else: - return cwl.OutputArraySchema( - items=output_type_type, type_="array" + 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, @@ -804,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 f75e9657..f229e0b0 100644 --- a/cwl_utils/parser/cwl_v1_1.py +++ b/cwl_utils/parser/cwl_v1_1.py @@ -8099,7 +8099,7 @@ class Process(Identified, Labeled, Documented, metaclass=ABCMeta): 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["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"] | None + cwlVersion: Literal["v1.1"] | None class InlineJavascriptRequirement(ProcessRequirement): @@ -16031,7 +16031,7 @@ def __init__( 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["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"] | None = None, + cwlVersion: Literal["v1.1"] | None = None, baseCommand: None | Sequence[str] | str = None, arguments: None | Sequence[CommandLineBinding | str] = None, stdin: None | str = None, @@ -16058,7 +16058,7 @@ def __init__( 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["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"] | None = cwlVersion + 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 @@ -21086,7 +21086,7 @@ def __init__( 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["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"] | None = None, + cwlVersion: Literal["v1.1"] | None = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -21105,7 +21105,7 @@ def __init__( 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["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"] | None = cwlVersion + self.cwlVersion: Literal["v1.1"] | None = cwlVersion self.class_: Final[str] = "ExpressionTool" self.expression: str = expression @@ -23953,7 +23953,7 @@ def __init__( 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["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"] | None = None, + cwlVersion: Literal["v1.1"] | None = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -23972,7 +23972,7 @@ def __init__( 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["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"] | None = cwlVersion + self.cwlVersion: Literal["v1.1"] | None = cwlVersion self.class_: Final[str] = "Workflow" self.steps: Sequence[WorkflowStep] = steps @@ -25253,7 +25253,7 @@ def __init__( 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["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"] | None = None, + cwlVersion: Literal["v1.1"] | None = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -25272,7 +25272,7 @@ def __init__( 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["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"] | None = cwlVersion + self.cwlVersion: Literal["v1.1"] | None = cwlVersion self.class_: Final[str] = "ProcessGenerator" self.run: CommandLineTool | ExpressionTool | ProcessGenerator | Workflow | str = run @@ -26117,16 +26117,6 @@ def __init__( "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", @@ -26145,10 +26135,7 @@ def __init__( "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.update({ "https://w3id.org/cwl/salad#Any": "Any", @@ -26253,16 +26240,6 @@ def __init__( "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", @@ -26281,10 +26258,7 @@ def __init__( "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: Final = _PrimitiveLoader(str) @@ -26456,27 +26430,9 @@ def __init__( 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( - ( - "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", -) +CWLVersionLoader: Final = _EnumLoader(("v1.1",), "CWLVersion") """ -Version symbols for published CWL document versions. +Current version symbol for CWL documents. """ LoadListingEnumLoader: Final = _EnumLoader( ( diff --git a/cwl_utils/parser/cwl_v1_1_utils.py b/cwl_utils/parser/cwl_v1_1_utils.py index 42cad4dc..eaa21dc5 100644 --- a/cwl_utils/parser/cwl_v1_1_utils.py +++ b/cwl_utils/parser/cwl_v1_1_utils.py @@ -40,10 +40,11 @@ "string", "File", "Directory", - "stdin", ] ) -InputTypeSchemas: TypeAlias = BasicInputTypeSchemas | Sequence[BasicInputTypeSchemas] +InputTypeSchemas: TypeAlias = ( + BasicInputTypeSchemas | Literal["stdin"] | Sequence[BasicInputTypeSchemas] +) BasicCommandInputTypeSchemas: TypeAlias = ( cwl.CommandInputArraySchema | cwl.CommandInputEnumSchema @@ -59,11 +60,12 @@ "string", "File", "Directory", - "stdin", ] ) CommandInputTypeSchemas: TypeAlias = ( - BasicCommandInputTypeSchemas | Sequence[BasicCommandInputTypeSchemas] + BasicCommandInputTypeSchemas + | Literal["stdin"] + | Sequence[BasicCommandInputTypeSchemas] ) BasicOutputTypeSchemas: TypeAlias = ( cwl.OutputArraySchema @@ -80,11 +82,13 @@ "string", "File", "Directory", - "stdout", - "stderr", ] ) -OutputTypeSchemas: TypeAlias = BasicOutputTypeSchemas | Sequence[BasicOutputTypeSchemas] +OutputTypeSchemas: TypeAlias = ( + BasicOutputTypeSchemas + | Literal["stderr", "stdout"] + | Sequence[BasicOutputTypeSchemas] +) BasicCommandOutputTypeSchemas: TypeAlias = ( cwl.CommandOutputArraySchema | cwl.CommandOutputEnumSchema @@ -100,100 +104,18 @@ "string", "File", "Directory", - "stdout", - "stderr", ] ) CommandOutputTypeSchemas: TypeAlias = ( - BasicCommandOutputTypeSchemas | Sequence[BasicCommandOutputTypeSchemas] + BasicCommandOutputTypeSchemas + | Literal["stderr", "stdout"] + | Sequence[BasicCommandOutputTypeSchemas] ) AnyTypeSchema = TypeVar( "AnyTypeSchema", bound=InputTypeSchemas | CommandOutputTypeSchemas ) -def _input_type_schema_to_cwl_v1_1_input_type_schema( - input_type: cwl_utils.parser.BasicInputTypeSchemas, - loading_options: cwl.LoadingOptions, -) -> BasicInputTypeSchemas: - if isinstance(input_type, cwl_utils.parser.InputArraySchemaTypes): - return cwl.InputArraySchema.fromDoc( - input_type.save(), - loading_options.baseuri, - loading_options, - ) - if isinstance(input_type, cwl_utils.parser.InputEnumSchemaTypes): - return cwl.InputEnumSchema.fromDoc( - input_type.save(), - loading_options.baseuri, - loading_options, - ) - if isinstance(input_type, cwl_utils.parser.InputRecordSchemaTypes): - return cwl.InputRecordSchema.fromDoc( - input_type.save(), - loading_options.baseuri, - loading_options, - ) - if isinstance(input_type, str): - return input_type - raise WorkflowException(f"Unexpected input type: {input_type}.") - - -def input_type_schema_to_cwl_v1_1_input_type_schema( - input_type: cwl_utils.parser.InputTypeSchemas, loading_options: cwl.LoadingOptions -) -> InputTypeSchemas: - if is_sequence(input_type): - return [ - _input_type_schema_to_cwl_v1_1_input_type_schema( - input_type_item, loading_options - ) - for input_type_item in input_type - ] - return _input_type_schema_to_cwl_v1_1_input_type_schema(input_type, loading_options) - - -def _output_type_schema_to_cwl_v1_1_output_type_schema( - output_type: cwl_utils.parser.BasicOutputTypeSchemas, - loading_options: cwl.LoadingOptions, -) -> BasicOutputTypeSchemas: - if isinstance(output_type, cwl_utils.parser.OutputArraySchemaTypes): - return cwl.OutputArraySchema.fromDoc( - output_type.save(), - loading_options.baseuri, - loading_options, - ) - if isinstance(output_type, cwl_utils.parser.OutputEnumSchemaTypes): - return cwl.OutputEnumSchema.fromDoc( - output_type.save(), - loading_options.baseuri, - loading_options, - ) - if isinstance(output_type, cwl_utils.parser.OutputRecordSchemaTypes): - return cwl.OutputRecordSchema.fromDoc( - output_type.save(), - loading_options.baseuri, - loading_options, - ) - if isinstance(output_type, str): - return output_type - raise WorkflowException(f"Unexpected output type: {output_type}.") - - -def output_type_schema_to_cwl_v1_1_output_type_schema( - output_type: cwl_utils.parser.OutputTypeSchemas, loading_options: cwl.LoadingOptions -) -> OutputTypeSchemas: - if is_sequence(output_type): - return [ - _output_type_schema_to_cwl_v1_1_output_type_schema( - output_type_item, loading_options - ) - for output_type_item in output_type - ] - return _output_type_schema_to_cwl_v1_1_output_type_schema( - output_type, loading_options - ) - - def _in_output_type_schema_to_output_type_schema( schema_type: BasicInputTypeSchemas | BasicOutputTypeSchemas, loading_options: cwl.LoadingOptions, @@ -594,63 +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, -) -> InputTypeSchemas: +) -> 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 step_input.id.split("#")[-1] == in_.id.split("#")[-1]: - if step_input.type_ is not None: - step_input_type = input_type_schema_to_cwl_v1_1_input_type_schema( - step_input.type_, step.loadingOptions - ) - else: - step_input_type = "null" - if step.scatter is not None and in_.id in aslist(step.scatter): - return cwl.InputArraySchema(items=step_input_type, type_="array") - return step_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 output_type is not None: - output_type_type = ( - output_type_schema_to_cwl_v1_1_output_type_schema( - output_type, step.loadingOptions - ) - ) - else: - output_type_type = "null" - if step.scatterMethod == "nested_crossproduct": - for _ in range(len(aslist(step.scatter))): - output_type_type = cwl.OutputArraySchema( - items=output_type_type, type_="array" - ) - return output_type_type - else: - return cwl.OutputArraySchema( - items=output_type_type, type_="array" + 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, @@ -825,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, @@ -834,9 +755,7 @@ def param_for_source_id( or "dotproduct", ) ) - elif isinstance( - step.scatter, MutableSequence - ): + case Sequence(): scatter_context.append( ( len(step.scatter), @@ -844,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 34e379b2..be96ca70 100644 --- a/cwl_utils/parser/cwl_v1_2.py +++ b/cwl_utils/parser/cwl_v1_2.py @@ -8099,7 +8099,7 @@ class Process(Identified, Labeled, Documented, metaclass=ABCMeta): 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["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"] | None + cwlVersion: Literal["v1.2"] | None intent: None | Sequence[str] @@ -16107,7 +16107,7 @@ def __init__( 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["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"] | None = None, + cwlVersion: Literal["v1.2"] | None = None, intent: None | Sequence[str] = None, baseCommand: None | Sequence[str] | str = None, arguments: None | Sequence[CommandLineBinding | str] = None, @@ -16135,7 +16135,7 @@ def __init__( 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["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"] | None = cwlVersion + 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 @@ -21228,7 +21228,7 @@ def __init__( 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["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"] | None = None, + cwlVersion: Literal["v1.2"] | None = None, intent: None | Sequence[str] = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, @@ -21248,7 +21248,7 @@ def __init__( 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["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"] | None = cwlVersion + self.cwlVersion: Literal["v1.2"] | None = cwlVersion self.intent: None | Sequence[str] = intent self.class_: Final[str] = "ExpressionTool" self.expression: str = expression @@ -24421,7 +24421,7 @@ def __init__( 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["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"] | None = None, + cwlVersion: Literal["v1.2"] | None = None, intent: None | Sequence[str] = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, @@ -24441,7 +24441,7 @@ def __init__( 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["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"] | None = cwlVersion + self.cwlVersion: Literal["v1.2"] | None = cwlVersion self.intent: None | Sequence[str] = intent self.class_: Final[str] = "Workflow" self.steps: Sequence[WorkflowStep] = steps @@ -26767,7 +26767,7 @@ def __init__( 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["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"] | None = None, + cwlVersion: Literal["v1.2"] | None = None, intent: None | Sequence[str] = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, @@ -26787,7 +26787,7 @@ def __init__( 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["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"] | None = cwlVersion + self.cwlVersion: Literal["v1.2"] | None = cwlVersion self.intent: None | Sequence[str] = intent self.class_: Final[str] = "Operation" @@ -27645,7 +27645,7 @@ def __init__( 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["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"] | None = None, + cwlVersion: Literal["v1.2"] | None = None, intent: None | Sequence[str] = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, @@ -27665,7 +27665,7 @@ def __init__( 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["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"] | None = cwlVersion + 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 @@ -29268,16 +29268,6 @@ def __init__( "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", @@ -29299,16 +29289,7 @@ def __init__( "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.update({ "https://w3id.org/cwl/salad#Any": "Any", @@ -29421,16 +29402,6 @@ def __init__( "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", @@ -29452,16 +29423,7 @@ def __init__( "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: Final = _PrimitiveLoader(str) @@ -29635,33 +29597,9 @@ def __init__( 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( - ( - "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", -) +CWLVersionLoader: Final = _EnumLoader(("v1.2",), "CWLVersion") """ -Version symbols for published CWL document versions. +Current version symbol for CWL documents. """ LoadListingEnumLoader: Final = _EnumLoader( ( diff --git a/cwl_utils/parser/cwl_v1_2_utils.py b/cwl_utils/parser/cwl_v1_2_utils.py index d6003ca3..a8d89ebd 100644 --- a/cwl_utils/parser/cwl_v1_2_utils.py +++ b/cwl_utils/parser/cwl_v1_2_utils.py @@ -40,10 +40,11 @@ "string", "File", "Directory", - "stdin", ] ) -InputTypeSchemas: TypeAlias = BasicInputTypeSchemas | Sequence[BasicInputTypeSchemas] +InputTypeSchemas: TypeAlias = ( + BasicInputTypeSchemas | Literal["stdin"] | Sequence[BasicInputTypeSchemas] +) BasicCommandInputTypeSchemas: TypeAlias = ( cwl.CommandInputArraySchema | cwl.CommandInputEnumSchema @@ -59,11 +60,12 @@ "string", "File", "Directory", - "stdin", ] ) CommandInputTypeSchemas: TypeAlias = ( - BasicCommandInputTypeSchemas | Sequence[BasicCommandInputTypeSchemas] + BasicCommandInputTypeSchemas + | Literal["stdin"] + | Sequence[BasicCommandInputTypeSchemas] ) BasicOutputTypeSchemas: TypeAlias = ( cwl.OutputArraySchema @@ -80,11 +82,13 @@ "string", "File", "Directory", - "stdout", - "stderr", ] ) -OutputTypeSchemas: TypeAlias = BasicOutputTypeSchemas | Sequence[BasicOutputTypeSchemas] +OutputTypeSchemas: TypeAlias = ( + BasicOutputTypeSchemas + | Literal["stderr", "stdout"] + | Sequence[BasicOutputTypeSchemas] +) BasicCommandOutputTypeSchemas: TypeAlias = ( cwl.CommandOutputArraySchema | cwl.CommandOutputEnumSchema @@ -100,100 +104,18 @@ "string", "File", "Directory", - "stdout", - "stderr", ] ) CommandOutputTypeSchemas: TypeAlias = ( - BasicCommandOutputTypeSchemas | Sequence[BasicCommandOutputTypeSchemas] + BasicCommandOutputTypeSchemas + | Literal["stderr", "stdout"] + | Sequence[BasicCommandOutputTypeSchemas] ) AnyTypeSchema = TypeVar( "AnyTypeSchema", bound=InputTypeSchemas | CommandOutputTypeSchemas ) -def _input_type_schema_to_cwl_v1_2_input_type_schema( - input_type: cwl_utils.parser.BasicInputTypeSchemas, - loading_options: cwl.LoadingOptions, -) -> BasicInputTypeSchemas: - if isinstance(input_type, cwl_utils.parser.InputArraySchemaTypes): - return cwl.InputArraySchema.fromDoc( - input_type.save(), - loading_options.baseuri, - loading_options, - ) - if isinstance(input_type, cwl_utils.parser.InputEnumSchemaTypes): - return cwl.InputEnumSchema.fromDoc( - input_type.save(), - loading_options.baseuri, - loading_options, - ) - if isinstance(input_type, cwl_utils.parser.InputRecordSchemaTypes): - return cwl.InputRecordSchema.fromDoc( - input_type.save(), - loading_options.baseuri, - loading_options, - ) - if isinstance(input_type, str): - return input_type - raise WorkflowException(f"Unexpected input type: {input_type}.") - - -def input_type_schema_to_cwl_v1_2_input_type_schema( - input_type: cwl_utils.parser.InputTypeSchemas, loading_options: cwl.LoadingOptions -) -> InputTypeSchemas: - if is_sequence(input_type): - return [ - _input_type_schema_to_cwl_v1_2_input_type_schema( - input_type_item, loading_options - ) - for input_type_item in input_type - ] - return _input_type_schema_to_cwl_v1_2_input_type_schema(input_type, loading_options) - - -def _output_type_schema_to_cwl_v1_2_output_type_schema( - output_type: cwl_utils.parser.BasicOutputTypeSchemas, - loading_options: cwl.LoadingOptions, -) -> BasicOutputTypeSchemas: - if isinstance(output_type, cwl_utils.parser.OutputArraySchemaTypes): - return cwl.OutputArraySchema.fromDoc( - output_type.save(), - loading_options.baseuri, - loading_options, - ) - if isinstance(output_type, cwl_utils.parser.OutputEnumSchemaTypes): - return cwl.OutputEnumSchema.fromDoc( - output_type.save(), - loading_options.baseuri, - loading_options, - ) - if isinstance(output_type, cwl_utils.parser.OutputRecordSchemaTypes): - return cwl.OutputRecordSchema.fromDoc( - output_type.save(), - loading_options.baseuri, - loading_options, - ) - if isinstance(output_type, str): - return output_type - raise WorkflowException(f"Unexpected output type: {output_type}.") - - -def output_type_schema_to_cwl_v1_2_output_type_schema( - output_type: cwl_utils.parser.OutputTypeSchemas, loading_options: cwl.LoadingOptions -) -> OutputTypeSchemas: - if is_sequence(output_type): - return [ - _output_type_schema_to_cwl_v1_2_output_type_schema( - output_type_item, loading_options - ) - for output_type_item in output_type - ] - return _output_type_schema_to_cwl_v1_2_output_type_schema( - output_type, loading_options - ) - - def _in_output_type_schema_to_output_type_schema( schema_type: BasicInputTypeSchemas | BasicOutputTypeSchemas, loading_options: cwl.LoadingOptions, @@ -718,63 +640,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, -) -> InputTypeSchemas: +) -> 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 step_input.id.split("#")[-1] == in_.id.split("#")[-1]: - if step_input.type_ is not None: - step_input_type = input_type_schema_to_cwl_v1_2_input_type_schema( - step_input.type_, step.loadingOptions - ) - else: - step_input_type = "null" - if step.scatter is not None and in_.id in aslist(step.scatter): - return cwl.InputArraySchema(items=step_input_type, type_="array") - return step_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 output_type is not None: - output_type_type = ( - output_type_schema_to_cwl_v1_2_output_type_schema( - output_type, step.loadingOptions - ) - ) - else: - output_type_type = "null" - if step.scatterMethod == "nested_crossproduct": - for _ in range(len(aslist(step.scatter))): - output_type_type = cwl.OutputArraySchema( - items=output_type_type, type_="array" - ) - return output_type_type - else: - return cwl.OutputArraySchema( - items=output_type_type, type_="array" + 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, @@ -958,8 +879,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, @@ -967,9 +888,7 @@ def param_for_source_id( or "dotproduct", ) ) - elif isinstance( - step.scatter, MutableSequence - ): + case Sequence(): scatter_context.append( ( len(step.scatter), @@ -977,7 +896,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 52fbb696..69b93a37 100644 --- a/cwl_utils/parser/utils.py +++ b/cwl_utils/parser/utils.py @@ -5,7 +5,7 @@ from collections.abc import MutableMapping, MutableSequence from pathlib import Path from types import ModuleType -from typing import Any, Final, 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 @@ -34,11 +34,41 @@ 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: @@ -221,7 +251,7 @@ def static_checker(workflow: Workflow) -> None: type_dict, ) workflow_outputs_val = cwl_v1_0_utils.check_all_types( - src_dict, cast(cwl_v1_0.Workflow, workflow).outputs, type_dict + src_dict, workflow.outputs, type_dict ) case "v1.1": parser = cwl_v1_1 @@ -231,7 +261,7 @@ def static_checker(workflow: Workflow) -> None: type_dict, ) workflow_outputs_val = cwl_v1_1_utils.check_all_types( - src_dict, cast(cwl_v1_1.Workflow, workflow).outputs, type_dict + src_dict, workflow.outputs, type_dict ) case "v1.2": parser = cwl_v1_2 @@ -342,6 +372,78 @@ def static_checker(workflow: 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], @@ -353,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, @@ -398,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": @@ -413,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": @@ -430,6 +521,8 @@ 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( @@ -458,24 +551,14 @@ def param_for_source_id( match process.cwlVersion: case "v1.0": return cwl_v1_0_utils.param_for_source_id( - cast( - cwl_v1_0.CommandLineTool - | cwl_v1_0.Workflow - | cwl_v1_0.ExpressionTool, - process, - ), + process, sourcenames, cast(cwl_v1_0.Workflow, parent), scatter_context, ) case "v1.1": return cwl_v1_1_utils.param_for_source_id( - cast( - cwl_v1_1.CommandLineTool - | cwl_v1_1.Workflow - | cwl_v1_1.ExpressionTool, - process, - ), + process, sourcenames, cast(cwl_v1_1.Workflow, parent), scatter_context, From 08e25784cf5b760e7061ae82edbd35c2ca0bad2f Mon Sep 17 00:00:00 2001 From: GlassOfWhiskey Date: Sat, 4 Apr 2026 20:27:32 +0200 Subject: [PATCH 17/22] Regenerate parsers without abstract classes --- .gitignore | 3 - cwl_utils/parser/cwl_v1_0.py | 732 ++++++++++---------- cwl_utils/parser/cwl_v1_0_utils.py | 26 +- cwl_utils/parser/cwl_v1_1.py | 914 +++++++++++-------------- cwl_utils/parser/cwl_v1_1_utils.py | 26 +- cwl_utils/parser/cwl_v1_2.py | 1002 +++++++++++++--------------- cwl_utils/parser/cwl_v1_2_utils.py | 67 +- cwl_utils/types.py | 4 +- 8 files changed, 1243 insertions(+), 1531 deletions(-) diff --git a/.gitignore b/.gitignore index 376eb398..0900bed7 100644 --- a/.gitignore +++ b/.gitignore @@ -111,9 +111,6 @@ testenv*/ # PyCharm .idea/ -# UV -uv.lock - # Backup files *.orig *~ diff --git a/cwl_utils/parser/cwl_v1_0.py b/cwl_utils/parser/cwl_v1_0.py index 6a6e814b..69e2713b 100644 --- a/cwl_utils/parser/cwl_v1_0.py +++ b/cwl_utils/parser/cwl_v1_0.py @@ -14,13 +14,13 @@ import uuid as _uuid__ # pylint: disable=unused-import # noqa: F401 import xml.sax # nosec from abc import ABCMeta, abstractmethod -from collections.abc import MutableMapping, MutableSequence, Sequence from collections.abc import Collection # pylint: disable=unused-import # noqa: F401 +from collections.abc import MutableMapping, MutableSequence, Sequence from io import StringIO from itertools import chain -from mypy_extensions import i32, i64, trait -from typing import Any, Final, Generic, TypeAlias, TypeVar, cast +from mypy_extensions import i32, i64 from typing import ClassVar, Literal, Mapping # pylint: disable=unused-import # noqa: F401 +from typing import Any, Final, Generic, TypeAlias, TypeVar, cast from urllib.parse import quote, urldefrag, urlparse, urlsplit, urlunsplit from urllib.request import pathname2url @@ -213,7 +213,6 @@ def graph(self) -> Graph: return graph -@trait class Saveable(metaclass=ABCMeta): """Mark classes than have a save() and fromDoc() function.""" @@ -1186,12 +1185,7 @@ def parser_info() -> str: return "org.w3id.cwl.v1_0" -@trait -class Documented(Saveable, metaclass=ABCMeta): - doc: None | Sequence[str] | str - - -class RecordField(Documented): +class RecordField(Saveable): """ A field of a record. """ @@ -1456,9 +1450,9 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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_ + self.doc = doc + self.name = name + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset(["doc", "name", "type"]) @@ -1656,8 +1650,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields: None | Sequence[RecordField] = fields - self.type_: Literal["record"] = type_ + self.fields = fields + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset(["fields", "type"]) @@ -1928,9 +1922,9 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.symbols: Sequence[str] = symbols - self.type_: Literal["enum"] = type_ + self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols = symbols + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset(["name", "symbols", "type"]) @@ -2128,8 +2122,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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_ + self.items = items + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset(["items", "type"]) @@ -2327,8 +2321,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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 + self.type_ = type_ + self.values = values attrs: ClassVar[Collection[str]] = frozenset(["type", "values"]) @@ -2526,8 +2520,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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_ + self.names = names + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset(["names", "type"]) @@ -2725,8 +2719,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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_ + self.items = items + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset(["items", "type"]) @@ -2992,9 +2986,9 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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_ + self.doc = doc + self.name = name + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset(["doc", "name", "type"]) @@ -3192,8 +3186,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields: None | Sequence[CWLRecordField] = fields - self.type_: Literal["record"] = type_ + self.fields = fields + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset(["fields", "type"]) @@ -3990,17 +3984,17 @@ def __init__( 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 + 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 attrs: ClassVar[Collection[str]] = frozenset( [ @@ -4054,7 +4048,7 @@ class Directory(Saveable): the same Directory. When executing a CommandLineTool, Directories must be recursively staged - first and have local values of `path` assigend. + first and have local values of `path` assigned. Directory objects in CommandLineTool output must provide either a `location` URI or a `path` property in the context of the tool execution @@ -4396,54 +4390,16 @@ def __init__( 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 + self.location = location + self.path = path + self.basename = basename + self.listing = listing attrs: ClassVar[Collection[str]] = frozenset( ["class", "location", "path", "basename", "listing"] ) -@trait -class SchemaBase(Saveable, metaclass=ABCMeta): - label: None | str - - -@trait -class Parameter(SchemaBase, metaclass=ABCMeta): - """ - Define an input or output parameter to a process. - - """ - - label: None | str - secondaryFiles: None | Sequence[str] | str - streamable: None | bool - doc: None | Sequence[str] | str - - -@trait -class InputBinding(Saveable, metaclass=ABCMeta): - loadContents: None | bool - - -@trait -class OutputBinding(Saveable, metaclass=ABCMeta): - pass - - -@trait -class InputSchema(SchemaBase, metaclass=ABCMeta): - label: None | str - - -@trait -class OutputSchema(SchemaBase, metaclass=ABCMeta): - label: None | str - - class InputRecordField(CWLRecordField): name: str @@ -4816,18 +4772,18 @@ def __init__( 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.inputBinding: CommandLineBinding | None = inputBinding - self.label: None | str = label + self.doc = doc + self.name = name + self.type_ = type_ + self.inputBinding = inputBinding + self.label = label attrs: ClassVar[Collection[str]] = frozenset( ["doc", "name", "type", "inputBinding", "label"] ) -class InputRecordSchema(CWLRecordSchema, InputSchema): +class InputRecordSchema(CWLRecordSchema): name: str def __eq__(self, other: Any) -> bool: @@ -5142,15 +5098,15 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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()) + self.fields = fields + self.type_ = type_ + self.label = label + self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) attrs: ClassVar[Collection[str]] = frozenset(["fields", "type", "label", "name"]) -class InputEnumSchema(EnumSchema, InputSchema): +class InputEnumSchema(EnumSchema): name: str def __eq__(self, other: Any) -> bool: @@ -5524,18 +5480,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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 + self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols = symbols + self.type_ = type_ + self.label = label + self.inputBinding = inputBinding attrs: ClassVar[Collection[str]] = frozenset( ["name", "symbols", "type", "label", "inputBinding"] ) -class InputArraySchema(CWLArraySchema, InputSchema): +class InputArraySchema(CWLArraySchema): def __eq__(self, other: Any) -> bool: if isinstance(other, InputArraySchema): return bool( @@ -5842,10 +5798,10 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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 + self.items = items + self.type_ = type_ + self.label = label + self.inputBinding = inputBinding attrs: ClassVar[Collection[str]] = frozenset( ["items", "type", "label", "inputBinding"] @@ -6170,17 +6126,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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 + self.doc = doc + self.name = name + self.type_ = type_ + self.outputBinding = outputBinding attrs: ClassVar[Collection[str]] = frozenset( ["doc", "name", "type", "outputBinding"] ) -class OutputRecordSchema(CWLRecordSchema, OutputSchema): +class OutputRecordSchema(CWLRecordSchema): def __eq__(self, other: Any) -> bool: if isinstance(other, OutputRecordSchema): return bool( @@ -6430,14 +6386,14 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields: None | Sequence[OutputRecordField] = fields - self.type_: Literal["record"] = type_ - self.label: None | str = label + self.fields = fields + self.type_ = type_ + self.label = label attrs: ClassVar[Collection[str]] = frozenset(["fields", "type", "label"]) -class OutputEnumSchema(EnumSchema, OutputSchema): +class OutputEnumSchema(EnumSchema): name: str def __eq__(self, other: Any) -> bool: @@ -6811,18 +6767,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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 + self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols = symbols + self.type_ = type_ + self.label = label + self.outputBinding = outputBinding attrs: ClassVar[Collection[str]] = frozenset( ["name", "symbols", "type", "label", "outputBinding"] ) -class OutputArraySchema(CWLArraySchema, OutputSchema): +class OutputArraySchema(CWLArraySchema): def __eq__(self, other: Any) -> bool: if isinstance(other, OutputArraySchema): return bool( @@ -7129,17 +7085,17 @@ def __init__( 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.outputBinding: CommandOutputBinding | None = outputBinding + self.items = items + self.type_ = type_ + self.label = label + self.outputBinding = outputBinding attrs: ClassVar[Collection[str]] = frozenset( ["items", "type", "label", "outputBinding"] ) -class InputParameter(Parameter): +class InputParameter(Saveable): id: str def __eq__(self, other: Any) -> bool: @@ -7743,15 +7699,15 @@ def __init__( 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_ + self.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.format = format + self.inputBinding = inputBinding + self.default = default + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset( [ @@ -7768,7 +7724,7 @@ def __init__( ) -class OutputParameter(Parameter): +class OutputParameter(Saveable): id: str def __eq__(self, other: Any) -> bool: @@ -8262,13 +8218,13 @@ def __init__( 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.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.outputBinding = outputBinding + self.format = format attrs: ClassVar[Collection[str]] = frozenset( [ @@ -8283,42 +8239,7 @@ def __init__( ) -@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 - [`Process.requirements`](#process). - - Process requirements are the primary mechanism for specifying extensions to - the CWL core specification. - - """ - - pass - - -@trait -class Process(Saveable, metaclass=ABCMeta): - """ - - The base executable type in CWL is the `Process` object defined by the - document. Note that the `Process` object is abstract and cannot be - directly executed. - - """ - - 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): +class InlineJavascriptRequirement(Saveable): """ Indicates that the workflow platform must support inline Javascript expressions. If this requirement is not present, the workflow platform must not perform expression @@ -8495,12 +8416,12 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "InlineJavascriptRequirement" - self.expressionLib: None | Sequence[str] = expressionLib + self.expressionLib = expressionLib attrs: ClassVar[Collection[str]] = frozenset(["class", "expressionLib"]) -class SchemaDefRequirement(ProcessRequirement): +class SchemaDefRequirement(Saveable): """ This field consists of an array of type definitions which must be used when interpreting the `inputs` and `outputs` fields. When a `type` field @@ -8676,7 +8597,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "SchemaDefRequirement" - self.types: Sequence[InputArraySchema | InputEnumSchema | InputRecordSchema] = types + self.types = types attrs: ClassVar[Collection[str]] = frozenset(["class", "types"]) @@ -8884,13 +8805,13 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.envName: str = envName - self.envValue: str = envValue + self.envName = envName + self.envValue = envValue attrs: ClassVar[Collection[str]] = frozenset(["envName", "envValue"]) -class CommandLineBinding(InputBinding): +class CommandLineBinding(Saveable): """ When listed under `inputBinding` in the input schema, the term @@ -9416,13 +9337,13 @@ def __init__( 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 + self.loadContents = loadContents + self.position = position + self.prefix = prefix + self.separate = separate + self.itemSeparator = itemSeparator + self.valueFrom = valueFrom + self.shellQuote = shellQuote attrs: ClassVar[Collection[str]] = frozenset( [ @@ -9437,7 +9358,7 @@ def __init__( ) -class CommandOutputBinding(OutputBinding): +class CommandOutputBinding(Saveable): """ Describes how to generate an output parameter based on the files produced by a CommandLineTool. @@ -9706,9 +9627,9 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.glob: None | Sequence[str] | str = glob - self.loadContents: None | bool = loadContents - self.outputEval: None | str = outputEval + self.glob = glob + self.loadContents = loadContents + self.outputEval = outputEval attrs: ClassVar[Collection[str]] = frozenset(["glob", "loadContents", "outputEval"]) @@ -10085,11 +10006,11 @@ def __init__( 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.inputBinding: CommandLineBinding | None = inputBinding - self.label: None | str = label + self.doc = doc + self.name = name + self.type_ = type_ + self.inputBinding = inputBinding + self.label = label attrs: ClassVar[Collection[str]] = frozenset( ["doc", "name", "type", "inputBinding", "label"] @@ -10411,10 +10332,10 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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()) + self.fields = fields + self.type_ = type_ + self.label = label + self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) attrs: ClassVar[Collection[str]] = frozenset(["fields", "type", "label", "name"]) @@ -10793,11 +10714,11 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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 + self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols = symbols + self.type_ = type_ + self.label = label + self.inputBinding = inputBinding attrs: ClassVar[Collection[str]] = frozenset( ["name", "symbols", "type", "label", "inputBinding"] @@ -11111,10 +11032,10 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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 + self.items = items + self.type_ = type_ + self.label = label + self.inputBinding = inputBinding attrs: ClassVar[Collection[str]] = frozenset( ["items", "type", "label", "inputBinding"] @@ -11439,10 +11360,10 @@ def __init__( 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.outputBinding: CommandOutputBinding | None = outputBinding + self.doc = doc + self.name = name + self.type_ = type_ + self.outputBinding = outputBinding attrs: ClassVar[Collection[str]] = frozenset( ["doc", "name", "type", "outputBinding"] @@ -11764,10 +11685,10 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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()) + self.fields = fields + self.type_ = type_ + self.label = label + self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) attrs: ClassVar[Collection[str]] = frozenset(["fields", "type", "label", "name"]) @@ -12146,11 +12067,11 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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 + self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols = symbols + self.type_ = type_ + self.label = label + self.outputBinding = outputBinding attrs: ClassVar[Collection[str]] = frozenset( ["name", "symbols", "type", "label", "outputBinding"] @@ -12464,10 +12385,10 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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 + self.items = items + self.type_ = type_ + self.label = label + self.outputBinding = outputBinding attrs: ClassVar[Collection[str]] = frozenset( ["items", "type", "label", "outputBinding"] @@ -13082,15 +13003,15 @@ def __init__( 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_ + self.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.format = format + self.inputBinding = inputBinding + self.default = default + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset( [ @@ -13660,14 +13581,14 @@ def __init__( 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_ + self.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.outputBinding = outputBinding + self.format = format + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset( [ @@ -13683,7 +13604,7 @@ def __init__( ) -class CommandLineTool(Process): +class CommandLineTool(Saveable): """ This defines the schema of the CWL Command Line Tool Description document. @@ -14711,23 +14632,23 @@ def __init__( 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.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_: 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 + self.baseCommand = baseCommand + self.arguments = arguments + self.stdin = stdin + self.stderr = stderr + self.stdout = stdout + self.successCodes = successCodes + self.temporaryFailCodes = temporaryFailCodes + self.permanentFailCodes = permanentFailCodes attrs: ClassVar[Collection[str]] = frozenset( [ @@ -14752,7 +14673,7 @@ def __init__( ) -class DockerRequirement(ProcessRequirement): +class DockerRequirement(Saveable): """ Indicates that a workflow component should be run in a [Docker](http://docker.com) container, and specifies how to fetch or build @@ -15254,12 +15175,12 @@ def __init__( 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 + self.dockerPull = dockerPull + self.dockerLoad = dockerLoad + self.dockerFile = dockerFile + self.dockerImport = dockerImport + self.dockerImageId = dockerImageId + self.dockerOutputDirectory = dockerOutputDirectory attrs: ClassVar[Collection[str]] = frozenset( [ @@ -15274,7 +15195,7 @@ def __init__( ) -class SoftwareRequirement(ProcessRequirement): +class SoftwareRequirement(Saveable): """ A list of software packages that should be configured in the environment of the defined process. @@ -15445,7 +15366,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "SoftwareRequirement" - self.packages: Sequence[SoftwarePackage] = packages + self.packages = packages attrs: ClassVar[Collection[str]] = frozenset(["class", "packages"]) @@ -15699,9 +15620,9 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.package: str = package - self.version: None | Sequence[str] = version - self.specs: None | Sequence[str] = specs + self.package = package + self.version = version + self.specs = specs attrs: ClassVar[Collection[str]] = frozenset(["package", "version", "specs"]) @@ -15967,14 +15888,14 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.entryname: None | str = entryname - self.entry: str = entry - self.writable: None | bool = writable + self.entryname = entryname + self.entry = entry + self.writable = writable attrs: ClassVar[Collection[str]] = frozenset(["entryname", "entry", "writable"]) -class InitialWorkDirRequirement(ProcessRequirement): +class InitialWorkDirRequirement(Saveable): """ 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. """ @@ -16143,12 +16064,12 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "InitialWorkDirRequirement" - self.listing: Sequence[Directory | Dirent | File | str] | str = listing + self.listing = listing attrs: ClassVar[Collection[str]] = frozenset(["class", "listing"]) -class EnvVarRequirement(ProcessRequirement): +class EnvVarRequirement(Saveable): """ Define a list of environment variables which will be set in the execution environment of the tool. See `EnvironmentDef` for details. @@ -16319,17 +16240,17 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "EnvVarRequirement" - self.envDef: Sequence[EnvironmentDef] = envDef + self.envDef = envDef attrs: ClassVar[Collection[str]] = frozenset(["class", "envDef"]) -class ShellCommandRequirement(ProcessRequirement): +class ShellCommandRequirement(Saveable): """ Modify the behavior of CommandLineTool to generate a single string containing a shell command line. Each item in the argument list must be joined into a string separated by single spaces and quoted to prevent - intepretation by the shell, unless `CommandLineBinding` for that argument + interpretation by the shell, unless `CommandLineBinding` for that argument contains `shellQuote: false`. If `shellQuote: false` is specified, the argument is joined into the command string without quoting, which allows the use of shell metacharacters such as `|` for pipes. @@ -16448,7 +16369,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class"]) -class ResourceRequirement(ProcessRequirement): +class ResourceRequirement(Saveable): """ Specify basic hardware resource requirements. @@ -17041,14 +16962,14 @@ def __init__( 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 + self.coresMin = coresMin + self.coresMax = coresMax + self.ramMin = ramMin + self.ramMax = ramMax + self.tmpdirMin = tmpdirMin + self.tmpdirMax = tmpdirMax + self.outdirMin = outdirMin + self.outdirMax = outdirMax attrs: ClassVar[Collection[str]] = frozenset( [ @@ -17614,14 +17535,14 @@ def __init__( 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_ + self.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.outputBinding = outputBinding + self.format = format + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset( [ @@ -17637,7 +17558,7 @@ def __init__( ) -class ExpressionTool(Process): +class ExpressionTool(Saveable): """ Execute an expression as a Workflow step. @@ -18272,16 +18193,16 @@ def __init__( 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.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_: Final[str] = "ExpressionTool" - self.expression: str = expression + self.expression = expression attrs: ClassVar[Collection[str]] = frozenset( [ @@ -18964,16 +18885,16 @@ def __init__( 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_ + self.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.outputBinding = outputBinding + self.format = format + self.outputSource = outputSource + self.linkMerge = linkMerge + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset( [ @@ -18991,13 +18912,7 @@ def __init__( ) -@trait -class Sink(Saveable, metaclass=ABCMeta): - source: None | Sequence[str] | str - linkMerge: Literal["merge_nested", "merge_flattened"] | None - - -class WorkflowStepInput(Sink): +class WorkflowStepInput(Saveable): """ The input of a workflow step connects an upstream parameter (from the workflow inputs, or the outputs of other workflows steps) with the input @@ -19409,11 +19324,11 @@ def __init__( 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 + self.source = source + self.linkMerge = linkMerge + self.id = id + self.default = default + self.valueFrom = valueFrom attrs: ClassVar[Collection[str]] = frozenset( ["source", "linkMerge", "id", "default", "valueFrom"] @@ -19576,7 +19491,7 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.id: str = id + self.id = id attrs: ClassVar[Collection[str]] = frozenset(["id"]) @@ -20295,16 +20210,16 @@ def __init__( 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 + self.id = id + 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 attrs: ClassVar[Collection[str]] = frozenset( [ @@ -20322,7 +20237,7 @@ def __init__( ) -class Workflow(Process): +class Workflow(Saveable): """ A workflow describes a set of **steps** and the **dependencies** between those steps. When a step produces output that will be consumed by a @@ -20342,7 +20257,7 @@ class Workflow(Process): The `source` field expresses the dependency of one parameter on another such that when a value is associated with the parameter specified by `source`, that value is propagated to the destination parameter. When all - data links inbound to a given step are fufilled, the step is ready to + data links inbound to a given step are fulfilled, the step is ready to execute. ## Workflow success and failure @@ -20998,16 +20913,16 @@ def __init__( 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.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_: Final[str] = "Workflow" - self.steps: Sequence[WorkflowStep] = steps + self.steps = steps attrs: ClassVar[Collection[str]] = frozenset( [ @@ -21025,7 +20940,7 @@ def __init__( ) -class SubworkflowFeatureRequirement(ProcessRequirement): +class SubworkflowFeatureRequirement(Saveable): """ Indicates that the workflow platform must support nested workflows in the `run` field of [WorkflowStep](#WorkflowStep). @@ -21144,7 +21059,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class"]) -class ScatterFeatureRequirement(ProcessRequirement): +class ScatterFeatureRequirement(Saveable): """ Indicates that the workflow platform must support the `scatter` and `scatterMethod` fields of [WorkflowStep](#WorkflowStep). @@ -21263,7 +21178,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class"]) -class MultipleInputFeatureRequirement(ProcessRequirement): +class MultipleInputFeatureRequirement(Saveable): """ Indicates that the workflow platform must support multiple inbound data links listed in the `source` field of [WorkflowStepInput](#WorkflowStepInput). @@ -21382,7 +21297,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class"]) -class StepInputExpressionRequirement(ProcessRequirement): +class StepInputExpressionRequirement(Saveable): """ Indicate that the workflow platform must support the `valueFrom` field of [WorkflowStepInput](#WorkflowStepInput). @@ -21501,7 +21416,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class"]) -class LoadListingRequirement(ProcessRequirement): +class LoadListingRequirement(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, LoadListingRequirement): return bool( @@ -21671,12 +21586,12 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "LoadListingRequirement" - self.loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] = loadListing + self.loadListing = loadListing attrs: ClassVar[Collection[str]] = frozenset(["class", "loadListing"]) -class InplaceUpdateRequirement(ProcessRequirement): +class InplaceUpdateRequirement(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, InplaceUpdateRequirement): return bool( @@ -21847,12 +21762,12 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "InplaceUpdateRequirement" - self.inplaceUpdate: bool = inplaceUpdate + self.inplaceUpdate = inplaceUpdate attrs: ClassVar[Collection[str]] = frozenset(["class", "inplaceUpdate"]) -class Secrets(ProcessRequirement): +class Secrets(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, Secrets): return bool(self.class_ == other.class_ and self.secrets == other.secrets) @@ -22016,12 +21931,12 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "Secrets" - self.secrets: Sequence[str] = secrets + self.secrets = secrets attrs: ClassVar[Collection[str]] = frozenset(["class", "secrets"]) -class TimeLimit(ProcessRequirement): +class TimeLimit(Saveable): """ Set an upper limit on the execution time of a CommandLineTool or ExpressionTool. A tool execution which exceeds the time limit may @@ -22199,12 +22114,12 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "TimeLimit" - self.timelimit: i32 | str = timelimit + self.timelimit = timelimit attrs: ClassVar[Collection[str]] = frozenset(["class", "timelimit"]) -class WorkReuse(ProcessRequirement): +class WorkReuse(Saveable): """ For implementations that support reusing output from past work (on the assumption that same code and same input produce same @@ -22387,12 +22302,12 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "WorkReuse" - self.enableReuse: bool | str = enableReuse + self.enableReuse = enableReuse attrs: ClassVar[Collection[str]] = frozenset(["class", "enableReuse"]) -class NetworkAccess(ProcessRequirement): +class NetworkAccess(Saveable): """ Indicate whether a process requires outgoing IPv4/IPv6 network access. Choice of IPv4 or IPv6 is implementation and site @@ -22582,12 +22497,12 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "NetworkAccess" - self.networkAccess: bool | str = networkAccess + self.networkAccess = networkAccess attrs: ClassVar[Collection[str]] = frozenset(["class", "networkAccess"]) -class ProcessGenerator(Process): +class ProcessGenerator(Saveable): id: str def __eq__(self, other: Any) -> bool: @@ -23213,16 +23128,16 @@ def __init__( 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.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_: Final[str] = "ProcessGenerator" - self.run: CommandLineTool | ExpressionTool | ProcessGenerator | Workflow | str = run + self.run = run attrs: ClassVar[Collection[str]] = frozenset( [ @@ -23240,7 +23155,7 @@ def __init__( ) -class MPIRequirement(ProcessRequirement): +class MPIRequirement(Saveable): """ Indicates that a process requires an MPI runtime. @@ -23415,12 +23330,12 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "MPIRequirement" - self.processes: i32 | str = processes + self.processes = processes attrs: ClassVar[Collection[str]] = frozenset(["class", "processes"]) -class CUDARequirement(ProcessRequirement): +class CUDARequirement(Saveable): """ Require support for NVIDA CUDA (GPU hardware acceleration). @@ -23776,10 +23691,10 @@ def __init__( 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 + self.cudaComputeCapability = cudaComputeCapability + self.cudaDeviceCountMax = cudaDeviceCountMax + self.cudaDeviceCountMin = cudaDeviceCountMin + self.cudaVersionMin = cudaVersionMin attrs: ClassVar[Collection[str]] = frozenset( [ @@ -23792,7 +23707,7 @@ def __init__( ) -class ShmSize(ProcessRequirement): +class ShmSize(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, ShmSize): return bool(self.class_ == other.class_ and self.shmSize == other.shmSize) @@ -23957,7 +23872,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "ShmSize" - self.shmSize: str = shmSize + self.shmSize = shmSize attrs: ClassVar[Collection[str]] = frozenset(["class", "shmSize"]) @@ -25536,6 +25451,39 @@ def __init__( "Directory | File | Mapping[str, CWLObjectType | None] | Sequence[CWLObjectType | None] | bool | float | i32 | i64 | str" ) +Documented: TypeAlias = RecordField +Parameter: TypeAlias = InputParameter | OutputParameter +InputBinding: TypeAlias = CommandLineBinding +OutputBinding: TypeAlias = CommandOutputBinding +InputSchema: TypeAlias = InputArraySchema | InputEnumSchema | InputRecordSchema +OutputSchema: TypeAlias = OutputArraySchema | OutputEnumSchema | OutputRecordSchema +ProcessRequirement: TypeAlias = ( + CUDARequirement + | DockerRequirement + | EnvVarRequirement + | InitialWorkDirRequirement + | InlineJavascriptRequirement + | InplaceUpdateRequirement + | LoadListingRequirement + | MPIRequirement + | MultipleInputFeatureRequirement + | NetworkAccess + | ResourceRequirement + | ScatterFeatureRequirement + | SchemaDefRequirement + | Secrets + | ShellCommandRequirement + | ShmSize + | SoftwareRequirement + | StepInputExpressionRequirement + | SubworkflowFeatureRequirement + | TimeLimit + | WorkReuse +) +Process: TypeAlias = CommandLineTool | ExpressionTool | ProcessGenerator | Workflow +Sink: TypeAlias = WorkflowStepInput +SchemaBase: TypeAlias = InputSchema | OutputSchema | Parameter + def load_document( doc: Any, diff --git a/cwl_utils/parser/cwl_v1_0_utils.py b/cwl_utils/parser/cwl_v1_0_utils.py index 38e3e320..df0888d9 100644 --- a/cwl_utils/parser/cwl_v1_0_utils.py +++ b/cwl_utils/parser/cwl_v1_0_utils.py @@ -324,7 +324,14 @@ def check_all_types( case _: raise WorkflowException(f"Invalid sink type {sink.__class__.__name__}") if sourceField is not None: - if isinstance(sourceField, str): + if is_sequence(sourceField): + 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 = sourceField if parm_id not in src_dict: raise SourceLine(sink, sourceName, ValidationException).makeError( @@ -332,13 +339,6 @@ def check_all_types( ) 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)], @@ -575,21 +575,21 @@ def type_for_source( for _ in range(scatter_context[0][0]): new_type = cwl.OutputArraySchema( items=in_output_type_schema_to_output_type_schema( - new_type, process.loadingOptions # type: ignore[attr-defined] + new_type, process.loadingOptions ), type_="array", ) else: new_type = cwl.OutputArraySchema( items=in_output_type_schema_to_output_type_schema( - new_type, process.loadingOptions # type: ignore[attr-defined] + new_type, process.loadingOptions ), type_="array", ) if linkMerge == "merge_nested": new_type = cwl.OutputArraySchema( items=in_output_type_schema_to_output_type_schema( - new_type, process.loadingOptions # type: ignore[attr-defined] + new_type, process.loadingOptions ), type_="array", ) @@ -612,14 +612,14 @@ def type_for_source( for _ in range(sc[0]): cur_type = cwl.OutputArraySchema( items=in_output_type_schema_to_output_type_schema( - cur_type, process.loadingOptions # type: ignore[attr-defined] + cur_type, process.loadingOptions ), type_="array", ) else: cur_type = cwl.OutputArraySchema( items=in_output_type_schema_to_output_type_schema( - cur_type, process.loadingOptions # type: ignore[attr-defined] + cur_type, process.loadingOptions ), type_="array", ) diff --git a/cwl_utils/parser/cwl_v1_1.py b/cwl_utils/parser/cwl_v1_1.py index f229e0b0..e571c050 100644 --- a/cwl_utils/parser/cwl_v1_1.py +++ b/cwl_utils/parser/cwl_v1_1.py @@ -14,13 +14,13 @@ import uuid as _uuid__ # pylint: disable=unused-import # noqa: F401 import xml.sax # nosec from abc import ABCMeta, abstractmethod -from collections.abc import MutableMapping, MutableSequence, Sequence from collections.abc import Collection # pylint: disable=unused-import # noqa: F401 +from collections.abc import MutableMapping, MutableSequence, Sequence from io import StringIO from itertools import chain -from mypy_extensions import i32, i64, trait -from typing import Any, Final, Generic, TypeAlias, TypeVar, cast +from mypy_extensions import i32, i64 from typing import ClassVar, Literal, Mapping # pylint: disable=unused-import # noqa: F401 +from typing import Any, Final, Generic, TypeAlias, TypeVar, cast from urllib.parse import quote, urldefrag, urlparse, urlsplit, urlunsplit from urllib.request import pathname2url @@ -213,7 +213,6 @@ def graph(self) -> Graph: return graph -@trait class Saveable(metaclass=ABCMeta): """Mark classes than have a save() and fromDoc() function.""" @@ -1186,12 +1185,7 @@ def parser_info() -> str: return "org.w3id.cwl.v1_1" -@trait -class Documented(Saveable, metaclass=ABCMeta): - doc: None | Sequence[str] | str - - -class RecordField(Documented): +class RecordField(Saveable): """ A field of a record. """ @@ -1456,9 +1450,9 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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_ + self.doc = doc + self.name = name + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset(["doc", "name", "type"]) @@ -1656,8 +1650,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields: None | Sequence[RecordField] = fields - self.type_: Literal["record"] = type_ + self.fields = fields + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset(["fields", "type"]) @@ -1928,9 +1922,9 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.symbols: Sequence[str] = symbols - self.type_: Literal["enum"] = type_ + self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols = symbols + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset(["name", "symbols", "type"]) @@ -2128,8 +2122,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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_ + self.items = items + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset(["items", "type"]) @@ -2327,8 +2321,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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 + self.type_ = type_ + self.values = values attrs: ClassVar[Collection[str]] = frozenset(["type", "values"]) @@ -2526,8 +2520,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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_ + self.names = names + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset(["names", "type"]) @@ -2725,8 +2719,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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_ + self.items = items + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset(["items", "type"]) @@ -2992,9 +2986,9 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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_ + self.doc = doc + self.name = name + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset(["doc", "name", "type"]) @@ -3192,8 +3186,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields: None | Sequence[CWLRecordField] = fields - self.type_: Literal["record"] = type_ + self.fields = fields + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset(["fields", "type"]) @@ -3990,17 +3984,17 @@ def __init__( 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 + 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 attrs: ClassVar[Collection[str]] = frozenset( [ @@ -4054,7 +4048,7 @@ class Directory(Saveable): the same Directory. When executing a CommandLineTool, Directories must be recursively staged - first and have local values of `path` assigend. + first and have local values of `path` assigned. Directory objects in CommandLineTool output must provide either a `location` URI or a `path` property in the context of the tool execution @@ -4396,68 +4390,16 @@ def __init__( 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 + self.location = location + self.path = path + self.basename = basename + self.listing = listing attrs: ClassVar[Collection[str]] = frozenset( ["class", "location", "path", "basename", "listing"] ) -@trait -class Labeled(Saveable, metaclass=ABCMeta): - label: None | str - - -@trait -class Identified(Saveable, metaclass=ABCMeta): - id: None | str - - -@trait -class IdentifierRequired(Identified, metaclass=ABCMeta): - id: str - - -@trait -class LoadContents(Saveable, metaclass=ABCMeta): - loadContents: None | bool - loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None - - -@trait -class FieldBase(Labeled, metaclass=ABCMeta): - label: None | str - secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] - streamable: None | bool - - -@trait -class InputFormat(Saveable, metaclass=ABCMeta): - format: None | Sequence[str] | str - - -@trait -class OutputFormat(Saveable, metaclass=ABCMeta): - format: None | str - - -@trait -class Parameter(FieldBase, Documented, IdentifierRequired, metaclass=ABCMeta): - """ - Define an input or output parameter to a process. - - """ - - label: None | str - secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] - streamable: None | bool - doc: None | Sequence[str] | str - id: str - - class InputBinding(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, InputBinding): @@ -4600,33 +4542,12 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.loadContents: None | bool = loadContents + self.loadContents = 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): +class InputRecordField(CWLRecordField): name: str def __eq__(self, other: Any) -> bool: @@ -5234,15 +5155,15 @@ def __init__( 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 + self.doc = doc + self.name = name + self.type_ = type_ + self.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.format = format + self.loadContents = loadContents + self.loadListing = loadListing attrs: ClassVar[Collection[str]] = frozenset( [ @@ -5259,7 +5180,7 @@ def __init__( ) -class InputRecordSchema(CWLRecordSchema, InputSchema): +class InputRecordSchema(CWLRecordSchema): name: str def __eq__(self, other: Any) -> bool: @@ -5628,18 +5549,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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()) + self.fields = fields + self.type_ = type_ + self.label = label + self.doc = doc + self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) attrs: ClassVar[Collection[str]] = frozenset( ["fields", "type", "label", "doc", "name"] ) -class InputEnumSchema(EnumSchema, InputSchema): +class InputEnumSchema(EnumSchema): name: str def __eq__(self, other: Any) -> bool: @@ -6008,18 +5929,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols = symbols + self.type_ = type_ + self.label = label + self.doc = doc attrs: ClassVar[Collection[str]] = frozenset( ["name", "symbols", "type", "label", "doc"] ) -class InputArraySchema(CWLArraySchema, InputSchema): +class InputArraySchema(CWLArraySchema): name: str def __eq__(self, other: Any) -> bool: @@ -6388,18 +6309,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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()) + self.items = items + self.type_ = type_ + self.label = label + self.doc = doc + self.name = 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): +class OutputRecordField(CWLRecordField): name: str def __eq__(self, other: Any) -> bool: @@ -6891,20 +6812,20 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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 + self.doc = doc + self.name = name + self.type_ = type_ + self.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.format = format attrs: ClassVar[Collection[str]] = frozenset( ["doc", "name", "type", "label", "secondaryFiles", "streamable", "format"] ) -class OutputRecordSchema(CWLRecordSchema, OutputSchema): +class OutputRecordSchema(CWLRecordSchema): name: str def __eq__(self, other: Any) -> bool: @@ -7273,18 +7194,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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()) + self.fields = fields + self.type_ = type_ + self.label = label + self.doc = doc + self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) attrs: ClassVar[Collection[str]] = frozenset( ["fields", "type", "label", "doc", "name"] ) -class OutputEnumSchema(EnumSchema, OutputSchema): +class OutputEnumSchema(EnumSchema): name: str def __eq__(self, other: Any) -> bool: @@ -7653,18 +7574,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols = symbols + self.type_ = type_ + self.label = label + self.doc = doc attrs: ClassVar[Collection[str]] = frozenset( ["name", "symbols", "type", "label", "doc"] ) -class OutputArraySchema(CWLArraySchema, OutputSchema): +class OutputArraySchema(CWLArraySchema): name: str def __eq__(self, other: Any) -> bool: @@ -8033,76 +7954,18 @@ def __init__( 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()) + self.items = items + self.type_ = type_ + self.label = label + self.doc = doc + self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) attrs: ClassVar[Collection[str]] = frozenset( ["items", "type", "label", "doc", "name"] ) -@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 - - -@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 - [`Process.requirements`](#process). - - Process requirements are the primary mechanism for specifying extensions to - the CWL core specification. - - """ - - pass - - -@trait -class Process(Identified, Labeled, Documented, metaclass=ABCMeta): - """ - - The base executable type in CWL is the `Process` object defined by the - document. Note that the `Process` object is abstract and cannot be - directly executed. - - """ - - 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): +class InlineJavascriptRequirement(Saveable): """ Indicates that the workflow platform must support inline Javascript expressions. If this requirement is not present, the workflow platform must not perform expression @@ -8279,17 +8142,12 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "InlineJavascriptRequirement" - self.expressionLib: None | Sequence[str] = expressionLib + self.expressionLib = expressionLib attrs: ClassVar[Collection[str]] = frozenset(["class", "expressionLib"]) -@trait -class CommandInputSchema(Saveable, metaclass=ABCMeta): - pass - - -class SchemaDefRequirement(ProcessRequirement): +class SchemaDefRequirement(Saveable): """ This field consists of an array of type definitions which must be used when interpreting the `inputs` and `outputs` fields. When a `type` field @@ -8465,7 +8323,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "SchemaDefRequirement" - self.types: Sequence[CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema] = types + self.types = types attrs: ClassVar[Collection[str]] = frozenset(["class", "types"]) @@ -8665,13 +8523,13 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.pattern: str = pattern - self.required: None | bool | str = required + self.pattern = pattern + self.required = required attrs: ClassVar[Collection[str]] = frozenset(["pattern", "required"]) -class LoadListingRequirement(ProcessRequirement): +class LoadListingRequirement(Saveable): """ Specify the desired behavior for loading the `listing` field of a Directory object for use by expressions. @@ -8846,7 +8704,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "LoadListingRequirement" - self.loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = loadListing + self.loadListing = loadListing attrs: ClassVar[Collection[str]] = frozenset(["class", "loadListing"]) @@ -9054,8 +8912,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.envName: str = envName - self.envValue: str = envValue + self.envName = envName + self.envValue = envValue attrs: ClassVar[Collection[str]] = frozenset(["envName", "envValue"]) @@ -9586,13 +9444,13 @@ def __init__( 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 + self.loadContents = loadContents + self.position = position + self.prefix = prefix + self.separate = separate + self.itemSeparator = itemSeparator + self.valueFrom = valueFrom + self.shellQuote = shellQuote attrs: ClassVar[Collection[str]] = frozenset( [ @@ -9607,7 +9465,7 @@ def __init__( ) -class CommandOutputBinding(LoadContents): +class CommandOutputBinding(Saveable): """ Describes how to generate an output parameter based on the files produced by a CommandLineTool. @@ -9933,22 +9791,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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 + self.loadContents = loadContents + self.loadListing = loadListing + self.glob = glob + self.outputEval = outputEval attrs: ClassVar[Collection[str]] = frozenset( ["loadContents", "loadListing", "glob", "outputEval"] ) -@trait -class CommandLineBindable(Saveable, metaclass=ABCMeta): - inputBinding: CommandLineBinding | None - - -class CommandInputRecordField(InputRecordField, CommandLineBindable): +class CommandInputRecordField(InputRecordField): name: str def __eq__(self, other: Any) -> bool: @@ -10614,16 +10467,16 @@ def __init__( 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 + self.doc = doc + self.name = name + self.type_ = type_ + self.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.format = format + self.loadContents = loadContents + self.loadListing = loadListing + self.inputBinding = inputBinding attrs: ClassVar[Collection[str]] = frozenset( [ @@ -10641,9 +10494,7 @@ def __init__( ) -class CommandInputRecordSchema( - InputRecordSchema, CommandInputSchema, CommandLineBindable -): +class CommandInputRecordSchema(InputRecordSchema): name: str def __eq__(self, other: Any) -> bool: @@ -11078,19 +10929,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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 + 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 attrs: ClassVar[Collection[str]] = frozenset( ["fields", "type", "label", "doc", "name", "inputBinding"] ) -class CommandInputEnumSchema(InputEnumSchema, CommandInputSchema, CommandLineBindable): +class CommandInputEnumSchema(InputEnumSchema): name: str def __eq__(self, other: Any) -> bool: @@ -11525,21 +11376,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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 + 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 attrs: ClassVar[Collection[str]] = frozenset( ["name", "symbols", "type", "label", "doc", "inputBinding"] ) -class CommandInputArraySchema( - InputArraySchema, CommandInputSchema, CommandLineBindable -): +class CommandInputArraySchema(InputArraySchema): name: str def __eq__(self, other: Any) -> bool: @@ -11967,12 +11816,12 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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 + 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 attrs: ClassVar[Collection[str]] = frozenset( ["items", "type", "label", "doc", "name", "inputBinding"] @@ -12529,14 +12378,14 @@ def __init__( 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 + self.doc = doc + self.name = name + self.type_ = type_ + self.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.format = format + self.outputBinding = outputBinding attrs: ClassVar[Collection[str]] = frozenset( [ @@ -12921,11 +12770,11 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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()) + self.fields = fields + self.type_ = type_ + self.label = label + self.doc = doc + self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) attrs: ClassVar[Collection[str]] = frozenset( ["fields", "type", "label", "doc", "name"] @@ -13301,11 +13150,11 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols = symbols + self.type_ = type_ + self.label = label + self.doc = doc attrs: ClassVar[Collection[str]] = frozenset( ["name", "symbols", "type", "label", "doc"] @@ -13681,18 +13530,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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()) + self.items = items + self.type_ = type_ + self.label = label + self.doc = doc + self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) attrs: ClassVar[Collection[str]] = frozenset( ["items", "type", "label", "doc", "name"] ) -class CommandInputParameter(InputParameter): +class CommandInputParameter(Saveable): """ An input parameter for a CommandLineTool. """ @@ -14417,17 +14266,17 @@ def __init__( 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 + self.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.format = format + self.loadContents = loadContents + self.loadListing = loadListing + self.default = default + self.type_ = type_ + self.inputBinding = inputBinding attrs: ClassVar[Collection[str]] = frozenset( [ @@ -14446,7 +14295,7 @@ def __init__( ) -class CommandOutputParameter(OutputParameter): +class CommandOutputParameter(Saveable): """ An output parameter for a CommandLineTool. """ @@ -15000,14 +14849,14 @@ def __init__( 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 + self.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.format = format + self.type_ = type_ + self.outputBinding = outputBinding attrs: ClassVar[Collection[str]] = frozenset( [ @@ -15023,7 +14872,7 @@ def __init__( ) -class CommandLineTool(Process): +class CommandLineTool(Saveable): """ This defines the schema of the CWL Command Line Tool Description document. @@ -16051,23 +15900,23 @@ def __init__( 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.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_: 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 + self.baseCommand = baseCommand + self.arguments = arguments + self.stdin = stdin + self.stderr = stderr + self.stdout = stdout + self.successCodes = successCodes + self.temporaryFailCodes = temporaryFailCodes + self.permanentFailCodes = permanentFailCodes attrs: ClassVar[Collection[str]] = frozenset( [ @@ -16092,7 +15941,7 @@ def __init__( ) -class DockerRequirement(ProcessRequirement): +class DockerRequirement(Saveable): """ Indicates that a workflow component should be run in a [Docker](http://docker.com) or Docker-compatible (such as @@ -16612,12 +16461,12 @@ def __init__( 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 + self.dockerPull = dockerPull + self.dockerLoad = dockerLoad + self.dockerFile = dockerFile + self.dockerImport = dockerImport + self.dockerImageId = dockerImageId + self.dockerOutputDirectory = dockerOutputDirectory attrs: ClassVar[Collection[str]] = frozenset( [ @@ -16632,7 +16481,7 @@ def __init__( ) -class SoftwareRequirement(ProcessRequirement): +class SoftwareRequirement(Saveable): """ A list of software packages that should be configured in the environment of the defined process. @@ -16803,7 +16652,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "SoftwareRequirement" - self.packages: Sequence[SoftwarePackage] = packages + self.packages = packages attrs: ClassVar[Collection[str]] = frozenset(["class", "packages"]) @@ -17057,9 +16906,9 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.package: str = package - self.version: None | Sequence[str] = version - self.specs: None | Sequence[str] = specs + self.package = package + self.version = version + self.specs = specs attrs: ClassVar[Collection[str]] = frozenset(["package", "version", "specs"]) @@ -17325,14 +17174,14 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.entryname: None | str = entryname - self.entry: str = entry - self.writable: None | bool = writable + self.entryname = entryname + self.entry = entry + self.writable = writable attrs: ClassVar[Collection[str]] = frozenset(["entryname", "entry", "writable"]) -class InitialWorkDirRequirement(ProcessRequirement): +class InitialWorkDirRequirement(Saveable): """ 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. """ @@ -17501,12 +17350,12 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "InitialWorkDirRequirement" - self.listing: Sequence[Directory | Dirent | File | None | Sequence[Directory | File] | str] | str = listing + self.listing = listing attrs: ClassVar[Collection[str]] = frozenset(["class", "listing"]) -class EnvVarRequirement(ProcessRequirement): +class EnvVarRequirement(Saveable): """ Define a list of environment variables which will be set in the execution environment of the tool. See `EnvironmentDef` for details. @@ -17677,17 +17526,17 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "EnvVarRequirement" - self.envDef: Sequence[EnvironmentDef] = envDef + self.envDef = envDef attrs: ClassVar[Collection[str]] = frozenset(["class", "envDef"]) -class ShellCommandRequirement(ProcessRequirement): +class ShellCommandRequirement(Saveable): """ Modify the behavior of CommandLineTool to generate a single string containing a shell command line. Each item in the argument list must be joined into a string separated by single spaces and quoted to prevent - intepretation by the shell, unless `CommandLineBinding` for that argument + interpretation by the shell, unless `CommandLineBinding` for that argument contains `shellQuote: false`. If `shellQuote: false` is specified, the argument is joined into the command string without quoting, which allows the use of shell metacharacters such as `|` for pipes. @@ -17806,7 +17655,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class"]) -class ResourceRequirement(ProcessRequirement): +class ResourceRequirement(Saveable): """ Specify basic hardware resource requirements. @@ -18399,14 +18248,14 @@ def __init__( 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 + self.coresMin = coresMin + self.coresMax = coresMax + self.ramMin = ramMin + self.ramMax = ramMax + self.tmpdirMin = tmpdirMin + self.tmpdirMax = tmpdirMax + self.outdirMin = outdirMin + self.outdirMax = outdirMax attrs: ClassVar[Collection[str]] = frozenset( [ @@ -18423,12 +18272,12 @@ def __init__( ) -class WorkReuse(ProcessRequirement): +class WorkReuse(Saveable): """ For implementations that support reusing output from past work (on the assumption that same code and same input produce same results), control whether to enable or disable the reuse behavior - for a particular tool or step (to accomodate situations where that + for a particular tool or step (to accommodate situations where that assumption is incorrect). A reused step is not executed but instead returns the same output as the original execution. @@ -18606,12 +18455,12 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "WorkReuse" - self.enableReuse: bool | str = enableReuse + self.enableReuse = enableReuse attrs: ClassVar[Collection[str]] = frozenset(["class", "enableReuse"]) -class NetworkAccess(ProcessRequirement): +class NetworkAccess(Saveable): """ Indicate whether a process requires outgoing IPv4/IPv6 network access. Choice of IPv4 or IPv6 is implementation and site @@ -18626,7 +18475,7 @@ class NetworkAccess(ProcessRequirement): may apply their own security policies to restrict what is accessible by the tool. - Enabling network access does not imply a publically routable IP + Enabling network access does not imply a publicly routable IP address or the ability to accept inbound connections. """ @@ -18801,12 +18650,12 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "NetworkAccess" - self.networkAccess: bool | str = networkAccess + self.networkAccess = networkAccess attrs: ClassVar[Collection[str]] = frozenset(["class", "networkAccess"]) -class InplaceUpdateRequirement(ProcessRequirement): +class InplaceUpdateRequirement(Saveable): """ If `inplaceUpdate` is true, then an implementation supporting this @@ -18824,7 +18673,7 @@ class InplaceUpdateRequirement(ProcessRequirement): read-only in every step. Workflow steps which modify a file must produce the modified file - as output. Downstream steps which futher process the file must + as output. Downstream steps which further process the file must use the output of previous steps, and not refer to a common input (this is necessary for both ordering and correctness). @@ -19011,12 +18860,12 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "InplaceUpdateRequirement" - self.inplaceUpdate: bool = inplaceUpdate + self.inplaceUpdate = inplaceUpdate attrs: ClassVar[Collection[str]] = frozenset(["class", "inplaceUpdate"]) -class ToolTimeLimit(ProcessRequirement): +class ToolTimeLimit(Saveable): """ Set an upper limit on the execution time of a CommandLineTool. A CommandLineTool whose execution duration exceeds the time @@ -19197,12 +19046,12 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "ToolTimeLimit" - self.timelimit: i32 | str = timelimit + self.timelimit = timelimit attrs: ClassVar[Collection[str]] = frozenset(["class", "timelimit"]) -class ExpressionToolOutputParameter(OutputParameter): +class ExpressionToolOutputParameter(Saveable): id: str def __eq__(self, other: Any) -> bool: @@ -19694,20 +19543,20 @@ def __init__( 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_ + self.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.format = format + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset( ["label", "secondaryFiles", "streamable", "doc", "id", "format", "type"] ) -class WorkflowInputParameter(InputParameter): +class WorkflowInputParameter(Saveable): id: str def __eq__(self, other: Any) -> bool: @@ -20428,17 +20277,17 @@ def __init__( 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 + self.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.format = format + self.loadContents = loadContents + self.loadListing = loadListing + self.default = default + self.type_ = type_ + self.inputBinding = inputBinding attrs: ClassVar[Collection[str]] = frozenset( [ @@ -20457,7 +20306,7 @@ def __init__( ) -class ExpressionTool(Process): +class ExpressionTool(Saveable): """ An ExpressionTool is a type of Process object that can be run by itself or as a Workflow step. It executes a pure Javascript expression that has @@ -21098,16 +20947,16 @@ def __init__( 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.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_: Final[str] = "ExpressionTool" - self.expression: str = expression + self.expression = expression attrs: ClassVar[Collection[str]] = frozenset( [ @@ -21125,7 +20974,7 @@ def __init__( ) -class WorkflowOutputParameter(OutputParameter): +class WorkflowOutputParameter(Saveable): """ Describe an output parameter of a workflow. The parameter must be connected to one or more parameters defined in the workflow that @@ -21734,15 +21583,15 @@ def __init__( 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_ + self.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.format = format + self.outputSource = outputSource + self.linkMerge = linkMerge + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset( [ @@ -21759,19 +21608,13 @@ def __init__( ) -@trait -class Sink(Saveable, metaclass=ABCMeta): - source: None | Sequence[str] | str - linkMerge: Literal["merge_nested", "merge_flattened"] | None - - -class WorkflowStepInput(IdentifierRequired, Sink, LoadContents, Labeled): +class WorkflowStepInput(Saveable): """ The input of a workflow step connects an upstream parameter (from the workflow inputs, or the outputs of other workflows steps) with the input parameters of the process specified by the `run` field. Only input parameters declared by the target process will be passed through at runtime to the process - though additonal parameters may be specified (for use within `valueFrom` + though additional parameters may be specified (for use within `valueFrom` expressions for instance) - unconnected or unused parameters do not represent an error condition. @@ -22358,14 +22201,14 @@ def __init__( 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 + self.id = id + self.source = source + self.linkMerge = linkMerge + self.loadContents = loadContents + self.loadListing = loadListing + self.label = label + self.default = default + self.valueFrom = valueFrom attrs: ClassVar[Collection[str]] = frozenset( [ @@ -22381,7 +22224,7 @@ def __init__( ) -class WorkflowStepOutput(IdentifierRequired): +class WorkflowStepOutput(Saveable): """ Associate an output parameter of the underlying process with a workflow parameter. The workflow parameter (given in the `id` field) be may be used @@ -22541,12 +22384,12 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.id: str = id + self.id = id attrs: ClassVar[Collection[str]] = frozenset(["id"]) -class WorkflowStep(IdentifierRequired, Labeled, Documented): +class WorkflowStep(Saveable): """ A workflow step is an executable element of a workflow. It specifies the underlying process implementation (such as `CommandLineTool` or another @@ -23262,16 +23105,16 @@ def __init__( 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 + self.id = id + 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 attrs: ClassVar[Collection[str]] = frozenset( [ @@ -23289,7 +23132,7 @@ def __init__( ) -class Workflow(Process): +class Workflow(Saveable): """ A workflow describes a set of **steps** and the **dependencies** between those steps. When a step produces output that will be consumed by a @@ -23309,7 +23152,7 @@ class Workflow(Process): The `source` field expresses the dependency of one parameter on another such that when a value is associated with the parameter specified by `source`, that value is propagated to the destination parameter. When all - data links inbound to a given step are fufilled, the step is ready to + data links inbound to a given step are fulfilled, the step is ready to execute. ## Workflow success and failure @@ -23965,16 +23808,16 @@ def __init__( 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.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_: Final[str] = "Workflow" - self.steps: Sequence[WorkflowStep] = steps + self.steps = steps attrs: ClassVar[Collection[str]] = frozenset( [ @@ -23992,7 +23835,7 @@ def __init__( ) -class SubworkflowFeatureRequirement(ProcessRequirement): +class SubworkflowFeatureRequirement(Saveable): """ Indicates that the workflow platform must support nested workflows in the `run` field of [WorkflowStep](#WorkflowStep). @@ -24111,7 +23954,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class"]) -class ScatterFeatureRequirement(ProcessRequirement): +class ScatterFeatureRequirement(Saveable): """ Indicates that the workflow platform must support the `scatter` and `scatterMethod` fields of [WorkflowStep](#WorkflowStep). @@ -24230,7 +24073,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class"]) -class MultipleInputFeatureRequirement(ProcessRequirement): +class MultipleInputFeatureRequirement(Saveable): """ Indicates that the workflow platform must support multiple inbound data links listed in the `source` field of [WorkflowStepInput](#WorkflowStepInput). @@ -24349,7 +24192,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class"]) -class StepInputExpressionRequirement(ProcessRequirement): +class StepInputExpressionRequirement(Saveable): """ Indicate that the workflow platform must support the `valueFrom` field of [WorkflowStepInput](#WorkflowStepInput). @@ -24468,7 +24311,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class"]) -class Secrets(ProcessRequirement): +class Secrets(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, Secrets): return bool(self.class_ == other.class_ and self.secrets == other.secrets) @@ -24632,12 +24475,12 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "Secrets" - self.secrets: Sequence[str] = secrets + self.secrets = secrets attrs: ClassVar[Collection[str]] = frozenset(["class", "secrets"]) -class ProcessGenerator(Process): +class ProcessGenerator(Saveable): id: str def __eq__(self, other: Any) -> bool: @@ -25265,16 +25108,16 @@ def __init__( 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.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_: Final[str] = "ProcessGenerator" - self.run: CommandLineTool | ExpressionTool | ProcessGenerator | Workflow | str = run + self.run = run attrs: ClassVar[Collection[str]] = frozenset( [ @@ -25292,7 +25135,7 @@ def __init__( ) -class MPIRequirement(ProcessRequirement): +class MPIRequirement(Saveable): """ Indicates that a process requires an MPI runtime. @@ -25467,12 +25310,12 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "MPIRequirement" - self.processes: i32 | str = processes + self.processes = processes attrs: ClassVar[Collection[str]] = frozenset(["class", "processes"]) -class CUDARequirement(ProcessRequirement): +class CUDARequirement(Saveable): """ Require support for NVIDA CUDA (GPU hardware acceleration). @@ -25828,10 +25671,10 @@ def __init__( 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 + self.cudaComputeCapability = cudaComputeCapability + self.cudaDeviceCountMax = cudaDeviceCountMax + self.cudaDeviceCountMin = cudaDeviceCountMin + self.cudaVersionMin = cudaVersionMin attrs: ClassVar[Collection[str]] = frozenset( [ @@ -25844,7 +25687,7 @@ def __init__( ) -class ShmSize(ProcessRequirement): +class ShmSize(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, ShmSize): return bool(self.class_ == other.class_ and self.shmSize == other.shmSize) @@ -26009,7 +25852,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "ShmSize" - self.shmSize: str = shmSize + self.shmSize = shmSize attrs: ClassVar[Collection[str]] = frozenset(["class", "shmSize"]) @@ -27711,6 +27554,61 @@ def __init__( "Directory | File | Mapping[str, CWLObjectType | None] | Sequence[CWLObjectType | None] | bool | float | i32 | i64 | str" ) +Sink: TypeAlias = WorkflowStepInput +InputSchema: TypeAlias = InputArraySchema | InputEnumSchema | InputRecordSchema +OutputSchema: TypeAlias = OutputArraySchema | OutputEnumSchema | OutputRecordSchema +InputParameter: TypeAlias = CommandInputParameter | WorkflowInputParameter +OutputParameter: TypeAlias = ( + CommandOutputParameter | ExpressionToolOutputParameter | WorkflowOutputParameter +) +ProcessRequirement: TypeAlias = ( + CUDARequirement + | DockerRequirement + | EnvVarRequirement + | InitialWorkDirRequirement + | InlineJavascriptRequirement + | InplaceUpdateRequirement + | LoadListingRequirement + | MPIRequirement + | MultipleInputFeatureRequirement + | NetworkAccess + | ResourceRequirement + | ScatterFeatureRequirement + | SchemaDefRequirement + | Secrets + | ShellCommandRequirement + | ShmSize + | SoftwareRequirement + | StepInputExpressionRequirement + | SubworkflowFeatureRequirement + | ToolTimeLimit + | WorkReuse +) +Process: TypeAlias = CommandLineTool | ExpressionTool | ProcessGenerator | Workflow +CommandInputSchema: TypeAlias = ( + CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema +) +CommandLineBindable: TypeAlias = ( + CommandInputArraySchema + | CommandInputEnumSchema + | CommandInputRecordField + | CommandInputRecordSchema +) +IOSchema: TypeAlias = InputSchema | OutputSchema +LoadContents: TypeAlias = ( + CommandOutputBinding | InputParameter | InputRecordField | WorkflowStepInput +) +InputFormat: TypeAlias = InputParameter | InputRecordField +OutputFormat: TypeAlias = OutputParameter | OutputRecordField +Parameter: TypeAlias = InputParameter | OutputParameter +Documented: TypeAlias = IOSchema | Parameter | Process | RecordField | WorkflowStep +IdentifierRequired: TypeAlias = ( + Parameter | WorkflowStep | WorkflowStepInput | WorkflowStepOutput +) +FieldBase: TypeAlias = InputRecordField | OutputRecordField | Parameter +Identified: TypeAlias = IdentifierRequired | Process +Labeled: TypeAlias = FieldBase | IOSchema | Process | WorkflowStep | WorkflowStepInput + def load_document( doc: Any, diff --git a/cwl_utils/parser/cwl_v1_1_utils.py b/cwl_utils/parser/cwl_v1_1_utils.py index eaa21dc5..5c528fbc 100644 --- a/cwl_utils/parser/cwl_v1_1_utils.py +++ b/cwl_utils/parser/cwl_v1_1_utils.py @@ -334,7 +334,14 @@ def check_all_types( case _: raise WorkflowException(f"Invalid sink type {sink.__class__.__name__}") if sourceField is not None: - if isinstance(sourceField, str): + if is_sequence(sourceField): + 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 = sourceField if parm_id not in src_dict: raise SourceLine(sink, sourceName, ValidationException).makeError( @@ -342,13 +349,6 @@ def check_all_types( ) 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)], @@ -600,21 +600,21 @@ def type_for_source( for _ in range(scatter_context[0][0]): new_type = cwl.OutputArraySchema( items=in_output_type_schema_to_output_type_schema( - new_type, process.loadingOptions # type: ignore[attr-defined] + new_type, process.loadingOptions ), type_="array", ) else: new_type = cwl.OutputArraySchema( items=in_output_type_schema_to_output_type_schema( - new_type, process.loadingOptions # type: ignore[attr-defined] + new_type, process.loadingOptions ), type_="array", ) if linkMerge == "merge_nested": new_type = cwl.OutputArraySchema( items=in_output_type_schema_to_output_type_schema( - new_type, process.loadingOptions # type: ignore[attr-defined] + new_type, process.loadingOptions ), type_="array", ) @@ -637,14 +637,14 @@ def type_for_source( for _ in range(sc[0]): cur_type = cwl.OutputArraySchema( items=in_output_type_schema_to_output_type_schema( - cur_type, process.loadingOptions # type: ignore[attr-defined] + cur_type, process.loadingOptions ), type_="array", ) else: cur_type = cwl.OutputArraySchema( items=in_output_type_schema_to_output_type_schema( - cur_type, process.loadingOptions # type: ignore[attr-defined] + cur_type, process.loadingOptions ), type_="array", ) diff --git a/cwl_utils/parser/cwl_v1_2.py b/cwl_utils/parser/cwl_v1_2.py index be96ca70..4b7fa99d 100644 --- a/cwl_utils/parser/cwl_v1_2.py +++ b/cwl_utils/parser/cwl_v1_2.py @@ -14,13 +14,13 @@ import uuid as _uuid__ # pylint: disable=unused-import # noqa: F401 import xml.sax # nosec from abc import ABCMeta, abstractmethod -from collections.abc import MutableMapping, MutableSequence, Sequence from collections.abc import Collection # pylint: disable=unused-import # noqa: F401 +from collections.abc import MutableMapping, MutableSequence, Sequence from io import StringIO from itertools import chain -from mypy_extensions import i32, i64, trait -from typing import Any, Final, Generic, TypeAlias, TypeVar, cast +from mypy_extensions import i32, i64 from typing import ClassVar, Literal, Mapping # pylint: disable=unused-import # noqa: F401 +from typing import Any, Final, Generic, TypeAlias, TypeVar, cast from urllib.parse import quote, urldefrag, urlparse, urlsplit, urlunsplit from urllib.request import pathname2url @@ -213,7 +213,6 @@ def graph(self) -> Graph: return graph -@trait class Saveable(metaclass=ABCMeta): """Mark classes than have a save() and fromDoc() function.""" @@ -1186,12 +1185,7 @@ def parser_info() -> str: return "org.w3id.cwl.v1_2" -@trait -class Documented(Saveable, metaclass=ABCMeta): - doc: None | Sequence[str] | str - - -class RecordField(Documented): +class RecordField(Saveable): """ A field of a record. """ @@ -1456,9 +1450,9 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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_ + self.doc = doc + self.name = name + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset(["doc", "name", "type"]) @@ -1656,8 +1650,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields: None | Sequence[RecordField] = fields - self.type_: Literal["record"] = type_ + self.fields = fields + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset(["fields", "type"]) @@ -1928,9 +1922,9 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.name: str = name if name is not None else "_:" + str(_uuid__.uuid4()) - self.symbols: Sequence[str] = symbols - self.type_: Literal["enum"] = type_ + self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols = symbols + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset(["name", "symbols", "type"]) @@ -2128,8 +2122,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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_ + self.items = items + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset(["items", "type"]) @@ -2327,8 +2321,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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 + self.type_ = type_ + self.values = values attrs: ClassVar[Collection[str]] = frozenset(["type", "values"]) @@ -2526,8 +2520,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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_ + self.names = names + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset(["names", "type"]) @@ -2725,8 +2719,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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_ + self.items = items + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset(["items", "type"]) @@ -2992,9 +2986,9 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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_ + self.doc = doc + self.name = name + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset(["doc", "name", "type"]) @@ -3192,8 +3186,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.fields: None | Sequence[CWLRecordField] = fields - self.type_: Literal["record"] = type_ + self.fields = fields + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset(["fields", "type"]) @@ -3990,17 +3984,17 @@ def __init__( 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 + 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 attrs: ClassVar[Collection[str]] = frozenset( [ @@ -4396,68 +4390,16 @@ def __init__( 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 + self.location = location + self.path = path + self.basename = basename + self.listing = listing attrs: ClassVar[Collection[str]] = frozenset( ["class", "location", "path", "basename", "listing"] ) -@trait -class Labeled(Saveable, metaclass=ABCMeta): - label: None | str - - -@trait -class Identified(Saveable, metaclass=ABCMeta): - id: None | str - - -@trait -class IdentifierRequired(Identified, metaclass=ABCMeta): - id: str - - -@trait -class LoadContents(Saveable, metaclass=ABCMeta): - loadContents: None | bool - loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None - - -@trait -class FieldBase(Labeled, metaclass=ABCMeta): - label: None | str - secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] - streamable: None | bool - - -@trait -class InputFormat(Saveable, metaclass=ABCMeta): - format: None | Sequence[str] | str - - -@trait -class OutputFormat(Saveable, metaclass=ABCMeta): - format: None | str - - -@trait -class Parameter(FieldBase, Documented, IdentifierRequired, metaclass=ABCMeta): - """ - Define an input or output parameter to a process. - - """ - - label: None | str - secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] - streamable: None | bool - doc: None | Sequence[str] | str - id: str - - class InputBinding(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, InputBinding): @@ -4600,33 +4542,12 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.loadContents: None | bool = loadContents + self.loadContents = 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): +class InputRecordField(CWLRecordField): name: str def __eq__(self, other: Any) -> bool: @@ -5234,15 +5155,15 @@ def __init__( 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 + self.doc = doc + self.name = name + self.type_ = type_ + self.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.format = format + self.loadContents = loadContents + self.loadListing = loadListing attrs: ClassVar[Collection[str]] = frozenset( [ @@ -5259,7 +5180,7 @@ def __init__( ) -class InputRecordSchema(CWLRecordSchema, InputSchema): +class InputRecordSchema(CWLRecordSchema): name: str def __eq__(self, other: Any) -> bool: @@ -5628,18 +5549,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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()) + self.fields = fields + self.type_ = type_ + self.label = label + self.doc = doc + self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) attrs: ClassVar[Collection[str]] = frozenset( ["fields", "type", "label", "doc", "name"] ) -class InputEnumSchema(EnumSchema, InputSchema): +class InputEnumSchema(EnumSchema): name: str def __eq__(self, other: Any) -> bool: @@ -6008,18 +5929,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols = symbols + self.type_ = type_ + self.label = label + self.doc = doc attrs: ClassVar[Collection[str]] = frozenset( ["name", "symbols", "type", "label", "doc"] ) -class InputArraySchema(CWLArraySchema, InputSchema): +class InputArraySchema(CWLArraySchema): name: str def __eq__(self, other: Any) -> bool: @@ -6388,18 +6309,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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()) + self.items = items + self.type_ = type_ + self.label = label + self.doc = doc + self.name = 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): +class OutputRecordField(CWLRecordField): name: str def __eq__(self, other: Any) -> bool: @@ -6891,20 +6812,20 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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 + self.doc = doc + self.name = name + self.type_ = type_ + self.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.format = format attrs: ClassVar[Collection[str]] = frozenset( ["doc", "name", "type", "label", "secondaryFiles", "streamable", "format"] ) -class OutputRecordSchema(CWLRecordSchema, OutputSchema): +class OutputRecordSchema(CWLRecordSchema): name: str def __eq__(self, other: Any) -> bool: @@ -7273,18 +7194,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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()) + self.fields = fields + self.type_ = type_ + self.label = label + self.doc = doc + self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) attrs: ClassVar[Collection[str]] = frozenset( ["fields", "type", "label", "doc", "name"] ) -class OutputEnumSchema(EnumSchema, OutputSchema): +class OutputEnumSchema(EnumSchema): name: str def __eq__(self, other: Any) -> bool: @@ -7653,18 +7574,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols = symbols + self.type_ = type_ + self.label = label + self.doc = doc attrs: ClassVar[Collection[str]] = frozenset( ["name", "symbols", "type", "label", "doc"] ) -class OutputArraySchema(CWLArraySchema, OutputSchema): +class OutputArraySchema(CWLArraySchema): name: str def __eq__(self, other: Any) -> bool: @@ -8033,77 +7954,18 @@ def __init__( 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()) + self.items = items + self.type_ = type_ + self.label = label + self.doc = doc + self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) attrs: ClassVar[Collection[str]] = frozenset( ["items", "type", "label", "doc", "name"] ) -@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 - - -@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 - [`Process.requirements`](#process). - - Process requirements are the primary mechanism for specifying extensions to - the CWL core specification. - - """ - - pass - - -@trait -class Process(Identified, Labeled, Documented, metaclass=ABCMeta): - """ - - The base executable type in CWL is the `Process` object defined by the - document. Note that the `Process` object is abstract and cannot be - directly executed. - - """ - - 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): +class InlineJavascriptRequirement(Saveable): """ Indicates that the workflow platform must support inline Javascript expressions. If this requirement is not present, the workflow platform must not perform expression @@ -8280,17 +8142,12 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "InlineJavascriptRequirement" - self.expressionLib: None | Sequence[str] = expressionLib + self.expressionLib = expressionLib attrs: ClassVar[Collection[str]] = frozenset(["class", "expressionLib"]) -@trait -class CommandInputSchema(Saveable, metaclass=ABCMeta): - pass - - -class SchemaDefRequirement(ProcessRequirement): +class SchemaDefRequirement(Saveable): """ This field consists of an array of type definitions which must be used when interpreting the `inputs` and `outputs` fields. When a `type` field @@ -8471,7 +8328,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "SchemaDefRequirement" - self.types: Sequence[CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema] = types + self.types = types attrs: ClassVar[Collection[str]] = frozenset(["class", "types"]) @@ -8688,13 +8545,13 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.pattern: str = pattern - self.required: None | bool | str = required + self.pattern = pattern + self.required = required attrs: ClassVar[Collection[str]] = frozenset(["pattern", "required"]) -class LoadListingRequirement(ProcessRequirement): +class LoadListingRequirement(Saveable): """ Specify the desired behavior for loading the `listing` field of a Directory object for use by expressions. @@ -8869,7 +8726,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "LoadListingRequirement" - self.loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = loadListing + self.loadListing = loadListing attrs: ClassVar[Collection[str]] = frozenset(["class", "loadListing"]) @@ -9077,8 +8934,8 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.envName: str = envName - self.envValue: str = envValue + self.envName = envName + self.envValue = envValue attrs: ClassVar[Collection[str]] = frozenset(["envName", "envValue"]) @@ -9609,13 +9466,13 @@ def __init__( 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 + self.loadContents = loadContents + self.position = position + self.prefix = prefix + self.separate = separate + self.itemSeparator = itemSeparator + self.valueFrom = valueFrom + self.shellQuote = shellQuote attrs: ClassVar[Collection[str]] = frozenset( [ @@ -9630,7 +9487,7 @@ def __init__( ) -class CommandOutputBinding(LoadContents): +class CommandOutputBinding(Saveable): """ Describes how to generate an output parameter based on the files produced by a CommandLineTool. @@ -9956,22 +9813,17 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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 + self.loadContents = loadContents + self.loadListing = loadListing + self.glob = glob + self.outputEval = outputEval attrs: ClassVar[Collection[str]] = frozenset( ["loadContents", "loadListing", "glob", "outputEval"] ) -@trait -class CommandLineBindable(Saveable, metaclass=ABCMeta): - inputBinding: CommandLineBinding | None - - -class CommandInputRecordField(InputRecordField, CommandLineBindable): +class CommandInputRecordField(InputRecordField): name: str def __eq__(self, other: Any) -> bool: @@ -10637,16 +10489,16 @@ def __init__( 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 + self.doc = doc + self.name = name + self.type_ = type_ + self.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.format = format + self.loadContents = loadContents + self.loadListing = loadListing + self.inputBinding = inputBinding attrs: ClassVar[Collection[str]] = frozenset( [ @@ -10664,9 +10516,7 @@ def __init__( ) -class CommandInputRecordSchema( - InputRecordSchema, CommandInputSchema, CommandLineBindable -): +class CommandInputRecordSchema(InputRecordSchema): name: str def __eq__(self, other: Any) -> bool: @@ -11101,19 +10951,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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 + 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 attrs: ClassVar[Collection[str]] = frozenset( ["fields", "type", "label", "doc", "name", "inputBinding"] ) -class CommandInputEnumSchema(InputEnumSchema, CommandInputSchema, CommandLineBindable): +class CommandInputEnumSchema(InputEnumSchema): name: str def __eq__(self, other: Any) -> bool: @@ -11548,21 +11398,19 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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 + 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 attrs: ClassVar[Collection[str]] = frozenset( ["name", "symbols", "type", "label", "doc", "inputBinding"] ) -class CommandInputArraySchema( - InputArraySchema, CommandInputSchema, CommandLineBindable -): +class CommandInputArraySchema(InputArraySchema): name: str def __eq__(self, other: Any) -> bool: @@ -11990,12 +11838,12 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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 + 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 attrs: ClassVar[Collection[str]] = frozenset( ["items", "type", "label", "doc", "name", "inputBinding"] @@ -12552,14 +12400,14 @@ def __init__( 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 + self.doc = doc + self.name = name + self.type_ = type_ + self.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.format = format + self.outputBinding = outputBinding attrs: ClassVar[Collection[str]] = frozenset( [ @@ -12944,11 +12792,11 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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()) + self.fields = fields + self.type_ = type_ + self.label = label + self.doc = doc + self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) attrs: ClassVar[Collection[str]] = frozenset( ["fields", "type", "label", "doc", "name"] @@ -13324,11 +13172,11 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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.name = name if name is not None else "_:" + str(_uuid__.uuid4()) + self.symbols = symbols + self.type_ = type_ + self.label = label + self.doc = doc attrs: ClassVar[Collection[str]] = frozenset( ["name", "symbols", "type", "label", "doc"] @@ -13704,18 +13552,18 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - 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()) + self.items = items + self.type_ = type_ + self.label = label + self.doc = doc + self.name = name if name is not None else "_:" + str(_uuid__.uuid4()) attrs: ClassVar[Collection[str]] = frozenset( ["items", "type", "label", "doc", "name"] ) -class CommandInputParameter(InputParameter): +class CommandInputParameter(Saveable): """ An input parameter for a CommandLineTool. """ @@ -14440,17 +14288,17 @@ def __init__( 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 + self.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.format = format + self.loadContents = loadContents + self.loadListing = loadListing + self.default = default + self.type_ = type_ + self.inputBinding = inputBinding attrs: ClassVar[Collection[str]] = frozenset( [ @@ -14469,7 +14317,7 @@ def __init__( ) -class CommandOutputParameter(OutputParameter): +class CommandOutputParameter(Saveable): """ An output parameter for a CommandLineTool. """ @@ -15023,14 +14871,14 @@ def __init__( 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 + self.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.format = format + self.type_ = type_ + self.outputBinding = outputBinding attrs: ClassVar[Collection[str]] = frozenset( [ @@ -15046,7 +14894,7 @@ def __init__( ) -class CommandLineTool(Process): +class CommandLineTool(Saveable): """ This defines the schema of the CWL Command Line Tool Description document. @@ -16128,24 +15976,24 @@ def __init__( 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.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_: 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 + self.baseCommand = baseCommand + self.arguments = arguments + self.stdin = stdin + self.stderr = stderr + self.stdout = stdout + self.successCodes = successCodes + self.temporaryFailCodes = temporaryFailCodes + self.permanentFailCodes = permanentFailCodes attrs: ClassVar[Collection[str]] = frozenset( [ @@ -16171,7 +16019,7 @@ def __init__( ) -class DockerRequirement(ProcessRequirement): +class DockerRequirement(Saveable): """ Indicates that a workflow component should be run in a [Docker](https://docker.com) or Docker-compatible (such as @@ -16691,12 +16539,12 @@ def __init__( 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 + self.dockerPull = dockerPull + self.dockerLoad = dockerLoad + self.dockerFile = dockerFile + self.dockerImport = dockerImport + self.dockerImageId = dockerImageId + self.dockerOutputDirectory = dockerOutputDirectory attrs: ClassVar[Collection[str]] = frozenset( [ @@ -16711,7 +16559,7 @@ def __init__( ) -class SoftwareRequirement(ProcessRequirement): +class SoftwareRequirement(Saveable): """ A list of software packages that should be configured in the environment of the defined process. @@ -16882,7 +16730,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "SoftwareRequirement" - self.packages: Sequence[SoftwarePackage] = packages + self.packages = packages attrs: ClassVar[Collection[str]] = frozenset(["class", "packages"]) @@ -17136,9 +16984,9 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.package: str = package - self.version: None | Sequence[str] = version - self.specs: None | Sequence[str] = specs + self.package = package + self.version = version + self.specs = specs attrs: ClassVar[Collection[str]] = frozenset(["package", "version", "specs"]) @@ -17408,14 +17256,14 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.entryname: None | str = entryname - self.entry: str = entry - self.writable: None | bool = writable + self.entryname = entryname + self.entry = entry + self.writable = writable attrs: ClassVar[Collection[str]] = frozenset(["entryname", "entry", "writable"]) -class InitialWorkDirRequirement(ProcessRequirement): +class InitialWorkDirRequirement(Saveable): """ 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. @@ -17585,12 +17433,12 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "InitialWorkDirRequirement" - self.listing: Sequence[Directory | Dirent | File | None | Sequence[Directory | File] | str] | str = listing + self.listing = listing attrs: ClassVar[Collection[str]] = frozenset(["class", "listing"]) -class EnvVarRequirement(ProcessRequirement): +class EnvVarRequirement(Saveable): """ Define a list of environment variables which will be set in the execution environment of the tool. See `EnvironmentDef` for details. @@ -17761,12 +17609,12 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "EnvVarRequirement" - self.envDef: Sequence[EnvironmentDef] = envDef + self.envDef = envDef attrs: ClassVar[Collection[str]] = frozenset(["class", "envDef"]) -class ShellCommandRequirement(ProcessRequirement): +class ShellCommandRequirement(Saveable): """ Modify the behavior of CommandLineTool to generate a single string containing a shell command line. Each item in the `arguments` list must @@ -17890,7 +17738,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class"]) -class ResourceRequirement(ProcessRequirement): +class ResourceRequirement(Saveable): """ Specify basic hardware resource requirements. @@ -18488,14 +18336,14 @@ def __init__( 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 + self.coresMin = coresMin + self.coresMax = coresMax + self.ramMin = ramMin + self.ramMax = ramMax + self.tmpdirMin = tmpdirMin + self.tmpdirMax = tmpdirMax + self.outdirMin = outdirMin + self.outdirMax = outdirMax attrs: ClassVar[Collection[str]] = frozenset( [ @@ -18512,7 +18360,7 @@ def __init__( ) -class WorkReuse(ProcessRequirement): +class WorkReuse(Saveable): """ For implementations that support reusing output from past work (on the assumption that same code and same input produce same @@ -18695,12 +18543,12 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "WorkReuse" - self.enableReuse: bool | str = enableReuse + self.enableReuse = enableReuse attrs: ClassVar[Collection[str]] = frozenset(["class", "enableReuse"]) -class NetworkAccess(ProcessRequirement): +class NetworkAccess(Saveable): """ Indicate whether a process requires outgoing IPv4/IPv6 network access. Choice of IPv4 or IPv6 is implementation and site @@ -18890,12 +18738,12 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "NetworkAccess" - self.networkAccess: bool | str = networkAccess + self.networkAccess = networkAccess attrs: ClassVar[Collection[str]] = frozenset(["class", "networkAccess"]) -class InplaceUpdateRequirement(ProcessRequirement): +class InplaceUpdateRequirement(Saveable): """ If `inplaceUpdate` is true, then an implementation supporting this @@ -19100,12 +18948,12 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "InplaceUpdateRequirement" - self.inplaceUpdate: bool = inplaceUpdate + self.inplaceUpdate = inplaceUpdate attrs: ClassVar[Collection[str]] = frozenset(["class", "inplaceUpdate"]) -class ToolTimeLimit(ProcessRequirement): +class ToolTimeLimit(Saveable): """ Set an upper limit on the execution time of a CommandLineTool. A CommandLineTool whose execution duration exceeds the time @@ -19286,12 +19134,12 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "ToolTimeLimit" - self.timelimit: i32 | str = timelimit + self.timelimit = timelimit attrs: ClassVar[Collection[str]] = frozenset(["class", "timelimit"]) -class ExpressionToolOutputParameter(OutputParameter): +class ExpressionToolOutputParameter(Saveable): id: str def __eq__(self, other: Any) -> bool: @@ -19783,20 +19631,20 @@ def __init__( 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_ + self.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.format = format + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset( ["label", "secondaryFiles", "streamable", "doc", "id", "format", "type"] ) -class WorkflowInputParameter(InputParameter): +class WorkflowInputParameter(Saveable): id: str def __eq__(self, other: Any) -> bool: @@ -20517,17 +20365,17 @@ def __init__( 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 + self.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.format = format + self.loadContents = loadContents + self.loadListing = loadListing + self.default = default + self.type_ = type_ + self.inputBinding = inputBinding attrs: ClassVar[Collection[str]] = frozenset( [ @@ -20546,7 +20394,7 @@ def __init__( ) -class ExpressionTool(Process): +class ExpressionTool(Saveable): """ An ExpressionTool is a type of Process object that can be run by itself or as a Workflow step. It executes a pure Javascript expression that has @@ -21241,17 +21089,17 @@ def __init__( 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.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_: Final[str] = "ExpressionTool" - self.expression: str = expression + self.expression = expression attrs: ClassVar[Collection[str]] = frozenset( [ @@ -21270,7 +21118,7 @@ def __init__( ) -class WorkflowOutputParameter(OutputParameter): +class WorkflowOutputParameter(Saveable): """ Describe an output parameter of a workflow. The parameter must be connected to one or more parameters defined in the workflow that @@ -21937,16 +21785,16 @@ def __init__( 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_ + self.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.format = format + self.outputSource = outputSource + self.linkMerge = linkMerge + self.pickValue = pickValue + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset( [ @@ -21964,14 +21812,7 @@ def __init__( ) -@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): +class WorkflowStepInput(Saveable): """ The input of a workflow step connects an upstream parameter (from the workflow inputs, or the outputs of other workflows steps) with the input @@ -22684,15 +22525,15 @@ def __init__( 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 + self.id = id + self.source = source + self.linkMerge = linkMerge + self.pickValue = pickValue + self.loadContents = loadContents + self.loadListing = loadListing + self.label = label + self.default = default + self.valueFrom = valueFrom attrs: ClassVar[Collection[str]] = frozenset( [ @@ -22709,7 +22550,7 @@ def __init__( ) -class WorkflowStepOutput(IdentifierRequired): +class WorkflowStepOutput(Saveable): """ Associate an output parameter of the underlying process with a workflow parameter. The workflow parameter (given in the `id` field) be may be used @@ -22869,12 +22710,12 @@ def __init__( self.loadingOptions = loadingOptions else: self.loadingOptions = LoadingOptions() - self.id: str = id + self.id = id attrs: ClassVar[Collection[str]] = frozenset(["id"]) -class WorkflowStep(IdentifierRequired, Labeled, Documented): +class WorkflowStep(Saveable): """ A workflow step is an executable element of a workflow. It specifies the underlying process implementation (such as `CommandLineTool` or another @@ -23669,17 +23510,17 @@ def __init__( 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 + self.id = id + 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 attrs: ClassVar[Collection[str]] = frozenset( [ @@ -23698,7 +23539,7 @@ def __init__( ) -class Workflow(Process): +class Workflow(Saveable): """ A workflow describes a set of **steps** and the **dependencies** between those steps. When a step produces output that will be consumed by a @@ -24434,17 +24275,17 @@ def __init__( 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.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_: Final[str] = "Workflow" - self.steps: Sequence[WorkflowStep] = steps + self.steps = steps attrs: ClassVar[Collection[str]] = frozenset( [ @@ -24463,7 +24304,7 @@ def __init__( ) -class SubworkflowFeatureRequirement(ProcessRequirement): +class SubworkflowFeatureRequirement(Saveable): """ Indicates that the workflow platform must support nested workflows in the `run` field of [WorkflowStep](#WorkflowStep). @@ -24582,7 +24423,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class"]) -class ScatterFeatureRequirement(ProcessRequirement): +class ScatterFeatureRequirement(Saveable): """ Indicates that the workflow platform must support the `scatter` and `scatterMethod` fields of [WorkflowStep](#WorkflowStep). @@ -24701,7 +24542,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class"]) -class MultipleInputFeatureRequirement(ProcessRequirement): +class MultipleInputFeatureRequirement(Saveable): """ Indicates that the workflow platform must support multiple inbound data links listed in the `source` field of [WorkflowStepInput](#WorkflowStepInput). @@ -24820,7 +24661,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class"]) -class StepInputExpressionRequirement(ProcessRequirement): +class StepInputExpressionRequirement(Saveable): """ Indicate that the workflow platform must support the `valueFrom` field of [WorkflowStepInput](#WorkflowStepInput). @@ -24939,7 +24780,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class"]) -class OperationInputParameter(InputParameter): +class OperationInputParameter(Saveable): """ Describe an input parameter of an operation. @@ -25607,16 +25448,16 @@ def __init__( 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.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.format = format + self.loadContents = loadContents + self.loadListing = loadListing + self.default = default + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset( [ @@ -25634,7 +25475,7 @@ def __init__( ) -class OperationOutputParameter(OutputParameter): +class OperationOutputParameter(Saveable): """ Describe an output parameter of an operation. @@ -26131,20 +25972,20 @@ def __init__( 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_ + self.label = label + self.secondaryFiles = secondaryFiles + self.streamable = streamable + self.doc = doc + self.id = id + self.format = format + self.type_ = type_ attrs: ClassVar[Collection[str]] = frozenset( ["label", "secondaryFiles", "streamable", "doc", "id", "format", "type"] ) -class Operation(Process): +class Operation(Saveable): """ This record describes an abstract operation. It is a potential step of a workflow that has not yet been bound to a concrete @@ -26780,15 +26621,15 @@ def __init__( 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.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_: Final[str] = "Operation" attrs: ClassVar[Collection[str]] = frozenset( @@ -26807,7 +26648,7 @@ def __init__( ) -class Secrets(ProcessRequirement): +class Secrets(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, Secrets): return bool(self.class_ == other.class_ and self.secrets == other.secrets) @@ -26971,12 +26812,12 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "Secrets" - self.secrets: Sequence[str] = secrets + self.secrets = secrets attrs: ClassVar[Collection[str]] = frozenset(["class", "secrets"]) -class ProcessGenerator(Process): +class ProcessGenerator(Saveable): id: str def __eq__(self, other: Any) -> bool: @@ -27658,17 +27499,17 @@ def __init__( 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.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_: Final[str] = "ProcessGenerator" - self.run: CommandLineTool | ExpressionTool | Operation | ProcessGenerator | Workflow | str = run + self.run = run attrs: ClassVar[Collection[str]] = frozenset( [ @@ -27687,7 +27528,7 @@ def __init__( ) -class MPIRequirement(ProcessRequirement): +class MPIRequirement(Saveable): """ Indicates that a process requires an MPI runtime. @@ -27862,12 +27703,12 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "MPIRequirement" - self.processes: i32 | str = processes + self.processes = processes attrs: ClassVar[Collection[str]] = frozenset(["class", "processes"]) -class CUDARequirement(ProcessRequirement): +class CUDARequirement(Saveable): """ Require support for NVIDA CUDA (GPU hardware acceleration). @@ -28223,10 +28064,10 @@ def __init__( 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 + self.cudaComputeCapability = cudaComputeCapability + self.cudaDeviceCountMax = cudaDeviceCountMax + self.cudaDeviceCountMin = cudaDeviceCountMin + self.cudaVersionMin = cudaVersionMin attrs: ClassVar[Collection[str]] = frozenset( [ @@ -28669,19 +28510,19 @@ def __init__( 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 + 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 attrs: ClassVar[Collection[str]] = frozenset( ["default", "id", "linkMerge", "loopSource", "pickValue", "valueFrom"] ) -class Loop(ProcessRequirement): +class Loop(Saveable): """ Prototype to enable workflow-level looping of a step. @@ -28978,16 +28819,16 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "Loop" - self.loop: Sequence[LoopInput] = loop - self.loopWhen: str = loopWhen - self.outputMethod: Literal["last", "all"] = outputMethod + self.loop = loop + self.loopWhen = loopWhen + self.outputMethod = outputMethod attrs: ClassVar[Collection[str]] = frozenset( ["class", "loop", "loopWhen", "outputMethod"] ) -class ShmSize(ProcessRequirement): +class ShmSize(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, ShmSize): return bool(self.class_ == other.class_ and self.shmSize == other.shmSize) @@ -29152,7 +28993,7 @@ def __init__( else: self.loadingOptions = LoadingOptions() self.class_: Final[str] = "ShmSize" - self.shmSize: str = shmSize + self.shmSize = shmSize attrs: ClassVar[Collection[str]] = frozenset(["class", "shmSize"]) @@ -30954,6 +30795,69 @@ def __init__( "Directory | File | Mapping[str, CWLObjectType | None] | Sequence[CWLObjectType | None] | bool | float | i32 | i64 | str" ) +Sink: TypeAlias = WorkflowStepInput +InputSchema: TypeAlias = InputArraySchema | InputEnumSchema | InputRecordSchema +OutputSchema: TypeAlias = OutputArraySchema | OutputEnumSchema | OutputRecordSchema +InputParameter: TypeAlias = ( + CommandInputParameter | OperationInputParameter | WorkflowInputParameter +) +OutputParameter: TypeAlias = ( + CommandOutputParameter + | ExpressionToolOutputParameter + | OperationOutputParameter + | WorkflowOutputParameter +) +ProcessRequirement: TypeAlias = ( + CUDARequirement + | DockerRequirement + | EnvVarRequirement + | InitialWorkDirRequirement + | InlineJavascriptRequirement + | InplaceUpdateRequirement + | LoadListingRequirement + | Loop + | MPIRequirement + | MultipleInputFeatureRequirement + | NetworkAccess + | ResourceRequirement + | ScatterFeatureRequirement + | SchemaDefRequirement + | Secrets + | ShellCommandRequirement + | ShmSize + | SoftwareRequirement + | StepInputExpressionRequirement + | SubworkflowFeatureRequirement + | ToolTimeLimit + | WorkReuse +) +Process: TypeAlias = ( + CommandLineTool | ExpressionTool | Operation | ProcessGenerator | Workflow +) +CommandInputSchema: TypeAlias = ( + CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema +) +CommandLineBindable: TypeAlias = ( + CommandInputArraySchema + | CommandInputEnumSchema + | CommandInputRecordField + | CommandInputRecordSchema +) +IOSchema: TypeAlias = InputSchema | OutputSchema +LoadContents: TypeAlias = ( + CommandOutputBinding | InputParameter | InputRecordField | WorkflowStepInput +) +InputFormat: TypeAlias = InputParameter | InputRecordField +OutputFormat: TypeAlias = OutputParameter | OutputRecordField +Parameter: TypeAlias = InputParameter | OutputParameter +Documented: TypeAlias = IOSchema | Parameter | Process | RecordField | WorkflowStep +IdentifierRequired: TypeAlias = ( + Parameter | WorkflowStep | WorkflowStepInput | WorkflowStepOutput +) +FieldBase: TypeAlias = InputRecordField | OutputRecordField | Parameter +Identified: TypeAlias = IdentifierRequired | Process +Labeled: TypeAlias = FieldBase | IOSchema | Process | WorkflowStep | WorkflowStepInput + def load_document( doc: Any, diff --git a/cwl_utils/parser/cwl_v1_2_utils.py b/cwl_utils/parser/cwl_v1_2_utils.py index a8d89ebd..b68791b5 100644 --- a/cwl_utils/parser/cwl_v1_2_utils.py +++ b/cwl_utils/parser/cwl_v1_2_utils.py @@ -9,7 +9,7 @@ from urllib.parse import urldefrag from schema_salad.exceptions import ValidationException -from schema_salad.sourceline import SourceLine, add_lc_filename +from schema_salad.sourceline import add_lc_filename, SourceLine from schema_salad.utils import aslist, json_dumps, yaml_no_ts import cwl_utils.parser @@ -358,7 +358,7 @@ def check_all_types( case _: raise WorkflowException(f"Invalid sink type {sink.__class__.__name__}") if sourceField is not None: - if isinstance(sourceField, Sequence) and len (sourceField) > 1: + if is_sequence(sourceField) and len(sourceField) > 1: linkMerge: str | None = sink.linkMerge or ( "merge_nested" if len(sourceField) > 1 else None ) @@ -383,7 +383,7 @@ def check_all_types( src_dict[parm_id], sink, linkMerge, - message="Source is from conditional step, but pickValue is not used", + message="Source is from conditional step and may produce `null`", ) ) type_dict[src_dict[parm_id].id] = src_typ @@ -393,7 +393,7 @@ def check_all_types( items=src_typ, type_="array" ) else: - if isinstance(sourceField, Sequence): + if is_sequence(sourceField): parm_id = sourceField[0] else: parm_id = sourceField @@ -413,54 +413,19 @@ def check_all_types( ) ) if _is_conditional_step(param_to_step, parm_id): - src_typ = aslist(type_dict[src_dict[parm_id].id]) - snk_typ = type_dict[sink.id] - if "null" not in src_typ: - src_typ = ["null"] + cast(list[Any], src_typ) - if ( - not isinstance(snk_typ, MutableSequence) - or "null" not in snk_typ - ): - validation["warning"].append( - SrcSink( - src_dict[parm_id], - sink, - linkMerge, - message="Source is from conditional step and may produce `null`", - ) + validation["warning"].append( + SrcSink( + src_dict[parm_id], + sink, + linkMerge, + message="Source is from conditional step, but pickValue is not used", ) - type_dict[src_dict[parm_id].id] = src_typ + ) 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: - 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)], @@ -725,21 +690,21 @@ def type_for_source( for _ in range(scatter_context[0][0]): new_type = cwl.OutputArraySchema( items=in_output_type_schema_to_output_type_schema( - new_type, process.loadingOptions # type: ignore[attr-defined] + new_type, process.loadingOptions ), type_="array", ) else: new_type = cwl.OutputArraySchema( items=in_output_type_schema_to_output_type_schema( - new_type, process.loadingOptions # type: ignore[attr-defined] + new_type, process.loadingOptions ), type_="array", ) if linkMerge == "merge_nested": new_type = cwl.OutputArraySchema( items=in_output_type_schema_to_output_type_schema( - new_type, process.loadingOptions # type: ignore[attr-defined] + new_type, process.loadingOptions ), type_="array", ) @@ -766,14 +731,14 @@ def type_for_source( for _ in range(sc[0]): cur_type = cwl.OutputArraySchema( items=in_output_type_schema_to_output_type_schema( - cur_type, process.loadingOptions # type: ignore[attr-defined] + cur_type, process.loadingOptions ), type_="array", ) else: cur_type = cwl.OutputArraySchema( items=in_output_type_schema_to_output_type_schema( - cur_type, process.loadingOptions # type: ignore[attr-defined] + cur_type, process.loadingOptions ), type_="array", ) diff --git a/cwl_utils/types.py b/cwl_utils/types.py index dbc291f6..03f601c5 100644 --- a/cwl_utils/types.py +++ b/cwl_utils/types.py @@ -7,9 +7,9 @@ from typing import Any, Literal, TypeAlias, TypedDict, TypeGuard if sys.version_info >= (3, 13): - from typing import TypeIs as TypeIs + from typing import TypeIs else: - from typing_extensions import TypeIs as TypeIs + from typing_extensions import TypeIs if sys.version_info >= (3, 11): from typing import Required From c47584fa6c60b1069838f1f719afa2ce078f009e Mon Sep 17 00:00:00 2001 From: GlassOfWhiskey Date: Sun, 5 Apr 2026 19:58:52 +0200 Subject: [PATCH 18/22] Regenerate parsers with generic Loaders --- cwl_utils/parser/__init__.py | 5 +- cwl_utils/parser/cwl_v1_0.py | 2878 ++++++++++++++++++++++--------- cwl_utils/parser/cwl_v1_1.py | 2988 +++++++++++++++++++++++--------- cwl_utils/parser/cwl_v1_2.py | 3143 ++++++++++++++++++++++++---------- 4 files changed, 6473 insertions(+), 2541 deletions(-) diff --git a/cwl_utils/parser/__init__.py b/cwl_utils/parser/__init__.py index be8c41ef..c77a6be9 100644 --- a/cwl_utils/parser/__init__.py +++ b/cwl_utils/parser/__init__.py @@ -4,7 +4,7 @@ from abc import ABC from collections.abc import MutableMapping, MutableSequence from pathlib import Path -from typing import Any, Optional, TypeAlias, cast +from typing import Any, Optional, TypeAlias, cast, TypeVar from urllib.parse import unquote_plus, urlparse from schema_salad.exceptions import ValidationException @@ -255,7 +255,8 @@ class NoType(ABC): | 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 +__T = TypeVar("__T", covariant=True) +_Loader: TypeAlias = cwl_v1_0._Loader[__T] | cwl_v1_1._Loader[__T] | cwl_v1_2._Loader[__T] """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 69e2713b..23db1d74 100644 --- a/cwl_utils/parser/cwl_v1_0.py +++ b/cwl_utils/parser/cwl_v1_0.py @@ -45,7 +45,9 @@ IdxType: TypeAlias = MutableMapping[str, tuple[Any, "LoadingOptions"]] +E = TypeVar("E", bound=str) S = TypeVar("S", bound="Saveable") +T = TypeVar("T", covariant=True) class LoadingOptions: @@ -236,11 +238,11 @@ def save( def load_field( val: Any | None, - fieldtype: "_Loader", + fieldtype: _Loader[T], baseuri: str, loadingOptions: LoadingOptions, lc: Any | None = None, -) -> Any: +) -> T: """Load field.""" if isinstance(val, MutableMapping): if "$import" in val: @@ -442,7 +444,8 @@ def expand_url( return url -class _Loader: +class _Loader(Generic[T], metaclass=ABCMeta): + @abstractmethod def load( self, doc: Any, @@ -450,11 +453,10 @@ def load( loadingOptions: LoadingOptions, docRoot: str | None = None, lc: Any | None = None, - ) -> Any | None: - pass + ) -> T: ... -class _AnyLoader(_Loader): +class _AnyLoader(_Loader[Any]): def load( self, doc: Any, @@ -468,8 +470,8 @@ def load( raise ValidationException("Expected non-null") -class _PrimitiveLoader(_Loader): - def __init__(self, tp: type | tuple[type[str], type[str]]) -> None: +class _PrimitiveLoader(_Loader[T]): + def __init__(self, tp: type[T]) -> None: self.tp: Final = tp def load( @@ -479,7 +481,7 @@ def load( loadingOptions: LoadingOptions, docRoot: str | None = None, lc: Any | None = None, - ) -> Any: + ) -> T: if not isinstance(doc, self.tp): raise ValidationException(f"Expected a {self.tp} but got {doc.__class__.__name__}") return doc @@ -488,8 +490,8 @@ def __repr__(self) -> str: return str(self.tp) -class _ArrayLoader(_Loader): - def __init__(self, items: _Loader) -> None: +class _ArrayLoader(_Loader[Sequence[T]]): + def __init__(self, items: _Loader[T]) -> None: self.items: Final = items def load( @@ -499,7 +501,7 @@ def load( loadingOptions: LoadingOptions, docRoot: str | None = None, lc: Any | None = None, - ) -> list[Any]: + ) -> list[T]: if not isinstance(doc, MutableSequence): raise ValidationException( f"Value is a {convert_typing(extract_type(type(doc)))}, " @@ -545,10 +547,10 @@ def __repr__(self) -> str: return f"array<{self.items}>" -class _MapLoader(_Loader): +class _MapLoader(_Loader[Mapping[str, T]]): def __init__( self, - values: _Loader, + values: _Loader[T], name: str | None = None, container: str | None = None, no_link_check: bool | None = None, @@ -565,7 +567,7 @@ def load( loadingOptions: LoadingOptions, docRoot: str | None = None, lc: Any | None = None, - ) -> dict[str, Any]: + ) -> dict[str, T]: 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: @@ -588,7 +590,7 @@ def __repr__(self) -> str: return self.name if self.name is not None else f"map" -class _EnumLoader(_Loader): +class _EnumLoader(_Loader[E]): def __init__(self, symbols: Sequence[str], name: str) -> None: self.symbols: Final = symbols self.name: Final = name @@ -600,17 +602,17 @@ def load( loadingOptions: LoadingOptions, docRoot: str | None = None, lc: Any | None = None, - ) -> str: + ) -> E: if doc in self.symbols: - return cast(str, doc) + return cast(E, doc) raise ValidationException(f"Expected one of {self.symbols}") def __repr__(self) -> str: return self.name -class _SecondaryDSLLoader(_Loader): - def __init__(self, inner: _Loader) -> None: +class _SecondaryDSLLoader(_Loader[T]): + def __init__(self, inner: _Loader[T]) -> None: self.inner: Final = inner def load( @@ -620,7 +622,7 @@ def load( loadingOptions: LoadingOptions, docRoot: str | None = None, lc: Any | None = None, - ) -> Any: + ) -> T: r: Final[list[dict[str, Any]]] = [] match doc: case MutableSequence() as dlist: @@ -682,7 +684,7 @@ def load( return self.inner.load(r, baseuri, loadingOptions, docRoot, lc=lc) -class _RecordLoader(_Loader, Generic[S]): +class _RecordLoader(_Loader[S]): def __init__( self, classtype: type[S], @@ -716,7 +718,7 @@ def __repr__(self) -> str: return str(self.classtype.__name__) -class _ExpressionLoader(_Loader): +class _ExpressionLoader(_Loader[str]): def __init__(self, items: type[str]) -> None: self.items: Final = items @@ -737,12 +739,12 @@ def load( return doc -class _UnionLoader(_Loader): - def __init__(self, alternates: Sequence[_Loader], name: str | None = None) -> None: +class _UnionLoader(_Loader[T]): + def __init__(self, alternates: Sequence[_Loader[T]], name: str | None = None) -> None: self.alternates = alternates self.name: Final = name - def add_loaders(self, loaders: Sequence[_Loader]) -> None: + def add_loaders(self, loaders: Sequence[_Loader[T]]) -> None: self.alternates = tuple(loader for loader in chain(self.alternates, loaders)) def load( @@ -752,7 +754,7 @@ def load( loadingOptions: LoadingOptions, docRoot: str | None = None, lc: Any | None = None, - ) -> Any: + ) -> T: errors: Final = [] if lc is None: @@ -827,10 +829,10 @@ def __repr__(self) -> str: return self.name if self.name is not None else " | ".join(str(a) for a in self.alternates) -class _URILoader(_Loader): +class _URILoader(_Loader[T]): def __init__( self, - inner: _Loader, + inner: _Loader[T], scoped_id: bool, vocab_term: bool, scoped_ref: int | None, @@ -849,7 +851,7 @@ def load( loadingOptions: LoadingOptions, docRoot: str | None = None, lc: Any | None = None, - ) -> Any: + ) -> T: if self.no_link_check is not None: loadingOptions = LoadingOptions( copyfrom=loadingOptions, no_link_check=self.no_link_check @@ -896,8 +898,8 @@ def load( return self.inner.load(doc, baseuri, loadingOptions, lc=lc) -class _TypeDSLLoader(_Loader): - def __init__(self, inner: _Loader, refScope: int | None, salad_version: str) -> None: +class _TypeDSLLoader(_Loader[T]): + def __init__(self, inner: _Loader[T], refScope: int | None, salad_version: str) -> None: self.inner: Final = inner self.refScope: Final = refScope self.salad_version: Final = salad_version @@ -944,7 +946,7 @@ def load( loadingOptions: LoadingOptions, docRoot: str | None = None, lc: Any | None = None, - ) -> Any: + ) -> T: if isinstance(doc, MutableSequence): r: Final[list[Any]] = [] for d in doc: @@ -966,8 +968,8 @@ def load( return self.inner.load(doc, baseuri, loadingOptions, lc=lc) -class _IdMapLoader(_Loader): - def __init__(self, inner: _Loader, mapSubject: str, mapPredicate: str | None) -> None: +class _IdMapLoader(_Loader[T]): + def __init__(self, inner: _Loader[T], mapSubject: str, mapPredicate: str | None) -> None: self.inner: Final = inner self.mapSubject: Final = mapSubject self.mapPredicate: Final = mapPredicate @@ -979,7 +981,7 @@ def load( loadingOptions: LoadingOptions, docRoot: str | None = None, lc: Any | None = None, - ) -> Any: + ) -> T: if isinstance(doc, MutableMapping): r: Final[list[Any]] = [] for k in doc.keys(): @@ -1006,12 +1008,12 @@ def load( def _document_load( - loader: _Loader, + loader: _Loader[T], doc: str | MutableMapping[str, Any] | MutableSequence[Any], baseuri: str, loadingOptions: LoadingOptions, addl_metadata_fields: MutableSequence[str] | None = None, -) -> tuple[Any, LoadingOptions]: +) -> tuple[T, LoadingOptions]: if isinstance(doc, str): return _document_load_by_url( loader, @@ -1076,11 +1078,11 @@ def _document_load( def _document_load_by_url( - loader: _Loader, + loader: _Loader[T], url: str, loadingOptions: LoadingOptions, addl_metadata_fields: MutableSequence[str] | None = None, -) -> tuple[Any, LoadingOptions]: +) -> tuple[T, LoadingOptions]: if url in loadingOptions.idx: return loadingOptions.idx[url] @@ -1266,14 +1268,14 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: + name = "" _errors__.append(ValidationException("missing name")) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name doc = None if "doc" in _doc: try: @@ -1394,13 +1396,13 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, doc=doc, type_=type_, extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -1415,7 +1417,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.doc is not None: r["doc"] = save( @@ -1738,14 +1740,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name try: if _doc.get("symbols") is None: raise ValidationException("missing required field `symbols`", None, []) @@ -1867,13 +1868,13 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, symbols=symbols, type_=type_, extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -1888,7 +1889,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.symbols is not None: u = save_relative_uri(self.symbols, self.name, True, None, relative_uris) @@ -2802,14 +2803,14 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: + name = "" _errors__.append(ValidationException("missing name")) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name doc = None if "doc" in _doc: try: @@ -2930,13 +2931,13 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, doc=doc, type_=type_, extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -2951,7 +2952,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.doc is not None: r["doc"] = save( @@ -4479,14 +4480,14 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: + name = "" _errors__.append(ValidationException("missing name")) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name doc = None if "doc" in _doc: try: @@ -4701,7 +4702,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, doc=doc, type_=type_, inputBinding=inputBinding, @@ -4709,7 +4710,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -4724,7 +4725,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.doc is not None: r["doc"] = save( @@ -4861,14 +4862,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name fields = None if "fields" in _doc: try: @@ -5036,14 +5036,14 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, fields=fields, type_=type_, label=label, extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -5058,7 +5058,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.fields is not None: r["fields"] = save( @@ -5187,14 +5187,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name try: if _doc.get("symbols") is None: raise ValidationException("missing required field `symbols`", None, []) @@ -5410,7 +5409,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, symbols=symbols, type_=type_, label=label, @@ -5418,7 +5417,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -5433,7 +5432,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.symbols is not None: u = save_relative_uri(self.symbols, self.name, True, None, relative_uris) @@ -5886,14 +5885,14 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: + name = "" _errors__.append(ValidationException("missing name")) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name doc = None if "doc" in _doc: try: @@ -6061,14 +6060,14 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, doc=doc, type_=type_, outputBinding=outputBinding, extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -6083,7 +6082,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.doc is not None: r["doc"] = save( @@ -6474,14 +6473,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name try: if _doc.get("symbols") is None: raise ValidationException("missing required field `symbols`", None, []) @@ -6697,7 +6695,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, symbols=symbols, type_=type_, label=label, @@ -6705,7 +6703,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -6720,7 +6718,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.symbols is not None: u = save_relative_uri(self.symbols, self.name, True, None, relative_uris) @@ -7190,14 +7188,14 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: + id = "" _errors__.append(ValidationException("missing id")) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id label = None if "label" in _doc: try: @@ -7599,7 +7597,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, label=label, secondaryFiles=secondaryFiles, streamable=streamable, @@ -7611,7 +7609,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -7626,7 +7624,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.label is not None: r["label"] = save( @@ -7815,14 +7813,14 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: + id = "" _errors__.append(ValidationException("missing id")) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id label = None if "label" in _doc: try: @@ -8130,7 +8128,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, label=label, secondaryFiles=secondaryFiles, streamable=streamable, @@ -8140,7 +8138,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -8155,7 +8153,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.label is not None: r["label"] = save( @@ -9713,14 +9711,14 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: + name = "" _errors__.append(ValidationException("missing name")) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name doc = None if "doc" in _doc: try: @@ -9935,7 +9933,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, doc=doc, type_=type_, inputBinding=inputBinding, @@ -9943,7 +9941,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -9958,7 +9956,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.doc is not None: r["doc"] = save( @@ -10095,14 +10093,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name fields = None if "fields" in _doc: try: @@ -10270,14 +10267,14 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, fields=fields, type_=type_, label=label, extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -10292,7 +10289,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.fields is not None: r["fields"] = save( @@ -10421,14 +10418,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name try: if _doc.get("symbols") is None: raise ValidationException("missing required field `symbols`", None, []) @@ -10644,7 +10640,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, symbols=symbols, type_=type_, label=label, @@ -10652,7 +10648,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -10667,7 +10663,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.symbols is not None: u = save_relative_uri(self.symbols, self.name, True, None, relative_uris) @@ -11120,14 +11116,14 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: + name = "" _errors__.append(ValidationException("missing name")) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name doc = None if "doc" in _doc: try: @@ -11295,14 +11291,14 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, doc=doc, type_=type_, outputBinding=outputBinding, extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -11317,7 +11313,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.doc is not None: r["doc"] = save( @@ -11448,14 +11444,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name fields = None if "fields" in _doc: try: @@ -11623,14 +11618,14 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, fields=fields, type_=type_, label=label, extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -11645,7 +11640,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.fields is not None: r["fields"] = save( @@ -11774,14 +11769,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name try: if _doc.get("symbols") is None: raise ValidationException("missing required field `symbols`", None, []) @@ -11997,7 +11991,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, symbols=symbols, type_=type_, label=label, @@ -12005,7 +11999,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -12020,7 +12014,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.symbols is not None: u = save_relative_uri(self.symbols, self.name, True, None, relative_uris) @@ -12494,14 +12488,14 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: + id = "" _errors__.append(ValidationException("missing id")) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id label = None if "label" in _doc: try: @@ -12903,7 +12897,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, label=label, secondaryFiles=secondaryFiles, streamable=streamable, @@ -12915,7 +12909,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -12930,7 +12924,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.label is not None: r["label"] = save( @@ -13125,14 +13119,14 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: + id = "" _errors__.append(ValidationException("missing id")) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id label = None if "label" in _doc: try: @@ -13487,7 +13481,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, label=label, secondaryFiles=secondaryFiles, streamable=streamable, @@ -13498,7 +13492,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -13513,7 +13507,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.label is not None: r["label"] = save( @@ -13720,14 +13714,13 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: id = "_:" + str(_uuid__.uuid4()) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id try: if _doc.get("class") is None: raise ValidationException("missing required field `class`", None, []) @@ -14476,7 +14469,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, inputs=inputs, outputs=outputs, requirements=requirements, @@ -14495,7 +14488,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -14510,7 +14503,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.class_ is not None: uri = self.loadingOptions.vocab[self.class_] @@ -17079,14 +17072,14 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: + id = "" _errors__.append(ValidationException("missing id")) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id label = None if "label" in _doc: try: @@ -17441,7 +17434,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, label=label, secondaryFiles=secondaryFiles, streamable=streamable, @@ -17452,7 +17445,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -17467,7 +17460,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.label is not None: r["label"] = save( @@ -17660,14 +17653,13 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: id = "_:" + str(_uuid__.uuid4()) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id try: if _doc.get("class") is None: raise ValidationException("missing required field `class`", None, []) @@ -18088,7 +18080,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, inputs=inputs, outputs=outputs, requirements=requirements, @@ -18100,7 +18092,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -18115,7 +18107,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.class_ is not None: uri = self.loadingOptions.vocab[self.class_] @@ -18324,14 +18316,14 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: + id = "" _errors__.append(ValidationException("missing id")) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id label = None if "label" in _doc: try: @@ -18780,7 +18772,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, label=label, secondaryFiles=secondaryFiles, streamable=streamable, @@ -18793,7 +18785,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -18808,7 +18800,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.label is not None: r["label"] = save( @@ -19036,14 +19028,14 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: + id = "" _errors__.append(ValidationException("missing id")) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id source = None if "source" in _doc: try: @@ -19257,7 +19249,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, source=source, linkMerge=linkMerge, default=default, @@ -19265,7 +19257,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -19280,7 +19272,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.source is not None: u = save_relative_uri(self.source, self.id, False, 2, relative_uris) @@ -19416,14 +19408,14 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: + id = "" _errors__.append(ValidationException("missing id")) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: @@ -19447,11 +19439,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -19466,7 +19458,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u # top refers to the directory level @@ -19652,14 +19644,14 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: + id = "" _errors__.append(ValidationException("missing id")) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id try: if _doc.get("in") is None: raise ValidationException("missing required field `in`", None, []) @@ -20111,7 +20103,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, in_=in_, out=out, requirements=requirements, @@ -20124,7 +20116,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -20139,7 +20131,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.in_ is not None: r["in"] = save( @@ -20383,14 +20375,13 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: id = "_:" + str(_uuid__.uuid4()) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id try: if _doc.get("class") is None: raise ValidationException("missing required field `class`", None, []) @@ -20811,7 +20802,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, inputs=inputs, outputs=outputs, requirements=requirements, @@ -20823,7 +20814,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -20838,7 +20829,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.class_ is not None: uri = self.loadingOptions.vocab[self.class_] @@ -22599,14 +22590,13 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: id = "_:" + str(_uuid__.uuid4()) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id try: if _doc.get("class") is None: raise ValidationException("missing required field `class`", None, []) @@ -23027,7 +23017,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, inputs=inputs, outputs=outputs, requirements=requirements, @@ -23039,7 +23029,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -23054,7 +23044,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.class_ is not None: uri = self.loadingOptions.vocab[self.class_] @@ -24100,14 +24090,16 @@ def __init__( "https://w3id.org/cwl/cwl#v1.0": "v1.0", }) -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( +strtype: Final[_Loader[str]] = _PrimitiveLoader(str) +inttype: Final[_Loader[i32]] = _PrimitiveLoader(i32) +floattype: Final[_Loader[float]] = _PrimitiveLoader(float) +booltype: Final[_Loader[bool]] = _PrimitiveLoader(bool) +None_type: Final[_Loader[None]] = _PrimitiveLoader(type(None)) +Any_type: Final[_Loader[Any]] = _AnyLoader() +longtype: Final[_Loader[i64]] = _PrimitiveLoader(i64) +PrimitiveTypeLoader: Final[ + _Loader[Literal["null", "boolean", "int", "long", "float", "double", "string"]] +] = _EnumLoader( ( "null", "boolean", @@ -24133,17 +24125,33 @@ def __init__( double: double precision (64-bit) IEEE 754 floating-point number string: Unicode character sequence """ -AnyLoader: Final = _EnumLoader(("Any",), "Any") +AnyLoader: Final[_Loader[Literal["Any"]]] = _EnumLoader(("Any",), "Any") """ The **Any** type validates for any non-null value. """ -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( +RecordFieldLoader: Final[_Loader[RecordField]] = _RecordLoader(RecordField, None, None) +RecordSchemaLoader: Final[_Loader[RecordSchema]] = _RecordLoader( + RecordSchema, None, None +) +EnumSchemaLoader: Final[_Loader[EnumSchema]] = _RecordLoader(EnumSchema, None, None) +ArraySchemaLoader: Final[_Loader[ArraySchema]] = _RecordLoader(ArraySchema, None, None) +MapSchemaLoader: Final[_Loader[MapSchema]] = _RecordLoader(MapSchema, None, None) +UnionSchemaLoader: Final[_Loader[UnionSchema]] = _RecordLoader(UnionSchema, None, None) +CWLTypeLoader: Final[ + _Loader[ + Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + ] +] = _EnumLoader( ( "null", "boolean", @@ -24162,72 +24170,116 @@ def __init__( File: A File object Directory: A Directory object """ -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, - ) +CWLArraySchemaLoader: Final[_Loader[CWLArraySchema]] = _RecordLoader( + CWLArraySchema, None, None ) -array_of_union_of_None_type_or_CWLObjectTypeLoader: Final = _ArrayLoader( - union_of_None_type_or_CWLObjectTypeLoader +CWLRecordFieldLoader: Final[_Loader[CWLRecordField]] = _RecordLoader( + CWLRecordField, None, None ) -map_of_union_of_None_type_or_CWLObjectTypeLoader: Final = _MapLoader( - union_of_None_type_or_CWLObjectTypeLoader, "CWLInputFile", "@list", True +CWLRecordSchemaLoader: Final[_Loader[CWLRecordSchema]] = _RecordLoader( + CWLRecordSchema, None, None ) -CWLInputFileLoader: Final = map_of_union_of_None_type_or_CWLObjectTypeLoader -CWLVersionLoader: Final = _EnumLoader(("v1.0",), "CWLVersion") +FileLoader: Final[_Loader[File]] = _RecordLoader(File, None, None) +DirectoryLoader: Final[_Loader[Directory]] = _RecordLoader(Directory, None, None) +CWLObjectTypeLoader: Final[_UnionLoader[Any]] = _UnionLoader((), "CWLObjectTypeLoader") +union_of_None_type_or_CWLObjectTypeLoader: Final[_Loader[CWLObjectType | None]] = ( + _UnionLoader( + ( + None_type, + CWLObjectTypeLoader, + ) + ) +) +array_of_union_of_None_type_or_CWLObjectTypeLoader: Final[ + _Loader[Sequence[CWLObjectType | None]] +] = _ArrayLoader(union_of_None_type_or_CWLObjectTypeLoader) +map_of_union_of_None_type_or_CWLObjectTypeLoader: Final[ + _Loader[Mapping[str, CWLObjectType | None]] +] = _MapLoader(union_of_None_type_or_CWLObjectTypeLoader, "CWLInputFile", "@list", True) +CWLInputFileLoader: Final[_Loader[Mapping[str, CWLObjectType | None]]] = ( + map_of_union_of_None_type_or_CWLObjectTypeLoader +) +CWLVersionLoader: Final[_Loader[Literal["v1.0"]]] = _EnumLoader(("v1.0",), "CWLVersion") """ Current version symbol for CWL documents. """ -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 +ExpressionLoader = _ExpressionLoader(str) +InputRecordFieldLoader: Final[_Loader[InputRecordField]] = _RecordLoader( + InputRecordField, None, None +) +InputRecordSchemaLoader: Final[_Loader[InputRecordSchema]] = _RecordLoader( + InputRecordSchema, None, None +) +InputEnumSchemaLoader: Final[_Loader[InputEnumSchema]] = _RecordLoader( + InputEnumSchema, None, None +) +InputArraySchemaLoader: Final[_Loader[InputArraySchema]] = _RecordLoader( + InputArraySchema, None, None +) +OutputRecordFieldLoader: Final[_Loader[OutputRecordField]] = _RecordLoader( + OutputRecordField, None, None +) +OutputRecordSchemaLoader: Final[_Loader[OutputRecordSchema]] = _RecordLoader( + OutputRecordSchema, None, None +) +OutputEnumSchemaLoader: Final[_Loader[OutputEnumSchema]] = _RecordLoader( + OutputEnumSchema, None, None +) +OutputArraySchemaLoader: Final[_Loader[OutputArraySchema]] = _RecordLoader( + OutputArraySchema, None, None +) +InputParameterLoader: Final[_Loader[InputParameter]] = _RecordLoader( + InputParameter, None, None +) +OutputParameterLoader: Final[_Loader[OutputParameter]] = _RecordLoader( + OutputParameter, None, None +) +InlineJavascriptRequirementLoader: Final[_Loader[InlineJavascriptRequirement]] = ( + _RecordLoader(InlineJavascriptRequirement, None, None) +) +SchemaDefRequirementLoader: Final[_Loader[SchemaDefRequirement]] = _RecordLoader( + SchemaDefRequirement, None, None +) +EnvironmentDefLoader: Final[_Loader[EnvironmentDef]] = _RecordLoader( + EnvironmentDef, None, None ) -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( +CommandLineBindingLoader: Final[_Loader[CommandLineBinding]] = _RecordLoader( + CommandLineBinding, None, None +) +CommandOutputBindingLoader: Final[_Loader[CommandOutputBinding]] = _RecordLoader( + CommandOutputBinding, None, None +) +CommandInputRecordFieldLoader: Final[_Loader[CommandInputRecordField]] = _RecordLoader( CommandInputRecordField, None, None ) -CommandInputRecordSchemaLoader: Final = _RecordLoader( - CommandInputRecordSchema, None, None +CommandInputRecordSchemaLoader: Final[_Loader[CommandInputRecordSchema]] = ( + _RecordLoader(CommandInputRecordSchema, None, None) +) +CommandInputEnumSchemaLoader: Final[_Loader[CommandInputEnumSchema]] = _RecordLoader( + CommandInputEnumSchema, None, None ) -CommandInputEnumSchemaLoader: Final = _RecordLoader(CommandInputEnumSchema, None, None) -CommandInputArraySchemaLoader: Final = _RecordLoader( +CommandInputArraySchemaLoader: Final[_Loader[CommandInputArraySchema]] = _RecordLoader( CommandInputArraySchema, None, None ) -CommandOutputRecordFieldLoader: Final = _RecordLoader( - CommandOutputRecordField, None, None +CommandOutputRecordFieldLoader: Final[_Loader[CommandOutputRecordField]] = ( + _RecordLoader(CommandOutputRecordField, None, None) ) -CommandOutputRecordSchemaLoader: Final = _RecordLoader( - CommandOutputRecordSchema, None, None +CommandOutputRecordSchemaLoader: Final[_Loader[CommandOutputRecordSchema]] = ( + _RecordLoader(CommandOutputRecordSchema, None, None) ) -CommandOutputEnumSchemaLoader: Final = _RecordLoader( +CommandOutputEnumSchemaLoader: Final[_Loader[CommandOutputEnumSchema]] = _RecordLoader( CommandOutputEnumSchema, None, None ) -CommandOutputArraySchemaLoader: Final = _RecordLoader( - CommandOutputArraySchema, None, None +CommandOutputArraySchemaLoader: Final[_Loader[CommandOutputArraySchema]] = ( + _RecordLoader(CommandOutputArraySchema, None, None) +) +CommandInputParameterLoader: Final[_Loader[CommandInputParameter]] = _RecordLoader( + CommandInputParameter, None, None +) +CommandOutputParameterLoader: Final[_Loader[CommandOutputParameter]] = _RecordLoader( + CommandOutputParameter, None, None ) -CommandInputParameterLoader: Final = _RecordLoader(CommandInputParameter, None, None) -CommandOutputParameterLoader: Final = _RecordLoader(CommandOutputParameter, None, None) -stdoutLoader: Final = _EnumLoader(("stdout",), "stdout") +stdoutLoader: Final[_Loader[Literal["stdout"]]] = _EnumLoader(("stdout",), "stdout") """ Only valid as a `type` for a `CommandLineTool` output with no `outputBinding` set. @@ -24271,7 +24323,7 @@ def __init__( stdout: random_stdout_filenameABCDEFG ``` """ -stderrLoader: Final = _EnumLoader(("stderr",), "stderr") +stderrLoader: Final[_Loader[Literal["stderr"]]] = _EnumLoader(("stderr",), "stderr") """ Only valid as a `type` for a `CommandLineTool` output with no `outputBinding` set. @@ -24315,39 +24367,61 @@ def __init__( stderr: random_stderr_filenameABCDEFG ``` """ -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 +CommandLineToolLoader: Final[_Loader[CommandLineTool]] = _RecordLoader( + CommandLineTool, None, None +) +DockerRequirementLoader: Final[_Loader[DockerRequirement]] = _RecordLoader( + DockerRequirement, None, None +) +SoftwareRequirementLoader: Final[_Loader[SoftwareRequirement]] = _RecordLoader( + SoftwareRequirement, None, None +) +SoftwarePackageLoader: Final[_Loader[SoftwarePackage]] = _RecordLoader( + SoftwarePackage, None, None +) +DirentLoader: Final[_Loader[Dirent]] = _RecordLoader(Dirent, None, None) +InitialWorkDirRequirementLoader: Final[_Loader[InitialWorkDirRequirement]] = ( + _RecordLoader(InitialWorkDirRequirement, None, None) +) +EnvVarRequirementLoader: Final[_Loader[EnvVarRequirement]] = _RecordLoader( + EnvVarRequirement, None, None ) -EnvVarRequirementLoader: Final = _RecordLoader(EnvVarRequirement, None, None) -ShellCommandRequirementLoader: Final = _RecordLoader( +ShellCommandRequirementLoader: Final[_Loader[ShellCommandRequirement]] = _RecordLoader( ShellCommandRequirement, None, None ) -ResourceRequirementLoader: Final = _RecordLoader(ResourceRequirement, None, None) -ExpressionToolOutputParameterLoader: Final = _RecordLoader( - ExpressionToolOutputParameter, None, None +ResourceRequirementLoader: Final[_Loader[ResourceRequirement]] = _RecordLoader( + ResourceRequirement, None, None ) -ExpressionToolLoader: Final = _RecordLoader(ExpressionTool, None, None) -LinkMergeMethodLoader: Final = _EnumLoader( - ( - "merge_nested", - "merge_flattened", - ), - "LinkMergeMethod", +ExpressionToolOutputParameterLoader: Final[_Loader[ExpressionToolOutputParameter]] = ( + _RecordLoader(ExpressionToolOutputParameter, None, None) +) +ExpressionToolLoader: Final[_Loader[ExpressionTool]] = _RecordLoader( + ExpressionTool, None, None +) +LinkMergeMethodLoader: Final[_Loader[Literal["merge_nested", "merge_flattened"]]] = ( + _EnumLoader( + ( + "merge_nested", + "merge_flattened", + ), + "LinkMergeMethod", + ) ) """ The input link merge method, described in [WorkflowStepInput](#WorkflowStepInput). """ -WorkflowOutputParameterLoader: Final = _RecordLoader( +WorkflowOutputParameterLoader: Final[_Loader[WorkflowOutputParameter]] = _RecordLoader( WorkflowOutputParameter, None, None ) -WorkflowStepInputLoader: Final = _RecordLoader(WorkflowStepInput, None, None) -WorkflowStepOutputLoader: Final = _RecordLoader(WorkflowStepOutput, None, None) -ScatterMethodLoader: Final = _EnumLoader( +WorkflowStepInputLoader: Final[_Loader[WorkflowStepInput]] = _RecordLoader( + WorkflowStepInput, None, None +) +WorkflowStepOutputLoader: Final[_Loader[WorkflowStepOutput]] = _RecordLoader( + WorkflowStepOutput, None, None +) +ScatterMethodLoader: Final[ + _Loader[Literal["dotproduct", "nested_crossproduct", "flat_crossproduct"]] +] = _EnumLoader( ( "dotproduct", "nested_crossproduct", @@ -24358,44 +24432,68 @@ def __init__( """ The scatter method, as described in [workflow step scatter](#WorkflowStep). """ -WorkflowStepLoader: Final = _RecordLoader(WorkflowStep, None, None) -WorkflowLoader: Final = _RecordLoader(Workflow, None, None) -SubworkflowFeatureRequirementLoader: Final = _RecordLoader( - SubworkflowFeatureRequirement, None, None +WorkflowStepLoader: Final[_Loader[WorkflowStep]] = _RecordLoader( + WorkflowStep, None, None +) +WorkflowLoader: Final[_Loader[Workflow]] = _RecordLoader(Workflow, None, None) +SubworkflowFeatureRequirementLoader: Final[_Loader[SubworkflowFeatureRequirement]] = ( + _RecordLoader(SubworkflowFeatureRequirement, None, None) +) +ScatterFeatureRequirementLoader: Final[_Loader[ScatterFeatureRequirement]] = ( + _RecordLoader(ScatterFeatureRequirement, None, None) ) -ScatterFeatureRequirementLoader: Final = _RecordLoader( - ScatterFeatureRequirement, None, None +MultipleInputFeatureRequirementLoader: Final[ + _Loader[MultipleInputFeatureRequirement] +] = _RecordLoader(MultipleInputFeatureRequirement, None, None) +StepInputExpressionRequirementLoader: Final[_Loader[StepInputExpressionRequirement]] = ( + _RecordLoader(StepInputExpressionRequirement, None, None) ) -MultipleInputFeatureRequirementLoader: Final = _RecordLoader( - MultipleInputFeatureRequirement, None, None +LoadListingRequirementLoader: Final[_Loader[LoadListingRequirement]] = _RecordLoader( + LoadListingRequirement, None, None ) -StepInputExpressionRequirementLoader: Final = _RecordLoader( - StepInputExpressionRequirement, None, None +InplaceUpdateRequirementLoader: Final[_Loader[InplaceUpdateRequirement]] = ( + _RecordLoader(InplaceUpdateRequirement, None, None) ) -LoadListingRequirementLoader: Final = _RecordLoader(LoadListingRequirement, None, None) -InplaceUpdateRequirementLoader: Final = _RecordLoader( - InplaceUpdateRequirement, None, None +SecretsLoader: Final[_Loader[Secrets]] = _RecordLoader(Secrets, None, None) +TimeLimitLoader: Final[_Loader[TimeLimit]] = _RecordLoader(TimeLimit, None, None) +WorkReuseLoader: Final[_Loader[WorkReuse]] = _RecordLoader(WorkReuse, None, None) +NetworkAccessLoader: Final[_Loader[NetworkAccess]] = _RecordLoader( + NetworkAccess, 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( +ProcessGeneratorLoader: Final[_Loader[ProcessGenerator]] = _RecordLoader( + ProcessGenerator, None, None +) +MPIRequirementLoader: Final[_Loader[MPIRequirement]] = _RecordLoader( + MPIRequirement, None, None +) +CUDARequirementLoader: Final[_Loader[CUDARequirement]] = _RecordLoader( + CUDARequirement, None, None +) +ShmSizeLoader: Final[_Loader[ShmSize]] = _RecordLoader(ShmSize, None, None) +array_of_strtype: Final[_Loader[Sequence[str]]] = _ArrayLoader(strtype) +union_of_None_type_or_strtype_or_array_of_strtype: Final[ + _Loader[None | Sequence[str] | str] +] = _UnionLoader( ( None_type, strtype, array_of_strtype, ) ) -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( +uri_strtype_True_False_None_None: Final[_Loader[str]] = _URILoader( + strtype, True, False, None, None +) +union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype: Final[ + _Loader[ + ArraySchema + | EnumSchema + | Literal["null", "boolean", "int", "long", "float", "double", "string"] + | MapSchema + | RecordSchema + | UnionSchema + | str + ] +] = _UnionLoader( ( PrimitiveTypeLoader, RecordSchemaLoader, @@ -24406,14 +24504,41 @@ def __init__( strtype, ) ) -array_of_union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype: ( - Final -) = _ArrayLoader( +array_of_union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype: Final[ + _Loader[ + Sequence[ + ArraySchema + | EnumSchema + | Literal["null", "boolean", "int", "long", "float", "double", "string"] + | MapSchema + | RecordSchema + | UnionSchema + | str + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _UnionLoader( ( PrimitiveTypeLoader, RecordSchemaLoader, @@ -24425,57 +24550,117 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: Final = _ArrayLoader(RecordFieldLoader) -union_of_None_type_or_array_of_RecordFieldLoader: Final = _UnionLoader( +array_of_RecordFieldLoader: Final[_Loader[Sequence[RecordField]]] = _ArrayLoader( + RecordFieldLoader +) +union_of_None_type_or_array_of_RecordFieldLoader: Final[ + _Loader[None | Sequence[RecordField]] +] = _UnionLoader( ( None_type, array_of_RecordFieldLoader, ) ) -idmap_fields_union_of_None_type_or_array_of_RecordFieldLoader: Final = _IdMapLoader( - union_of_None_type_or_array_of_RecordFieldLoader, "name", "type" +idmap_fields_union_of_None_type_or_array_of_RecordFieldLoader: Final[ + _Loader[None | Sequence[RecordField]] +] = _IdMapLoader(union_of_None_type_or_array_of_RecordFieldLoader, "name", "type") +Record_nameLoader: Final[_Loader[Literal["record"]]] = _EnumLoader( + ("record",), "Record_name" +) +typedsl_Record_nameLoader_2: Final[_Loader[Literal["record"]]] = _TypeDSLLoader( + Record_nameLoader, 2, "v1.1" ) -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( +union_of_None_type_or_strtype: Final[_Loader[None | str]] = _UnionLoader( ( None_type, strtype, ) ) -uri_union_of_None_type_or_strtype_True_False_None_None: Final = _URILoader( - union_of_None_type_or_strtype, True, False, None, None +uri_union_of_None_type_or_strtype_True_False_None_None: Final[_Loader[None | str]] = ( + _URILoader(union_of_None_type_or_strtype, True, False, None, None) ) -uri_array_of_strtype_True_False_None_None: Final = _URILoader( +uri_array_of_strtype_True_False_None_None: Final[_Loader[Sequence[str]]] = _URILoader( array_of_strtype, True, False, None, None ) -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( +Enum_nameLoader: Final[_Loader[Literal["enum"]]] = _EnumLoader(("enum",), "Enum_name") +typedsl_Enum_nameLoader_2: Final[_Loader[Literal["enum"]]] = _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[ + _Loader[ + 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 + ] +] = _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: 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( +Array_nameLoader: Final[_Loader[Literal["array"]]] = _EnumLoader( + ("array",), "Array_name" +) +typedsl_Array_nameLoader_2: Final[_Loader[Literal["array"]]] = _TypeDSLLoader( + Array_nameLoader, 2, "v1.1" +) +Map_nameLoader: Final[_Loader[Literal["map"]]] = _EnumLoader(("map",), "Map_name") +typedsl_Map_nameLoader_2: Final[_Loader[Literal["map"]]] = _TypeDSLLoader( + Map_nameLoader, 2, "v1.1" +) +Union_nameLoader: Final[_Loader[Literal["union"]]] = _EnumLoader( + ("union",), "Union_name" +) +typedsl_Union_nameLoader_2: Final[_Loader[Literal["union"]]] = _TypeDSLLoader( + Union_nameLoader, 2, "v1.1" +) +union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype: Final[ + _Loader[ + CWLArraySchema + | CWLRecordSchema + | EnumSchema + | Literal["null", "boolean", "int", "long", "float", "double", "string"] + | str + ] +] = _UnionLoader( ( PrimitiveTypeLoader, CWLRecordSchemaLoader, @@ -24484,14 +24669,35 @@ def __init__( strtype, ) ) -array_of_union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype: ( - Final -) = _ArrayLoader( +array_of_union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype: Final[ + _Loader[ + Sequence[ + CWLArraySchema + | CWLRecordSchema + | EnumSchema + | Literal["null", "boolean", "int", "long", "float", "double", "string"] + | str + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _UnionLoader( ( PrimitiveTypeLoader, CWLRecordSchemaLoader, @@ -24501,82 +24707,114 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: Final = _ArrayLoader(CWLRecordFieldLoader) -union_of_None_type_or_array_of_CWLRecordFieldLoader: Final = _UnionLoader( +array_of_CWLRecordFieldLoader: Final[_Loader[Sequence[CWLRecordField]]] = _ArrayLoader( + CWLRecordFieldLoader +) +union_of_None_type_or_array_of_CWLRecordFieldLoader: Final[ + _Loader[None | Sequence[CWLRecordField]] +] = _UnionLoader( ( None_type, array_of_CWLRecordFieldLoader, ) ) -idmap_fields_union_of_None_type_or_array_of_CWLRecordFieldLoader: Final = _IdMapLoader( - union_of_None_type_or_array_of_CWLRecordFieldLoader, "name", "type" -) -File_classLoader: Final = _EnumLoader(("File",), "File_class") -uri_File_classLoader_False_True_None_None: Final = _URILoader( +idmap_fields_union_of_None_type_or_array_of_CWLRecordFieldLoader: Final[ + _Loader[None | Sequence[CWLRecordField]] +] = _IdMapLoader(union_of_None_type_or_array_of_CWLRecordFieldLoader, "name", "type") +File_classLoader: Final[_Loader[Literal["File"]]] = _EnumLoader(("File",), "File_class") +uri_File_classLoader_False_True_None_None: Final[_Loader[Literal["File"]]] = _URILoader( File_classLoader, False, True, None, None ) -uri_union_of_None_type_or_strtype_False_False_None_None: Final = _URILoader( - union_of_None_type_or_strtype, False, False, None, None +uri_union_of_None_type_or_strtype_False_False_None_None: Final[_Loader[None | str]] = ( + _URILoader(union_of_None_type_or_strtype, False, False, None, None) ) -union_of_None_type_or_inttype_or_inttype: Final = _UnionLoader( +union_of_None_type_or_inttype_or_inttype: Final[_Loader[None | i32]] = _UnionLoader( ( None_type, inttype, inttype, ) ) -union_of_FileLoader_or_DirectoryLoader: Final = _UnionLoader( +union_of_FileLoader_or_DirectoryLoader: Final[_Loader[Directory | File]] = _UnionLoader( ( FileLoader, DirectoryLoader, ) ) -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: Final = ( - _UnionLoader( - ( - None_type, - array_of_union_of_FileLoader_or_DirectoryLoader, - ) +array_of_union_of_FileLoader_or_DirectoryLoader: Final[ + _Loader[Sequence[Directory | File]] +] = _ArrayLoader(union_of_FileLoader_or_DirectoryLoader) +union_of_None_type_or_array_of_union_of_FileLoader_or_DirectoryLoader: Final[ + _Loader[None | Sequence[Directory | File]] +] = _UnionLoader( + ( + None_type, + array_of_union_of_FileLoader_or_DirectoryLoader, ) ) -uri_union_of_None_type_or_strtype_True_False_None_True: Final = _URILoader( - union_of_None_type_or_strtype, True, False, None, True +uri_union_of_None_type_or_strtype_True_False_None_True: Final[_Loader[None | str]] = ( + _URILoader(union_of_None_type_or_strtype, True, False, None, True) +) +Directory_classLoader: Final[_Loader[Literal["Directory"]]] = _EnumLoader( + ("Directory",), "Directory_class" ) -Directory_classLoader: Final = _EnumLoader(("Directory",), "Directory_class") -uri_Directory_classLoader_False_True_None_None: Final = _URILoader( - Directory_classLoader, False, True, None, None +uri_Directory_classLoader_False_True_None_None: Final[_Loader[Literal["Directory"]]] = ( + _URILoader(Directory_classLoader, False, True, None, None) ) -union_of_strtype_or_ExpressionLoader: Final = _UnionLoader( +union_of_strtype_or_ExpressionLoader: Final[_Loader[str]] = _UnionLoader( ( strtype, ExpressionLoader, ) ) -array_of_union_of_strtype_or_ExpressionLoader: Final = _ArrayLoader( - union_of_strtype_or_ExpressionLoader +array_of_union_of_strtype_or_ExpressionLoader: Final[_Loader[Sequence[str]]] = ( + _ArrayLoader(union_of_strtype_or_ExpressionLoader) ) -union_of_None_type_or_strtype_or_ExpressionLoader_or_array_of_union_of_strtype_or_ExpressionLoader: ( - Final -) = _UnionLoader( +union_of_None_type_or_strtype_or_ExpressionLoader_or_array_of_union_of_strtype_or_ExpressionLoader: Final[ + _Loader[None | Sequence[str] | str] +] = _UnionLoader( ( None_type, strtype, @@ -24584,15 +24822,31 @@ def __init__( array_of_union_of_strtype_or_ExpressionLoader, ) ) -union_of_None_type_or_booltype: Final = _UnionLoader( +union_of_None_type_or_booltype: Final[_Loader[None | bool]] = _UnionLoader( ( None_type, booltype, ) ) -union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype: ( - Final -) = _UnionLoader( +union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype: Final[ + _Loader[ + InputArraySchema + | InputEnumSchema + | InputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | str + ] +] = _UnionLoader( ( CWLTypeLoader, InputRecordSchemaLoader, @@ -24601,14 +24855,65 @@ def __init__( strtype, ) ) -array_of_union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype: ( - Final -) = _ArrayLoader( +array_of_union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype: Final[ + _Loader[ + Sequence[ + InputArraySchema + | InputEnumSchema + | InputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | str + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _UnionLoader( ( CWLTypeLoader, InputRecordSchemaLoader, @@ -24618,41 +24923,129 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: Final = _UnionLoader( +union_of_None_type_or_CommandLineBindingLoader: Final[ + _Loader[CommandLineBinding | None] +] = _UnionLoader( ( None_type, CommandLineBindingLoader, ) ) -array_of_InputRecordFieldLoader: Final = _ArrayLoader(InputRecordFieldLoader) -union_of_None_type_or_array_of_InputRecordFieldLoader: Final = _UnionLoader( +array_of_InputRecordFieldLoader: Final[_Loader[Sequence[InputRecordField]]] = ( + _ArrayLoader(InputRecordFieldLoader) +) +union_of_None_type_or_array_of_InputRecordFieldLoader: Final[ + _Loader[None | Sequence[InputRecordField]] +] = _UnionLoader( ( None_type, array_of_InputRecordFieldLoader, ) ) -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: ( - Final -) = _URILoader( +idmap_fields_union_of_None_type_or_array_of_InputRecordFieldLoader: Final[ + _Loader[None | Sequence[InputRecordField]] +] = _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: Final[ + _Loader[ + 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 + ] +] = _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: ( - Final -) = _UnionLoader( +union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype: Final[ + _Loader[ + Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | OutputArraySchema + | OutputEnumSchema + | OutputRecordSchema + | str + ] +] = _UnionLoader( ( CWLTypeLoader, OutputRecordSchemaLoader, @@ -24661,14 +25054,65 @@ def __init__( strtype, ) ) -array_of_union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype: ( - Final -) = _ArrayLoader( +array_of_union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype: Final[ + _Loader[ + Sequence[ + Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | OutputArraySchema + | OutputEnumSchema + | OutputRecordSchema + | str + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _UnionLoader( ( CWLTypeLoader, OutputRecordSchemaLoader, @@ -24678,60 +25122,166 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: Final = _UnionLoader( +union_of_None_type_or_CommandOutputBindingLoader: Final[ + _Loader[CommandOutputBinding | None] +] = _UnionLoader( ( None_type, CommandOutputBindingLoader, ) ) -array_of_OutputRecordFieldLoader: Final = _ArrayLoader(OutputRecordFieldLoader) -union_of_None_type_or_array_of_OutputRecordFieldLoader: Final = _UnionLoader( +array_of_OutputRecordFieldLoader: Final[_Loader[Sequence[OutputRecordField]]] = ( + _ArrayLoader(OutputRecordFieldLoader) +) +union_of_None_type_or_array_of_OutputRecordFieldLoader: Final[ + _Loader[None | Sequence[OutputRecordField]] +] = _UnionLoader( ( None_type, array_of_OutputRecordFieldLoader, ) ) -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: ( - Final -) = _URILoader( +idmap_fields_union_of_None_type_or_array_of_OutputRecordFieldLoader: Final[ + _Loader[None | Sequence[OutputRecordField]] +] = _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: Final[ + _Loader[ + 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 + ] +] = _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: Final = ( - _UnionLoader( - ( - None_type, - strtype, - array_of_strtype, - ExpressionLoader, - ) +union_of_None_type_or_strtype_or_array_of_strtype_or_ExpressionLoader: Final[ + _Loader[None | Sequence[str] | str] +] = _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: ( - Final -) = _URILoader( +uri_union_of_None_type_or_strtype_or_array_of_strtype_or_ExpressionLoader_True_False_None_True: Final[ + _Loader[None | Sequence[str] | str] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _UnionLoader( ( None_type, CWLTypeLoader, @@ -24742,36 +25292,98 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: Final = _UnionLoader( - ( - None_type, - strtype, - ExpressionLoader, +union_of_None_type_or_strtype_or_ExpressionLoader: Final[_Loader[None | str]] = ( + _UnionLoader( + ( + None_type, + strtype, + ExpressionLoader, + ) ) ) -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 - ) +uri_union_of_None_type_or_strtype_or_ExpressionLoader_True_False_None_True: Final[ + _Loader[None | str] +] = _URILoader( + union_of_None_type_or_strtype_or_ExpressionLoader, True, False, None, True ) -array_of_InputParameterLoader: Final = _ArrayLoader(InputParameterLoader) -idmap_inputs_array_of_InputParameterLoader: Final = _IdMapLoader( - array_of_InputParameterLoader, "id", "type" +array_of_InputParameterLoader: Final[_Loader[Sequence[InputParameter]]] = _ArrayLoader( + InputParameterLoader ) -array_of_OutputParameterLoader: Final = _ArrayLoader(OutputParameterLoader) -idmap_outputs_array_of_OutputParameterLoader: Final = _IdMapLoader( - array_of_OutputParameterLoader, "id", "type" +idmap_inputs_array_of_InputParameterLoader: Final[_Loader[Sequence[InputParameter]]] = ( + _IdMapLoader(array_of_InputParameterLoader, "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: ( - Final -) = _UnionLoader( +array_of_OutputParameterLoader: Final[_Loader[Sequence[OutputParameter]]] = ( + _ArrayLoader(OutputParameterLoader) +) +idmap_outputs_array_of_OutputParameterLoader: Final[ + _Loader[Sequence[OutputParameter]] +] = _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: Final[ + _Loader[ + CUDARequirement + | DockerRequirement + | EnvVarRequirement + | InitialWorkDirRequirement + | InlineJavascriptRequirement + | InplaceUpdateRequirement + | LoadListingRequirement + | MPIRequirement + | MultipleInputFeatureRequirement + | NetworkAccess + | ResourceRequirement + | ScatterFeatureRequirement + | SchemaDefRequirement + | Secrets + | ShellCommandRequirement + | ShmSize + | SoftwareRequirement + | StepInputExpressionRequirement + | SubworkflowFeatureRequirement + | TimeLimit + | WorkReuse + ] +] = _UnionLoader( ( InlineJavascriptRequirementLoader, SchemaDefRequirementLoader, @@ -24796,29 +25408,126 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + Sequence[ + CUDARequirement + | DockerRequirement + | EnvVarRequirement + | InitialWorkDirRequirement + | InlineJavascriptRequirement + | InplaceUpdateRequirement + | LoadListingRequirement + | MPIRequirement + | MultipleInputFeatureRequirement + | NetworkAccess + | ResourceRequirement + | ScatterFeatureRequirement + | SchemaDefRequirement + | Secrets + | ShellCommandRequirement + | ShmSize + | SoftwareRequirement + | StepInputExpressionRequirement + | SubworkflowFeatureRequirement + | TimeLimit + | WorkReuse + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + None + | Sequence[ + CUDARequirement + | DockerRequirement + | EnvVarRequirement + | InitialWorkDirRequirement + | InlineJavascriptRequirement + | InplaceUpdateRequirement + | LoadListingRequirement + | MPIRequirement + | MultipleInputFeatureRequirement + | NetworkAccess + | ResourceRequirement + | ScatterFeatureRequirement + | SchemaDefRequirement + | Secrets + | ShellCommandRequirement + | ShmSize + | SoftwareRequirement + | StepInputExpressionRequirement + | SubworkflowFeatureRequirement + | TimeLimit + | WorkReuse + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + None + | Sequence[ + CUDARequirement + | DockerRequirement + | EnvVarRequirement + | InitialWorkDirRequirement + | InlineJavascriptRequirement + | InplaceUpdateRequirement + | LoadListingRequirement + | MPIRequirement + | MultipleInputFeatureRequirement + | NetworkAccess + | ResourceRequirement + | ScatterFeatureRequirement + | SchemaDefRequirement + | Secrets + | ShellCommandRequirement + | ShmSize + | SoftwareRequirement + | StepInputExpressionRequirement + | SubworkflowFeatureRequirement + | TimeLimit + | WorkReuse + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + Any + | CUDARequirement + | DockerRequirement + | EnvVarRequirement + | InitialWorkDirRequirement + | InlineJavascriptRequirement + | InplaceUpdateRequirement + | LoadListingRequirement + | MPIRequirement + | MultipleInputFeatureRequirement + | NetworkAccess + | ResourceRequirement + | ScatterFeatureRequirement + | SchemaDefRequirement + | Secrets + | ShellCommandRequirement + | ShmSize + | SoftwareRequirement + | StepInputExpressionRequirement + | SubworkflowFeatureRequirement + | TimeLimit + | WorkReuse + ] +] = _UnionLoader( ( InlineJavascriptRequirementLoader, SchemaDefRequirementLoader, @@ -24844,55 +25553,136 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + Sequence[ + Any + | CUDARequirement + | DockerRequirement + | EnvVarRequirement + | InitialWorkDirRequirement + | InlineJavascriptRequirement + | InplaceUpdateRequirement + | LoadListingRequirement + | MPIRequirement + | MultipleInputFeatureRequirement + | NetworkAccess + | ResourceRequirement + | ScatterFeatureRequirement + | SchemaDefRequirement + | Secrets + | ShellCommandRequirement + | ShmSize + | SoftwareRequirement + | StepInputExpressionRequirement + | SubworkflowFeatureRequirement + | TimeLimit + | WorkReuse + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + None + | Sequence[ + Any + | CUDARequirement + | DockerRequirement + | EnvVarRequirement + | InitialWorkDirRequirement + | InlineJavascriptRequirement + | InplaceUpdateRequirement + | LoadListingRequirement + | MPIRequirement + | MultipleInputFeatureRequirement + | NetworkAccess + | ResourceRequirement + | ScatterFeatureRequirement + | SchemaDefRequirement + | Secrets + | ShellCommandRequirement + | ShmSize + | SoftwareRequirement + | StepInputExpressionRequirement + | SubworkflowFeatureRequirement + | TimeLimit + | WorkReuse + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + None + | Sequence[ + Any + | CUDARequirement + | DockerRequirement + | EnvVarRequirement + | InitialWorkDirRequirement + | InlineJavascriptRequirement + | InplaceUpdateRequirement + | LoadListingRequirement + | MPIRequirement + | MultipleInputFeatureRequirement + | NetworkAccess + | ResourceRequirement + | ScatterFeatureRequirement + | SchemaDefRequirement + | Secrets + | ShellCommandRequirement + | ShmSize + | SoftwareRequirement + | StepInputExpressionRequirement + | SubworkflowFeatureRequirement + | TimeLimit + | WorkReuse + ] + ] +] = _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: Final = _UnionLoader( - ( - None_type, - CWLVersionLoader, +union_of_None_type_or_CWLVersionLoader: Final[_Loader[Literal["v1.0"] | None]] = ( + _UnionLoader( + ( + None_type, + CWLVersionLoader, + ) ) ) -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: Final = _EnumLoader( - ("InlineJavascriptRequirement",), "InlineJavascriptRequirement_class" -) -uri_InlineJavascriptRequirement_classLoader_False_True_None_None: Final = _URILoader( - InlineJavascriptRequirement_classLoader, False, True, None, None -) -union_of_None_type_or_array_of_strtype: Final = _UnionLoader( - ( - None_type, - array_of_strtype, +uri_union_of_None_type_or_CWLVersionLoader_False_True_None_None: Final[ + _Loader[Literal["v1.0"] | None] +] = _URILoader(union_of_None_type_or_CWLVersionLoader, False, True, None, None) +InlineJavascriptRequirement_classLoader: Final[ + _Loader[Literal["InlineJavascriptRequirement"]] +] = _EnumLoader(("InlineJavascriptRequirement",), "InlineJavascriptRequirement_class") +uri_InlineJavascriptRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["InlineJavascriptRequirement"]] +] = _URILoader(InlineJavascriptRequirement_classLoader, False, True, None, None) +union_of_None_type_or_array_of_strtype: Final[_Loader[None | Sequence[str]]] = ( + _UnionLoader( + ( + None_type, + array_of_strtype, + ) ) ) -SchemaDefRequirement_classLoader: Final = _EnumLoader( - ("SchemaDefRequirement",), "SchemaDefRequirement_class" -) -uri_SchemaDefRequirement_classLoader_False_True_None_None: Final = _URILoader( - SchemaDefRequirement_classLoader, False, True, None, None +SchemaDefRequirement_classLoader: Final[_Loader[Literal["SchemaDefRequirement"]]] = ( + _EnumLoader(("SchemaDefRequirement",), "SchemaDefRequirement_class") ) +uri_SchemaDefRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["SchemaDefRequirement"]] +] = _URILoader(SchemaDefRequirement_classLoader, False, True, None, None) union_of_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader: ( - Final + Final[_Loader[InputArraySchema | InputEnumSchema | InputRecordSchema]] ) = _UnionLoader( ( InputRecordSchemaLoader, @@ -24900,30 +25690,46 @@ def __init__( InputArraySchemaLoader, ) ) -array_of_union_of_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader: ( - Final -) = _ArrayLoader( +array_of_union_of_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader: Final[ + _Loader[Sequence[InputArraySchema | InputEnumSchema | InputRecordSchema]] +] = _ArrayLoader( union_of_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader ) -union_of_None_type_or_inttype: Final = _UnionLoader( +union_of_None_type_or_inttype: Final[_Loader[None | i32]] = _UnionLoader( ( None_type, inttype, ) ) -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_strtype_or_ExpressionLoader_or_array_of_strtype: Final[ + _Loader[None | Sequence[str] | str] +] = _UnionLoader( + ( + None_type, + strtype, + ExpressionLoader, + array_of_strtype, ) ) -union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype: ( - Final -) = _UnionLoader( +union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype: Final[ + _Loader[ + CommandInputArraySchema + | CommandInputEnumSchema + | CommandInputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | str + ] +] = _UnionLoader( ( CWLTypeLoader, CommandInputRecordSchemaLoader, @@ -24932,14 +25738,65 @@ def __init__( strtype, ) ) -array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype: ( - Final -) = _ArrayLoader( +array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype: Final[ + _Loader[ + Sequence[ + CommandInputArraySchema + | CommandInputEnumSchema + | CommandInputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | str + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _UnionLoader( ( CWLTypeLoader, CommandInputRecordSchemaLoader, @@ -24949,39 +25806,123 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: Final = _ArrayLoader( - CommandInputRecordFieldLoader -) -union_of_None_type_or_array_of_CommandInputRecordFieldLoader: Final = _UnionLoader( +array_of_CommandInputRecordFieldLoader: Final[ + _Loader[Sequence[CommandInputRecordField]] +] = _ArrayLoader(CommandInputRecordFieldLoader) +union_of_None_type_or_array_of_CommandInputRecordFieldLoader: Final[ + _Loader[None | Sequence[CommandInputRecordField]] +] = _UnionLoader( ( None_type, 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" - ) +idmap_fields_union_of_None_type_or_array_of_CommandInputRecordFieldLoader: Final[ + _Loader[None | Sequence[CommandInputRecordField]] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: ( - Final -) = _UnionLoader( +union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype: Final[ + _Loader[ + CommandOutputArraySchema + | CommandOutputEnumSchema + | CommandOutputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | str + ] +] = _UnionLoader( ( CWLTypeLoader, CommandOutputRecordSchemaLoader, @@ -24990,14 +25931,65 @@ def __init__( strtype, ) ) -array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype: ( - Final -) = _ArrayLoader( +array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype: Final[ + _Loader[ + Sequence[ + CommandOutputArraySchema + | CommandOutputEnumSchema + | CommandOutputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | str + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _UnionLoader( ( CWLTypeLoader, CommandOutputRecordSchemaLoader, @@ -25007,39 +25999,141 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: Final = _ArrayLoader( - CommandOutputRecordFieldLoader -) -union_of_None_type_or_array_of_CommandOutputRecordFieldLoader: Final = _UnionLoader( +array_of_CommandOutputRecordFieldLoader: Final[ + _Loader[Sequence[CommandOutputRecordField]] +] = _ArrayLoader(CommandOutputRecordFieldLoader) +union_of_None_type_or_array_of_CommandOutputRecordFieldLoader: Final[ + _Loader[None | Sequence[CommandOutputRecordField]] +] = _UnionLoader( ( None_type, 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" - ) +idmap_fields_union_of_None_type_or_array_of_CommandOutputRecordFieldLoader: Final[ + _Loader[None | Sequence[CommandOutputRecordField]] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _UnionLoader( ( None_type, CWLTypeLoader, @@ -25050,16 +26144,86 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _UnionLoader( ( None_type, CWLTypeLoader, @@ -25072,81 +26236,125 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: Final = _EnumLoader( +CommandLineTool_classLoader: Final[_Loader[Literal["CommandLineTool"]]] = _EnumLoader( ("CommandLineTool",), "CommandLineTool_class" ) -uri_CommandLineTool_classLoader_False_True_None_None: Final = _URILoader( - CommandLineTool_classLoader, False, True, None, None -) -array_of_CommandInputParameterLoader: Final = _ArrayLoader(CommandInputParameterLoader) -idmap_inputs_array_of_CommandInputParameterLoader: Final = _IdMapLoader( - array_of_CommandInputParameterLoader, "id", "type" -) -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: Final = _UnionLoader( +uri_CommandLineTool_classLoader_False_True_None_None: Final[ + _Loader[Literal["CommandLineTool"]] +] = _URILoader(CommandLineTool_classLoader, False, True, None, None) +array_of_CommandInputParameterLoader: Final[ + _Loader[Sequence[CommandInputParameter]] +] = _ArrayLoader(CommandInputParameterLoader) +idmap_inputs_array_of_CommandInputParameterLoader: Final[ + _Loader[Sequence[CommandInputParameter]] +] = _IdMapLoader(array_of_CommandInputParameterLoader, "id", "type") +array_of_CommandOutputParameterLoader: Final[ + _Loader[Sequence[CommandOutputParameter]] +] = _ArrayLoader(CommandOutputParameterLoader) +idmap_outputs_array_of_CommandOutputParameterLoader: Final[ + _Loader[Sequence[CommandOutputParameter]] +] = _IdMapLoader(array_of_CommandOutputParameterLoader, "id", "type") +union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader: Final[ + _Loader[CommandLineBinding | str] +] = _UnionLoader( ( strtype, ExpressionLoader, 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: ( - Final -) = _UnionLoader( +array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader: Final[ + _Loader[Sequence[CommandLineBinding | str]] +] = _ArrayLoader(union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader) +union_of_None_type_or_array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader: Final[ + _Loader[None | Sequence[CommandLineBinding | str]] +] = _UnionLoader( ( None_type, array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader, ) ) -array_of_inttype: Final = _ArrayLoader(inttype) -union_of_None_type_or_array_of_inttype: Final = _UnionLoader( - ( - None_type, - array_of_inttype, +array_of_inttype: Final[_Loader[Sequence[i32]]] = _ArrayLoader(inttype) +union_of_None_type_or_array_of_inttype: Final[_Loader[None | Sequence[i32]]] = ( + _UnionLoader( + ( + None_type, + array_of_inttype, + ) ) ) -DockerRequirement_classLoader: Final = _EnumLoader( - ("DockerRequirement",), "DockerRequirement_class" +DockerRequirement_classLoader: Final[_Loader[Literal["DockerRequirement"]]] = ( + _EnumLoader(("DockerRequirement",), "DockerRequirement_class") ) -uri_DockerRequirement_classLoader_False_True_None_None: Final = _URILoader( - DockerRequirement_classLoader, False, True, None, None +uri_DockerRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["DockerRequirement"]] +] = _URILoader(DockerRequirement_classLoader, False, True, None, None) +SoftwareRequirement_classLoader: Final[_Loader[Literal["SoftwareRequirement"]]] = ( + _EnumLoader(("SoftwareRequirement",), "SoftwareRequirement_class") ) -SoftwareRequirement_classLoader: Final = _EnumLoader( - ("SoftwareRequirement",), "SoftwareRequirement_class" -) -uri_SoftwareRequirement_classLoader_False_True_None_None: Final = _URILoader( - SoftwareRequirement_classLoader, False, True, None, None -) -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: Final = _URILoader( - union_of_None_type_or_array_of_strtype, False, False, None, True -) -InitialWorkDirRequirement_classLoader: Final = _EnumLoader( - ("InitialWorkDirRequirement",), "InitialWorkDirRequirement_class" -) -uri_InitialWorkDirRequirement_classLoader_False_True_None_None: Final = _URILoader( - InitialWorkDirRequirement_classLoader, False, True, None, None +uri_SoftwareRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["SoftwareRequirement"]] +] = _URILoader(SoftwareRequirement_classLoader, False, True, None, None) +array_of_SoftwarePackageLoader: Final[_Loader[Sequence[SoftwarePackage]]] = ( + _ArrayLoader(SoftwarePackageLoader) ) +idmap_packages_array_of_SoftwarePackageLoader: Final[ + _Loader[Sequence[SoftwarePackage]] +] = _IdMapLoader(array_of_SoftwarePackageLoader, "package", "specs") +uri_union_of_None_type_or_array_of_strtype_False_False_None_True: Final[ + _Loader[None | Sequence[str]] +] = _URILoader(union_of_None_type_or_array_of_strtype, False, False, None, True) +InitialWorkDirRequirement_classLoader: Final[ + _Loader[Literal["InitialWorkDirRequirement"]] +] = _EnumLoader(("InitialWorkDirRequirement",), "InitialWorkDirRequirement_class") +uri_InitialWorkDirRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["InitialWorkDirRequirement"]] +] = _URILoader(InitialWorkDirRequirement_classLoader, False, True, None, None) union_of_FileLoader_or_DirectoryLoader_or_DirentLoader_or_strtype_or_ExpressionLoader: ( - Final + Final[_Loader[Directory | Dirent | File | str]] ) = _UnionLoader( ( FileLoader, @@ -25156,54 +26364,58 @@ def __init__( ExpressionLoader, ) ) -array_of_union_of_FileLoader_or_DirectoryLoader_or_DirentLoader_or_strtype_or_ExpressionLoader: ( - Final -) = _ArrayLoader( +array_of_union_of_FileLoader_or_DirectoryLoader_or_DirentLoader_or_strtype_or_ExpressionLoader: Final[ + _Loader[Sequence[Directory | Dirent | File | str]] +] = _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: ( - Final -) = _UnionLoader( +union_of_array_of_union_of_FileLoader_or_DirectoryLoader_or_DirentLoader_or_strtype_or_ExpressionLoader_or_strtype_or_ExpressionLoader: Final[ + _Loader[Sequence[Directory | Dirent | File | str] | str] +] = _UnionLoader( ( array_of_union_of_FileLoader_or_DirectoryLoader_or_DirentLoader_or_strtype_or_ExpressionLoader, strtype, ExpressionLoader, ) ) -EnvVarRequirement_classLoader: Final = _EnumLoader( - ("EnvVarRequirement",), "EnvVarRequirement_class" -) -uri_EnvVarRequirement_classLoader_False_True_None_None: Final = _URILoader( - EnvVarRequirement_classLoader, False, True, None, None -) -array_of_EnvironmentDefLoader: Final = _ArrayLoader(EnvironmentDefLoader) -idmap_envDef_array_of_EnvironmentDefLoader: Final = _IdMapLoader( - array_of_EnvironmentDefLoader, "envName", "envValue" +EnvVarRequirement_classLoader: Final[_Loader[Literal["EnvVarRequirement"]]] = ( + _EnumLoader(("EnvVarRequirement",), "EnvVarRequirement_class") ) -ShellCommandRequirement_classLoader: Final = _EnumLoader( - ("ShellCommandRequirement",), "ShellCommandRequirement_class" +uri_EnvVarRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["EnvVarRequirement"]] +] = _URILoader(EnvVarRequirement_classLoader, False, True, None, None) +array_of_EnvironmentDefLoader: Final[_Loader[Sequence[EnvironmentDef]]] = _ArrayLoader( + EnvironmentDefLoader ) -uri_ShellCommandRequirement_classLoader_False_True_None_None: Final = _URILoader( - ShellCommandRequirement_classLoader, False, True, None, None +idmap_envDef_array_of_EnvironmentDefLoader: Final[_Loader[Sequence[EnvironmentDef]]] = ( + _IdMapLoader(array_of_EnvironmentDefLoader, "envName", "envValue") ) -ResourceRequirement_classLoader: Final = _EnumLoader( - ("ResourceRequirement",), "ResourceRequirement_class" +ShellCommandRequirement_classLoader: Final[ + _Loader[Literal["ShellCommandRequirement"]] +] = _EnumLoader(("ShellCommandRequirement",), "ShellCommandRequirement_class") +uri_ShellCommandRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["ShellCommandRequirement"]] +] = _URILoader(ShellCommandRequirement_classLoader, False, True, None, None) +ResourceRequirement_classLoader: Final[_Loader[Literal["ResourceRequirement"]]] = ( + _EnumLoader(("ResourceRequirement",), "ResourceRequirement_class") ) -uri_ResourceRequirement_classLoader_False_True_None_None: Final = _URILoader( - ResourceRequirement_classLoader, False, True, None, None -) -union_of_None_type_or_inttype_or_inttype_or_strtype_or_ExpressionLoader: Final = ( - _UnionLoader( - ( - None_type, - inttype, - inttype, - strtype, - ExpressionLoader, - ) +uri_ResourceRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["ResourceRequirement"]] +] = _URILoader(ResourceRequirement_classLoader, False, True, None, None) +union_of_None_type_or_inttype_or_inttype_or_strtype_or_ExpressionLoader: Final[ + _Loader[None | i32 | str] +] = _UnionLoader( + ( + None_type, + inttype, + inttype, + strtype, + ExpressionLoader, ) ) -union_of_None_type_or_inttype_or_strtype_or_ExpressionLoader: Final = _UnionLoader( +union_of_None_type_or_inttype_or_strtype_or_ExpressionLoader: Final[ + _Loader[None | i32 | str] +] = _UnionLoader( ( None_type, inttype, @@ -25211,9 +26423,43 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _UnionLoader( ( None_type, CWLTypeLoader, @@ -25224,75 +26470,117 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: Final = _EnumLoader( +ExpressionTool_classLoader: Final[_Loader[Literal["ExpressionTool"]]] = _EnumLoader( ("ExpressionTool",), "ExpressionTool_class" ) -uri_ExpressionTool_classLoader_False_True_None_None: Final = _URILoader( - ExpressionTool_classLoader, False, True, None, None -) -array_of_ExpressionToolOutputParameterLoader: Final = _ArrayLoader( - ExpressionToolOutputParameterLoader -) -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: Final = ( - _URILoader(union_of_None_type_or_strtype_or_array_of_strtype, False, False, 1, None) -) -union_of_None_type_or_LinkMergeMethodLoader: Final = _UnionLoader( +uri_ExpressionTool_classLoader_False_True_None_None: Final[ + _Loader[Literal["ExpressionTool"]] +] = _URILoader(ExpressionTool_classLoader, False, True, None, None) +array_of_ExpressionToolOutputParameterLoader: Final[ + _Loader[Sequence[ExpressionToolOutputParameter]] +] = _ArrayLoader(ExpressionToolOutputParameterLoader) +idmap_outputs_array_of_ExpressionToolOutputParameterLoader: Final[ + _Loader[Sequence[ExpressionToolOutputParameter]] +] = _IdMapLoader(array_of_ExpressionToolOutputParameterLoader, "id", "type") +uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_1_None: Final[ + _Loader[None | Sequence[str] | str] +] = _URILoader(union_of_None_type_or_strtype_or_array_of_strtype, False, False, 1, None) +union_of_None_type_or_LinkMergeMethodLoader: Final[ + _Loader[Literal["merge_nested", "merge_flattened"] | None] +] = _UnionLoader( ( None_type, LinkMergeMethodLoader, ) ) -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: Final = _ArrayLoader(WorkflowStepInputLoader) -idmap_in__array_of_WorkflowStepInputLoader: Final = _IdMapLoader( - array_of_WorkflowStepInputLoader, "id", "source" +uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_2_None: Final[ + _Loader[None | Sequence[str] | str] +] = _URILoader(union_of_None_type_or_strtype_or_array_of_strtype, False, False, 2, None) +array_of_WorkflowStepInputLoader: Final[_Loader[Sequence[WorkflowStepInput]]] = ( + _ArrayLoader(WorkflowStepInputLoader) ) -union_of_strtype_or_WorkflowStepOutputLoader: Final = _UnionLoader( +idmap_in__array_of_WorkflowStepInputLoader: Final[ + _Loader[Sequence[WorkflowStepInput]] +] = _IdMapLoader(array_of_WorkflowStepInputLoader, "id", "source") +union_of_strtype_or_WorkflowStepOutputLoader: Final[ + _Loader[WorkflowStepOutput | str] +] = _UnionLoader( ( strtype, WorkflowStepOutputLoader, ) ) -array_of_union_of_strtype_or_WorkflowStepOutputLoader: Final = _ArrayLoader( - union_of_strtype_or_WorkflowStepOutputLoader -) -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: ( - Final -) = _URILoader( +array_of_union_of_strtype_or_WorkflowStepOutputLoader: Final[ + _Loader[Sequence[WorkflowStepOutput | str]] +] = _ArrayLoader(union_of_strtype_or_WorkflowStepOutputLoader) +union_of_array_of_union_of_strtype_or_WorkflowStepOutputLoader: Final[ + _Loader[Sequence[WorkflowStepOutput | str]] +] = _UnionLoader((array_of_union_of_strtype_or_WorkflowStepOutputLoader,)) +uri_union_of_array_of_union_of_strtype_or_WorkflowStepOutputLoader_True_False_None_None: Final[ + _Loader[Sequence[WorkflowStepOutput | str]] +] = _URILoader( union_of_array_of_union_of_strtype_or_WorkflowStepOutputLoader, True, False, None, None, ) -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, +array_of_Any_type: Final[_Loader[Sequence[Any]]] = _ArrayLoader(Any_type) +union_of_None_type_or_array_of_Any_type: Final[_Loader[None | Sequence[Any]]] = ( + _UnionLoader( + ( + None_type, + array_of_Any_type, + ) ) ) -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: ( - Final -) = _UnionLoader( +idmap_hints_union_of_None_type_or_array_of_Any_type: Final[ + _Loader[None | Sequence[Any]] +] = _IdMapLoader(union_of_None_type_or_array_of_Any_type, "class", "None") +union_of_strtype_or_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader: Final[ + _Loader[CommandLineTool | ExpressionTool | ProcessGenerator | Workflow | str] +] = _UnionLoader( ( strtype, CommandLineToolLoader, @@ -25301,70 +26589,86 @@ def __init__( ProcessGeneratorLoader, ) ) -uri_union_of_strtype_or_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader_False_False_None_None: ( - Final -) = _URILoader( +uri_union_of_strtype_or_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader_False_False_None_None: Final[ + _Loader[CommandLineTool | ExpressionTool | ProcessGenerator | Workflow | str] +] = _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: Final = ( - _URILoader(union_of_None_type_or_strtype_or_array_of_strtype, False, False, 0, None) -) -union_of_None_type_or_ScatterMethodLoader: Final = _UnionLoader( +uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_0_None: Final[ + _Loader[None | Sequence[str] | str] +] = _URILoader(union_of_None_type_or_strtype_or_array_of_strtype, False, False, 0, None) +union_of_None_type_or_ScatterMethodLoader: Final[ + _Loader[Literal["dotproduct", "nested_crossproduct", "flat_crossproduct"] | None] +] = _UnionLoader( ( None_type, ScatterMethodLoader, ) ) -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: Final = _EnumLoader(("Workflow",), "Workflow_class") -uri_Workflow_classLoader_False_True_None_None: Final = _URILoader( - Workflow_classLoader, False, True, None, None +uri_union_of_None_type_or_ScatterMethodLoader_False_True_None_None: Final[ + _Loader[Literal["dotproduct", "nested_crossproduct", "flat_crossproduct"] | None] +] = _URILoader(union_of_None_type_or_ScatterMethodLoader, False, True, None, None) +Workflow_classLoader: Final[_Loader[Literal["Workflow"]]] = _EnumLoader( + ("Workflow",), "Workflow_class" ) -array_of_WorkflowOutputParameterLoader: Final = _ArrayLoader( - WorkflowOutputParameterLoader +uri_Workflow_classLoader_False_True_None_None: Final[_Loader[Literal["Workflow"]]] = ( + _URILoader(Workflow_classLoader, False, True, None, None) ) -idmap_outputs_array_of_WorkflowOutputParameterLoader: Final = _IdMapLoader( - array_of_WorkflowOutputParameterLoader, "id", "type" +array_of_WorkflowOutputParameterLoader: Final[ + _Loader[Sequence[WorkflowOutputParameter]] +] = _ArrayLoader(WorkflowOutputParameterLoader) +idmap_outputs_array_of_WorkflowOutputParameterLoader: Final[ + _Loader[Sequence[WorkflowOutputParameter]] +] = _IdMapLoader(array_of_WorkflowOutputParameterLoader, "id", "type") +array_of_WorkflowStepLoader: Final[_Loader[Sequence[WorkflowStep]]] = _ArrayLoader( + WorkflowStepLoader ) -array_of_WorkflowStepLoader: Final = _ArrayLoader(WorkflowStepLoader) -union_of_array_of_WorkflowStepLoader: Final = _UnionLoader( - (array_of_WorkflowStepLoader,) +union_of_array_of_WorkflowStepLoader: Final[_Loader[Sequence[WorkflowStep]]] = ( + _UnionLoader((array_of_WorkflowStepLoader,)) ) -idmap_steps_union_of_array_of_WorkflowStepLoader: Final = _IdMapLoader( - union_of_array_of_WorkflowStepLoader, "id", "None" -) -SubworkflowFeatureRequirement_classLoader: Final = _EnumLoader( +idmap_steps_union_of_array_of_WorkflowStepLoader: Final[ + _Loader[Sequence[WorkflowStep]] +] = _IdMapLoader(union_of_array_of_WorkflowStepLoader, "id", "None") +SubworkflowFeatureRequirement_classLoader: Final[ + _Loader[Literal["SubworkflowFeatureRequirement"]] +] = _EnumLoader( ("SubworkflowFeatureRequirement",), "SubworkflowFeatureRequirement_class" ) -uri_SubworkflowFeatureRequirement_classLoader_False_True_None_None: Final = _URILoader( - SubworkflowFeatureRequirement_classLoader, False, True, None, None -) -ScatterFeatureRequirement_classLoader: Final = _EnumLoader( - ("ScatterFeatureRequirement",), "ScatterFeatureRequirement_class" -) -uri_ScatterFeatureRequirement_classLoader_False_True_None_None: Final = _URILoader( - ScatterFeatureRequirement_classLoader, False, True, None, None -) -MultipleInputFeatureRequirement_classLoader: Final = _EnumLoader( +uri_SubworkflowFeatureRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["SubworkflowFeatureRequirement"]] +] = _URILoader(SubworkflowFeatureRequirement_classLoader, False, True, None, None) +ScatterFeatureRequirement_classLoader: Final[ + _Loader[Literal["ScatterFeatureRequirement"]] +] = _EnumLoader(("ScatterFeatureRequirement",), "ScatterFeatureRequirement_class") +uri_ScatterFeatureRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["ScatterFeatureRequirement"]] +] = _URILoader(ScatterFeatureRequirement_classLoader, False, True, None, None) +MultipleInputFeatureRequirement_classLoader: Final[ + _Loader[Literal["MultipleInputFeatureRequirement"]] +] = _EnumLoader( ("MultipleInputFeatureRequirement",), "MultipleInputFeatureRequirement_class" ) -uri_MultipleInputFeatureRequirement_classLoader_False_True_None_None: Final = ( - _URILoader(MultipleInputFeatureRequirement_classLoader, False, True, None, None) -) -StepInputExpressionRequirement_classLoader: Final = _EnumLoader( +uri_MultipleInputFeatureRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["MultipleInputFeatureRequirement"]] +] = _URILoader(MultipleInputFeatureRequirement_classLoader, False, True, None, None) +StepInputExpressionRequirement_classLoader: Final[ + _Loader[Literal["StepInputExpressionRequirement"]] +] = _EnumLoader( ("StepInputExpressionRequirement",), "StepInputExpressionRequirement_class" ) -uri_StepInputExpressionRequirement_classLoader_False_True_None_None: Final = _URILoader( - StepInputExpressionRequirement_classLoader, False, True, None, None +uri_StepInputExpressionRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["StepInputExpressionRequirement"]] +] = _URILoader(StepInputExpressionRequirement_classLoader, False, True, None, None) +uri_strtype_False_True_None_None: Final[_Loader[str]] = _URILoader( + strtype, False, True, None, None ) -uri_strtype_False_True_None_None: Final = _URILoader(strtype, False, True, None, None) -LoadListingEnumLoader: Final = _EnumLoader( +LoadListingEnumLoader: Final[ + _Loader[Literal["no_listing", "shallow_listing", "deep_listing"]] +] = _EnumLoader( ( "no_listing", "shallow_listing", @@ -25372,44 +26676,50 @@ def __init__( ), "LoadListingEnum", ) -union_of_LoadListingEnumLoader: Final = _UnionLoader((LoadListingEnumLoader,)) -uri_array_of_strtype_False_False_0_None: Final = _URILoader( +union_of_LoadListingEnumLoader: Final[ + _Loader[Literal["no_listing", "shallow_listing", "deep_listing"]] +] = _UnionLoader((LoadListingEnumLoader,)) +uri_array_of_strtype_False_False_0_None: Final[_Loader[Sequence[str]]] = _URILoader( array_of_strtype, False, False, 0, None ) -union_of_inttype_or_strtype: Final = _UnionLoader( +union_of_inttype_or_strtype: Final[_Loader[i32 | str]] = _UnionLoader( ( inttype, strtype, ) ) -union_of_booltype_or_strtype: Final = _UnionLoader( +union_of_booltype_or_strtype: Final[_Loader[bool | str]] = _UnionLoader( ( booltype, strtype, ) ) -union_of_inttype_or_ExpressionLoader: Final = _UnionLoader( +union_of_inttype_or_ExpressionLoader: Final[_Loader[i32 | str]] = _UnionLoader( ( inttype, ExpressionLoader, ) ) -union_of_strtype_or_array_of_strtype: Final = _UnionLoader( - ( - strtype, - array_of_strtype, +union_of_strtype_or_array_of_strtype: Final[_Loader[Sequence[str] | str]] = ( + _UnionLoader( + ( + strtype, + array_of_strtype, + ) ) ) -union_of_None_type_or_inttype_or_ExpressionLoader: Final = _UnionLoader( - ( - None_type, - inttype, - ExpressionLoader, +union_of_None_type_or_inttype_or_ExpressionLoader: Final[_Loader[None | i32 | str]] = ( + _UnionLoader( + ( + None_type, + inttype, + ExpressionLoader, + ) ) ) -union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader: ( - Final -) = _UnionLoader( +union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader: Final[ + _Loader[CommandLineTool | ExpressionTool | ProcessGenerator | Workflow] +] = _UnionLoader( ( CommandLineToolLoader, ExpressionToolLoader, @@ -25417,14 +26727,20 @@ def __init__( ProcessGeneratorLoader, ) ) -array_of_union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader: ( - Final -) = _ArrayLoader( +array_of_union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader: Final[ + _Loader[Sequence[CommandLineTool | ExpressionTool | ProcessGenerator | Workflow]] +] = _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: ( - Final -) = _UnionLoader( +union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader_or_array_of_union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader: Final[ + _Loader[ + CommandLineTool + | ExpressionTool + | ProcessGenerator + | Sequence[CommandLineTool | ExpressionTool | ProcessGenerator | Workflow] + | Workflow + ] +] = _UnionLoader( ( CommandLineToolLoader, ExpressionToolLoader, diff --git a/cwl_utils/parser/cwl_v1_1.py b/cwl_utils/parser/cwl_v1_1.py index e571c050..b458d593 100644 --- a/cwl_utils/parser/cwl_v1_1.py +++ b/cwl_utils/parser/cwl_v1_1.py @@ -45,7 +45,9 @@ IdxType: TypeAlias = MutableMapping[str, tuple[Any, "LoadingOptions"]] +E = TypeVar("E", bound=str) S = TypeVar("S", bound="Saveable") +T = TypeVar("T", covariant=True) class LoadingOptions: @@ -236,11 +238,11 @@ def save( def load_field( val: Any | None, - fieldtype: "_Loader", + fieldtype: _Loader[T], baseuri: str, loadingOptions: LoadingOptions, lc: Any | None = None, -) -> Any: +) -> T: """Load field.""" if isinstance(val, MutableMapping): if "$import" in val: @@ -442,7 +444,8 @@ def expand_url( return url -class _Loader: +class _Loader(Generic[T], metaclass=ABCMeta): + @abstractmethod def load( self, doc: Any, @@ -450,11 +453,10 @@ def load( loadingOptions: LoadingOptions, docRoot: str | None = None, lc: Any | None = None, - ) -> Any | None: - pass + ) -> T: ... -class _AnyLoader(_Loader): +class _AnyLoader(_Loader[Any]): def load( self, doc: Any, @@ -468,8 +470,8 @@ def load( raise ValidationException("Expected non-null") -class _PrimitiveLoader(_Loader): - def __init__(self, tp: type | tuple[type[str], type[str]]) -> None: +class _PrimitiveLoader(_Loader[T]): + def __init__(self, tp: type[T]) -> None: self.tp: Final = tp def load( @@ -479,7 +481,7 @@ def load( loadingOptions: LoadingOptions, docRoot: str | None = None, lc: Any | None = None, - ) -> Any: + ) -> T: if not isinstance(doc, self.tp): raise ValidationException(f"Expected a {self.tp} but got {doc.__class__.__name__}") return doc @@ -488,8 +490,8 @@ def __repr__(self) -> str: return str(self.tp) -class _ArrayLoader(_Loader): - def __init__(self, items: _Loader) -> None: +class _ArrayLoader(_Loader[Sequence[T]]): + def __init__(self, items: _Loader[T]) -> None: self.items: Final = items def load( @@ -499,7 +501,7 @@ def load( loadingOptions: LoadingOptions, docRoot: str | None = None, lc: Any | None = None, - ) -> list[Any]: + ) -> list[T]: if not isinstance(doc, MutableSequence): raise ValidationException( f"Value is a {convert_typing(extract_type(type(doc)))}, " @@ -545,10 +547,10 @@ def __repr__(self) -> str: return f"array<{self.items}>" -class _MapLoader(_Loader): +class _MapLoader(_Loader[Mapping[str, T]]): def __init__( self, - values: _Loader, + values: _Loader[T], name: str | None = None, container: str | None = None, no_link_check: bool | None = None, @@ -565,7 +567,7 @@ def load( loadingOptions: LoadingOptions, docRoot: str | None = None, lc: Any | None = None, - ) -> dict[str, Any]: + ) -> dict[str, T]: 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: @@ -588,7 +590,7 @@ def __repr__(self) -> str: return self.name if self.name is not None else f"map" -class _EnumLoader(_Loader): +class _EnumLoader(_Loader[E]): def __init__(self, symbols: Sequence[str], name: str) -> None: self.symbols: Final = symbols self.name: Final = name @@ -600,17 +602,17 @@ def load( loadingOptions: LoadingOptions, docRoot: str | None = None, lc: Any | None = None, - ) -> str: + ) -> E: if doc in self.symbols: - return cast(str, doc) + return cast(E, doc) raise ValidationException(f"Expected one of {self.symbols}") def __repr__(self) -> str: return self.name -class _SecondaryDSLLoader(_Loader): - def __init__(self, inner: _Loader) -> None: +class _SecondaryDSLLoader(_Loader[T]): + def __init__(self, inner: _Loader[T]) -> None: self.inner: Final = inner def load( @@ -620,7 +622,7 @@ def load( loadingOptions: LoadingOptions, docRoot: str | None = None, lc: Any | None = None, - ) -> Any: + ) -> T: r: Final[list[dict[str, Any]]] = [] match doc: case MutableSequence() as dlist: @@ -682,7 +684,7 @@ def load( return self.inner.load(r, baseuri, loadingOptions, docRoot, lc=lc) -class _RecordLoader(_Loader, Generic[S]): +class _RecordLoader(_Loader[S]): def __init__( self, classtype: type[S], @@ -716,7 +718,7 @@ def __repr__(self) -> str: return str(self.classtype.__name__) -class _ExpressionLoader(_Loader): +class _ExpressionLoader(_Loader[str]): def __init__(self, items: type[str]) -> None: self.items: Final = items @@ -737,12 +739,12 @@ def load( return doc -class _UnionLoader(_Loader): - def __init__(self, alternates: Sequence[_Loader], name: str | None = None) -> None: +class _UnionLoader(_Loader[T]): + def __init__(self, alternates: Sequence[_Loader[T]], name: str | None = None) -> None: self.alternates = alternates self.name: Final = name - def add_loaders(self, loaders: Sequence[_Loader]) -> None: + def add_loaders(self, loaders: Sequence[_Loader[T]]) -> None: self.alternates = tuple(loader for loader in chain(self.alternates, loaders)) def load( @@ -752,7 +754,7 @@ def load( loadingOptions: LoadingOptions, docRoot: str | None = None, lc: Any | None = None, - ) -> Any: + ) -> T: errors: Final = [] if lc is None: @@ -827,10 +829,10 @@ def __repr__(self) -> str: return self.name if self.name is not None else " | ".join(str(a) for a in self.alternates) -class _URILoader(_Loader): +class _URILoader(_Loader[T]): def __init__( self, - inner: _Loader, + inner: _Loader[T], scoped_id: bool, vocab_term: bool, scoped_ref: int | None, @@ -849,7 +851,7 @@ def load( loadingOptions: LoadingOptions, docRoot: str | None = None, lc: Any | None = None, - ) -> Any: + ) -> T: if self.no_link_check is not None: loadingOptions = LoadingOptions( copyfrom=loadingOptions, no_link_check=self.no_link_check @@ -896,8 +898,8 @@ def load( return self.inner.load(doc, baseuri, loadingOptions, lc=lc) -class _TypeDSLLoader(_Loader): - def __init__(self, inner: _Loader, refScope: int | None, salad_version: str) -> None: +class _TypeDSLLoader(_Loader[T]): + def __init__(self, inner: _Loader[T], refScope: int | None, salad_version: str) -> None: self.inner: Final = inner self.refScope: Final = refScope self.salad_version: Final = salad_version @@ -944,7 +946,7 @@ def load( loadingOptions: LoadingOptions, docRoot: str | None = None, lc: Any | None = None, - ) -> Any: + ) -> T: if isinstance(doc, MutableSequence): r: Final[list[Any]] = [] for d in doc: @@ -966,8 +968,8 @@ def load( return self.inner.load(doc, baseuri, loadingOptions, lc=lc) -class _IdMapLoader(_Loader): - def __init__(self, inner: _Loader, mapSubject: str, mapPredicate: str | None) -> None: +class _IdMapLoader(_Loader[T]): + def __init__(self, inner: _Loader[T], mapSubject: str, mapPredicate: str | None) -> None: self.inner: Final = inner self.mapSubject: Final = mapSubject self.mapPredicate: Final = mapPredicate @@ -979,7 +981,7 @@ def load( loadingOptions: LoadingOptions, docRoot: str | None = None, lc: Any | None = None, - ) -> Any: + ) -> T: if isinstance(doc, MutableMapping): r: Final[list[Any]] = [] for k in doc.keys(): @@ -1006,12 +1008,12 @@ def load( def _document_load( - loader: _Loader, + loader: _Loader[T], doc: str | MutableMapping[str, Any] | MutableSequence[Any], baseuri: str, loadingOptions: LoadingOptions, addl_metadata_fields: MutableSequence[str] | None = None, -) -> tuple[Any, LoadingOptions]: +) -> tuple[T, LoadingOptions]: if isinstance(doc, str): return _document_load_by_url( loader, @@ -1076,11 +1078,11 @@ def _document_load( def _document_load_by_url( - loader: _Loader, + loader: _Loader[T], url: str, loadingOptions: LoadingOptions, addl_metadata_fields: MutableSequence[str] | None = None, -) -> tuple[Any, LoadingOptions]: +) -> tuple[T, LoadingOptions]: if url in loadingOptions.idx: return loadingOptions.idx[url] @@ -1266,14 +1268,14 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: + name = "" _errors__.append(ValidationException("missing name")) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name doc = None if "doc" in _doc: try: @@ -1394,13 +1396,13 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, doc=doc, type_=type_, extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -1415,7 +1417,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.doc is not None: r["doc"] = save( @@ -1738,14 +1740,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name try: if _doc.get("symbols") is None: raise ValidationException("missing required field `symbols`", None, []) @@ -1867,13 +1868,13 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, symbols=symbols, type_=type_, extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -1888,7 +1889,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.symbols is not None: u = save_relative_uri(self.symbols, self.name, True, None, relative_uris) @@ -2802,14 +2803,14 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: + name = "" _errors__.append(ValidationException("missing name")) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name doc = None if "doc" in _doc: try: @@ -2930,13 +2931,13 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, doc=doc, type_=type_, extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -2951,7 +2952,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.doc is not None: r["doc"] = save( @@ -4642,14 +4643,14 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: + name = "" _errors__.append(ValidationException("missing name")) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name doc = None if "doc" in _doc: try: @@ -5052,7 +5053,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, doc=doc, type_=type_, label=label, @@ -5064,7 +5065,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -5079,7 +5080,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.doc is not None: r["doc"] = save( @@ -5259,14 +5260,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name fields = None if "fields" in _doc: try: @@ -5481,7 +5481,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, fields=fields, type_=type_, label=label, @@ -5489,7 +5489,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -5504,7 +5504,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.fields is not None: r["fields"] = save( @@ -5639,14 +5639,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name try: if _doc.get("symbols") is None: raise ValidationException("missing required field `symbols`", None, []) @@ -5862,7 +5861,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, symbols=symbols, type_=type_, label=label, @@ -5870,7 +5869,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -5885,7 +5884,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.symbols is not None: u = save_relative_uri(self.symbols, self.name, True, None, relative_uris) @@ -6019,14 +6018,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name try: if _doc.get("items") is None: raise ValidationException("missing required field `items`", None, []) @@ -6242,7 +6240,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, items=items, type_=type_, label=label, @@ -6250,7 +6248,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -6265,7 +6263,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.items is not None: u = save_relative_uri(self.items, self.name, False, 2, relative_uris) @@ -6411,14 +6409,14 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: + name = "" _errors__.append(ValidationException("missing name")) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name doc = None if "doc" in _doc: try: @@ -6727,7 +6725,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, doc=doc, type_=type_, label=label, @@ -6737,7 +6735,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -6752,7 +6750,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.doc is not None: r["doc"] = save( @@ -6904,14 +6902,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name fields = None if "fields" in _doc: try: @@ -7126,7 +7123,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, fields=fields, type_=type_, label=label, @@ -7134,7 +7131,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -7149,7 +7146,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.fields is not None: r["fields"] = save( @@ -7284,14 +7281,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name try: if _doc.get("symbols") is None: raise ValidationException("missing required field `symbols`", None, []) @@ -7507,7 +7503,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, symbols=symbols, type_=type_, label=label, @@ -7515,7 +7511,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -7530,7 +7526,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.symbols is not None: u = save_relative_uri(self.symbols, self.name, True, None, relative_uris) @@ -7664,14 +7660,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name try: if _doc.get("items") is None: raise ValidationException("missing required field `items`", None, []) @@ -7887,7 +7882,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, items=items, type_=type_, label=label, @@ -7895,7 +7890,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -7910,7 +7905,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.items is not None: u = save_relative_uri(self.items, self.name, False, 2, relative_uris) @@ -9898,14 +9893,14 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: + name = "" _errors__.append(ValidationException("missing name")) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name doc = None if "doc" in _doc: try: @@ -10355,7 +10350,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, doc=doc, type_=type_, label=label, @@ -10368,7 +10363,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -10383,7 +10378,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.doc is not None: r["doc"] = save( @@ -10583,14 +10578,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name fields = None if "fields" in _doc: try: @@ -10852,7 +10846,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, fields=fields, type_=type_, label=label, @@ -10861,7 +10855,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -10876,7 +10870,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.fields is not None: r["fields"] = save( @@ -11030,14 +11024,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name try: if _doc.get("symbols") is None: raise ValidationException("missing required field `symbols`", None, []) @@ -11300,7 +11293,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, symbols=symbols, type_=type_, label=label, @@ -11309,7 +11302,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -11324,7 +11317,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.symbols is not None: u = save_relative_uri(self.symbols, self.name, True, None, relative_uris) @@ -11470,14 +11463,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name try: if _doc.get("items") is None: raise ValidationException("missing required field `items`", None, []) @@ -11740,7 +11732,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, items=items, type_=type_, label=label, @@ -11749,7 +11741,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -11764,7 +11756,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.items is not None: u = save_relative_uri(self.items, self.name, False, 2, relative_uris) @@ -11921,14 +11913,14 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: + name = "" _errors__.append(ValidationException("missing name")) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name doc = None if "doc" in _doc: try: @@ -12284,7 +12276,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, doc=doc, type_=type_, label=label, @@ -12295,7 +12287,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -12310,7 +12302,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.doc is not None: r["doc"] = save( @@ -12480,14 +12472,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name fields = None if "fields" in _doc: try: @@ -12702,7 +12693,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, fields=fields, type_=type_, label=label, @@ -12710,7 +12701,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -12725,7 +12716,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.fields is not None: r["fields"] = save( @@ -12860,14 +12851,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name try: if _doc.get("symbols") is None: raise ValidationException("missing required field `symbols`", None, []) @@ -13083,7 +13073,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, symbols=symbols, type_=type_, label=label, @@ -13091,7 +13081,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -13106,7 +13096,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.symbols is not None: u = save_relative_uri(self.symbols, self.name, True, None, relative_uris) @@ -13240,14 +13230,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name try: if _doc.get("items") is None: raise ValidationException("missing required field `items`", None, []) @@ -13463,7 +13452,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, items=items, type_=type_, label=label, @@ -13471,7 +13460,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -13486,7 +13475,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.items is not None: u = save_relative_uri(self.items, self.name, False, 2, relative_uris) @@ -13644,14 +13633,14 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: + id = "" _errors__.append(ValidationException("missing id")) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id label = None if "label" in _doc: try: @@ -14148,7 +14137,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, label=label, secondaryFiles=secondaryFiles, streamable=streamable, @@ -14162,7 +14151,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -14177,7 +14166,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.label is not None: r["label"] = save( @@ -14392,14 +14381,14 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: + id = "" _errors__.append(ValidationException("missing id")) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id label = None if "label" in _doc: try: @@ -14755,7 +14744,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, label=label, secondaryFiles=secondaryFiles, streamable=streamable, @@ -14766,7 +14755,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -14781,7 +14770,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.label is not None: r["label"] = save( @@ -14988,14 +14977,13 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: id = "_:" + str(_uuid__.uuid4()) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id try: if _doc.get("class") is None: raise ValidationException("missing required field `class`", None, []) @@ -15744,7 +15732,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, label=label, doc=doc, inputs=inputs, @@ -15763,7 +15751,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -15778,7 +15766,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.class_ is not None: uri = self.loadingOptions.vocab[self.class_] @@ -19142,14 +19130,14 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: + id = "" _errors__.append(ValidationException("missing id")) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id label = None if "label" in _doc: try: @@ -19458,7 +19446,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, label=label, secondaryFiles=secondaryFiles, streamable=streamable, @@ -19468,7 +19456,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -19483,7 +19471,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.label is not None: r["label"] = save( @@ -19655,14 +19643,14 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: + id = "" _errors__.append(ValidationException("missing id")) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id label = None if "label" in _doc: try: @@ -20159,7 +20147,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, label=label, secondaryFiles=secondaryFiles, streamable=streamable, @@ -20173,7 +20161,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -20188,7 +20176,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.label is not None: r["label"] = save( @@ -20414,14 +20402,13 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: id = "_:" + str(_uuid__.uuid4()) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id try: if _doc.get("class") is None: raise ValidationException("missing required field `class`", None, []) @@ -20842,7 +20829,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, label=label, doc=doc, inputs=inputs, @@ -20854,7 +20841,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -20869,7 +20856,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.class_ is not None: uri = self.loadingOptions.vocab[self.class_] @@ -21077,14 +21064,14 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: + id = "" _errors__.append(ValidationException("missing id")) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id label = None if "label" in _doc: try: @@ -21487,7 +21474,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, label=label, secondaryFiles=secondaryFiles, streamable=streamable, @@ -21499,7 +21486,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -21514,7 +21501,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.label is not None: r["label"] = save( @@ -21748,14 +21735,14 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: + id = "" _errors__.append(ValidationException("missing id")) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id source = None if "source" in _doc: try: @@ -22110,7 +22097,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, source=source, linkMerge=linkMerge, loadContents=loadContents, @@ -22121,7 +22108,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -22136,7 +22123,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.source is not None: u = save_relative_uri(self.source, self.id, False, 2, relative_uris) @@ -22309,14 +22296,14 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: + id = "" _errors__.append(ValidationException("missing id")) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: @@ -22340,11 +22327,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -22359,7 +22346,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u # top refers to the directory level @@ -22545,14 +22532,14 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: + id = "" _errors__.append(ValidationException("missing id")) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id label = None if "label" in _doc: try: @@ -23006,7 +22993,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, label=label, doc=doc, in_=in_, @@ -23019,7 +23006,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -23034,7 +23021,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.label is not None: r["label"] = save( @@ -23278,14 +23265,13 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: id = "_:" + str(_uuid__.uuid4()) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id try: if _doc.get("class") is None: raise ValidationException("missing required field `class`", None, []) @@ -23706,7 +23692,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, label=label, doc=doc, inputs=inputs, @@ -23718,7 +23704,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -23733,7 +23719,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.class_ is not None: uri = self.loadingOptions.vocab[self.class_] @@ -24577,14 +24563,13 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: id = "_:" + str(_uuid__.uuid4()) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id try: if _doc.get("class") is None: raise ValidationException("missing required field `class`", None, []) @@ -25007,7 +24992,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, label=label, doc=doc, inputs=inputs, @@ -25019,7 +25004,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -25034,7 +25019,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.class_ is not None: uri = self.loadingOptions.vocab[self.class_] @@ -26104,14 +26089,16 @@ def __init__( "https://w3id.org/cwl/cwl#v1.1": "v1.1", }) -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( +strtype: Final[_Loader[str]] = _PrimitiveLoader(str) +inttype: Final[_Loader[i32]] = _PrimitiveLoader(i32) +floattype: Final[_Loader[float]] = _PrimitiveLoader(float) +booltype: Final[_Loader[bool]] = _PrimitiveLoader(bool) +None_type: Final[_Loader[None]] = _PrimitiveLoader(type(None)) +Any_type: Final[_Loader[Any]] = _AnyLoader() +longtype: Final[_Loader[i64]] = _PrimitiveLoader(i64) +PrimitiveTypeLoader: Final[ + _Loader[Literal["null", "boolean", "int", "long", "float", "double", "string"]] +] = _EnumLoader( ( "null", "boolean", @@ -26137,17 +26124,33 @@ def __init__( double: double precision (64-bit) IEEE 754 floating-point number string: Unicode character sequence """ -AnyLoader: Final = _EnumLoader(("Any",), "Any") +AnyLoader: Final[_Loader[Literal["Any"]]] = _EnumLoader(("Any",), "Any") """ The **Any** type validates for any non-null value. """ -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( +RecordFieldLoader: Final[_Loader[RecordField]] = _RecordLoader(RecordField, None, None) +RecordSchemaLoader: Final[_Loader[RecordSchema]] = _RecordLoader( + RecordSchema, None, None +) +EnumSchemaLoader: Final[_Loader[EnumSchema]] = _RecordLoader(EnumSchema, None, None) +ArraySchemaLoader: Final[_Loader[ArraySchema]] = _RecordLoader(ArraySchema, None, None) +MapSchemaLoader: Final[_Loader[MapSchema]] = _RecordLoader(MapSchema, None, None) +UnionSchemaLoader: Final[_Loader[UnionSchema]] = _RecordLoader(UnionSchema, None, None) +CWLTypeLoader: Final[ + _Loader[ + Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + ] +] = _EnumLoader( ( "null", "boolean", @@ -26166,64 +26169,114 @@ def __init__( File: A File object Directory: A Directory object """ -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, +CWLArraySchemaLoader: Final[_Loader[CWLArraySchema]] = _RecordLoader( + CWLArraySchema, None, None +) +CWLRecordFieldLoader: Final[_Loader[CWLRecordField]] = _RecordLoader( + CWLRecordField, None, None +) +CWLRecordSchemaLoader: Final[_Loader[CWLRecordSchema]] = _RecordLoader( + CWLRecordSchema, None, None +) +FileLoader: Final[_Loader[File]] = _RecordLoader(File, None, None) +DirectoryLoader: Final[_Loader[Directory]] = _RecordLoader(Directory, None, None) +CWLObjectTypeLoader: Final[_UnionLoader[Any]] = _UnionLoader((), "CWLObjectTypeLoader") +union_of_None_type_or_CWLObjectTypeLoader: Final[_Loader[CWLObjectType | None]] = ( + _UnionLoader( + ( + None_type, + CWLObjectTypeLoader, + ) ) ) -array_of_union_of_None_type_or_CWLObjectTypeLoader: Final = _ArrayLoader( - union_of_None_type_or_CWLObjectTypeLoader +array_of_union_of_None_type_or_CWLObjectTypeLoader: Final[ + _Loader[Sequence[CWLObjectType | None]] +] = _ArrayLoader(union_of_None_type_or_CWLObjectTypeLoader) +map_of_union_of_None_type_or_CWLObjectTypeLoader: Final[ + _Loader[Mapping[str, CWLObjectType | None]] +] = _MapLoader(union_of_None_type_or_CWLObjectTypeLoader, "None", None, None) +InlineJavascriptRequirementLoader: Final[_Loader[InlineJavascriptRequirement]] = ( + _RecordLoader(InlineJavascriptRequirement, None, None) ) -map_of_union_of_None_type_or_CWLObjectTypeLoader: Final = _MapLoader( - union_of_None_type_or_CWLObjectTypeLoader, "None", None, None +SchemaDefRequirementLoader: Final[_Loader[SchemaDefRequirement]] = _RecordLoader( + SchemaDefRequirement, None, None ) -InlineJavascriptRequirementLoader: Final = _RecordLoader( - InlineJavascriptRequirement, None, None +LoadListingRequirementLoader: Final[_Loader[LoadListingRequirement]] = _RecordLoader( + LoadListingRequirement, None, None ) -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 +DockerRequirementLoader: Final[_Loader[DockerRequirement]] = _RecordLoader( + DockerRequirement, None, None ) -EnvVarRequirementLoader: Final = _RecordLoader(EnvVarRequirement, None, None) -ShellCommandRequirementLoader: Final = _RecordLoader( +SoftwareRequirementLoader: Final[_Loader[SoftwareRequirement]] = _RecordLoader( + SoftwareRequirement, None, None +) +InitialWorkDirRequirementLoader: Final[_Loader[InitialWorkDirRequirement]] = ( + _RecordLoader(InitialWorkDirRequirement, None, None) +) +EnvVarRequirementLoader: Final[_Loader[EnvVarRequirement]] = _RecordLoader( + EnvVarRequirement, None, None +) +ShellCommandRequirementLoader: Final[_Loader[ShellCommandRequirement]] = _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 +ResourceRequirementLoader: Final[_Loader[ResourceRequirement]] = _RecordLoader( + ResourceRequirement, None, None ) -ToolTimeLimitLoader: Final = _RecordLoader(ToolTimeLimit, None, None) -SubworkflowFeatureRequirementLoader: Final = _RecordLoader( - SubworkflowFeatureRequirement, None, None +WorkReuseLoader: Final[_Loader[WorkReuse]] = _RecordLoader(WorkReuse, None, None) +NetworkAccessLoader: Final[_Loader[NetworkAccess]] = _RecordLoader( + NetworkAccess, None, None ) -ScatterFeatureRequirementLoader: Final = _RecordLoader( - ScatterFeatureRequirement, None, None +InplaceUpdateRequirementLoader: Final[_Loader[InplaceUpdateRequirement]] = ( + _RecordLoader(InplaceUpdateRequirement, None, None) ) -MultipleInputFeatureRequirementLoader: Final = _RecordLoader( - MultipleInputFeatureRequirement, None, None +ToolTimeLimitLoader: Final[_Loader[ToolTimeLimit]] = _RecordLoader( + ToolTimeLimit, None, None ) -StepInputExpressionRequirementLoader: Final = _RecordLoader( - StepInputExpressionRequirement, None, None +SubworkflowFeatureRequirementLoader: Final[_Loader[SubworkflowFeatureRequirement]] = ( + _RecordLoader(SubworkflowFeatureRequirement, None, None) ) -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( +ScatterFeatureRequirementLoader: Final[_Loader[ScatterFeatureRequirement]] = ( + _RecordLoader(ScatterFeatureRequirement, None, None) +) +MultipleInputFeatureRequirementLoader: Final[ + _Loader[MultipleInputFeatureRequirement] +] = _RecordLoader(MultipleInputFeatureRequirement, None, None) +StepInputExpressionRequirementLoader: Final[_Loader[StepInputExpressionRequirement]] = ( + _RecordLoader(StepInputExpressionRequirement, None, None) +) +SecretsLoader: Final[_Loader[Secrets]] = _RecordLoader(Secrets, None, None) +MPIRequirementLoader: Final[_Loader[MPIRequirement]] = _RecordLoader( + MPIRequirement, None, None +) +CUDARequirementLoader: Final[_Loader[CUDARequirement]] = _RecordLoader( + CUDARequirement, None, None +) +ShmSizeLoader: Final[_Loader[ShmSize]] = _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[ + _Loader[ + CUDARequirement + | DockerRequirement + | EnvVarRequirement + | InitialWorkDirRequirement + | InlineJavascriptRequirement + | InplaceUpdateRequirement + | LoadListingRequirement + | MPIRequirement + | MultipleInputFeatureRequirement + | NetworkAccess + | ResourceRequirement + | ScatterFeatureRequirement + | SchemaDefRequirement + | Secrets + | ShellCommandRequirement + | ShmSize + | SoftwareRequirement + | StepInputExpressionRequirement + | SubworkflowFeatureRequirement + | ToolTimeLimit + | WorkReuse + ] +] = _UnionLoader( ( InlineJavascriptRequirementLoader, SchemaDefRequirementLoader, @@ -26248,36 +26301,146 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + Sequence[ + CUDARequirement + | DockerRequirement + | EnvVarRequirement + | InitialWorkDirRequirement + | InlineJavascriptRequirement + | InplaceUpdateRequirement + | LoadListingRequirement + | MPIRequirement + | MultipleInputFeatureRequirement + | NetworkAccess + | ResourceRequirement + | ScatterFeatureRequirement + | SchemaDefRequirement + | Secrets + | ShellCommandRequirement + | ShmSize + | SoftwareRequirement + | StepInputExpressionRequirement + | SubworkflowFeatureRequirement + | ToolTimeLimit + | WorkReuse + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + CWLObjectType + | None + | Sequence[ + CUDARequirement + | DockerRequirement + | EnvVarRequirement + | InitialWorkDirRequirement + | InlineJavascriptRequirement + | InplaceUpdateRequirement + | LoadListingRequirement + | MPIRequirement + | MultipleInputFeatureRequirement + | NetworkAccess + | ResourceRequirement + | ScatterFeatureRequirement + | SchemaDefRequirement + | Secrets + | ShellCommandRequirement + | ShmSize + | SoftwareRequirement + | StepInputExpressionRequirement + | SubworkflowFeatureRequirement + | ToolTimeLimit + | WorkReuse + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + Mapping[ + str, + CWLObjectType + | None + | Sequence[ + CUDARequirement + | DockerRequirement + | EnvVarRequirement + | InitialWorkDirRequirement + | InlineJavascriptRequirement + | InplaceUpdateRequirement + | LoadListingRequirement + | MPIRequirement + | MultipleInputFeatureRequirement + | NetworkAccess + | ResourceRequirement + | ScatterFeatureRequirement + | SchemaDefRequirement + | Secrets + | ShellCommandRequirement + | ShmSize + | SoftwareRequirement + | StepInputExpressionRequirement + | SubworkflowFeatureRequirement + | ToolTimeLimit + | WorkReuse + ], + ] + ] +] = _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: 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") +CWLInputFileLoader: Final[ + _Loader[ + Mapping[ + str, + CWLObjectType + | None + | Sequence[ + CUDARequirement + | DockerRequirement + | EnvVarRequirement + | InitialWorkDirRequirement + | InlineJavascriptRequirement + | InplaceUpdateRequirement + | LoadListingRequirement + | MPIRequirement + | MultipleInputFeatureRequirement + | NetworkAccess + | ResourceRequirement + | ScatterFeatureRequirement + | SchemaDefRequirement + | Secrets + | ShellCommandRequirement + | ShmSize + | SoftwareRequirement + | StepInputExpressionRequirement + | SubworkflowFeatureRequirement + | ToolTimeLimit + | WorkReuse + ], + ] + ] +] = 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[_Loader[Literal["v1.1"]]] = _EnumLoader(("v1.1",), "CWLVersion") """ Current version symbol for CWL documents. """ -LoadListingEnumLoader: Final = _EnumLoader( +LoadListingEnumLoader: Final[ + _Loader[Literal["no_listing", "shallow_listing", "deep_listing"]] +] = _EnumLoader( ( "no_listing", "shallow_listing", @@ -26293,45 +26456,77 @@ def __init__( 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: 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( +ExpressionLoader = _ExpressionLoader(str) +InputBindingLoader: Final[_Loader[InputBinding]] = _RecordLoader( + InputBinding, None, None +) +InputRecordFieldLoader: Final[_Loader[InputRecordField]] = _RecordLoader( + InputRecordField, None, None +) +InputRecordSchemaLoader: Final[_Loader[InputRecordSchema]] = _RecordLoader( + InputRecordSchema, None, None +) +InputEnumSchemaLoader: Final[_Loader[InputEnumSchema]] = _RecordLoader( + InputEnumSchema, None, None +) +InputArraySchemaLoader: Final[_Loader[InputArraySchema]] = _RecordLoader( + InputArraySchema, None, None +) +OutputRecordFieldLoader: Final[_Loader[OutputRecordField]] = _RecordLoader( + OutputRecordField, None, None +) +OutputRecordSchemaLoader: Final[_Loader[OutputRecordSchema]] = _RecordLoader( + OutputRecordSchema, None, None +) +OutputEnumSchemaLoader: Final[_Loader[OutputEnumSchema]] = _RecordLoader( + OutputEnumSchema, None, None +) +OutputArraySchemaLoader: Final[_Loader[OutputArraySchema]] = _RecordLoader( + OutputArraySchema, None, None +) +SecondaryFileSchemaLoader: Final[_Loader[SecondaryFileSchema]] = _RecordLoader( + SecondaryFileSchema, None, None +) +EnvironmentDefLoader: Final[_Loader[EnvironmentDef]] = _RecordLoader( + EnvironmentDef, None, None +) +CommandLineBindingLoader: Final[_Loader[CommandLineBinding]] = _RecordLoader( + CommandLineBinding, None, None +) +CommandOutputBindingLoader: Final[_Loader[CommandOutputBinding]] = _RecordLoader( + CommandOutputBinding, None, None +) +CommandInputRecordFieldLoader: Final[_Loader[CommandInputRecordField]] = _RecordLoader( CommandInputRecordField, None, None ) -CommandInputRecordSchemaLoader: Final = _RecordLoader( - CommandInputRecordSchema, None, None +CommandInputRecordSchemaLoader: Final[_Loader[CommandInputRecordSchema]] = ( + _RecordLoader(CommandInputRecordSchema, None, None) ) -CommandInputEnumSchemaLoader: Final = _RecordLoader(CommandInputEnumSchema, None, None) -CommandInputArraySchemaLoader: Final = _RecordLoader( +CommandInputEnumSchemaLoader: Final[_Loader[CommandInputEnumSchema]] = _RecordLoader( + CommandInputEnumSchema, None, None +) +CommandInputArraySchemaLoader: Final[_Loader[CommandInputArraySchema]] = _RecordLoader( CommandInputArraySchema, None, None ) -CommandOutputRecordFieldLoader: Final = _RecordLoader( - CommandOutputRecordField, None, None +CommandOutputRecordFieldLoader: Final[_Loader[CommandOutputRecordField]] = ( + _RecordLoader(CommandOutputRecordField, None, None) ) -CommandOutputRecordSchemaLoader: Final = _RecordLoader( - CommandOutputRecordSchema, None, None +CommandOutputRecordSchemaLoader: Final[_Loader[CommandOutputRecordSchema]] = ( + _RecordLoader(CommandOutputRecordSchema, None, None) ) -CommandOutputEnumSchemaLoader: Final = _RecordLoader( +CommandOutputEnumSchemaLoader: Final[_Loader[CommandOutputEnumSchema]] = _RecordLoader( CommandOutputEnumSchema, None, None ) -CommandOutputArraySchemaLoader: Final = _RecordLoader( - CommandOutputArraySchema, None, None +CommandOutputArraySchemaLoader: Final[_Loader[CommandOutputArraySchema]] = ( + _RecordLoader(CommandOutputArraySchema, None, None) +) +CommandInputParameterLoader: Final[_Loader[CommandInputParameter]] = _RecordLoader( + CommandInputParameter, None, None +) +CommandOutputParameterLoader: Final[_Loader[CommandOutputParameter]] = _RecordLoader( + CommandOutputParameter, None, None ) -CommandInputParameterLoader: Final = _RecordLoader(CommandInputParameter, None, None) -CommandOutputParameterLoader: Final = _RecordLoader(CommandOutputParameter, None, None) -stdinLoader: Final = _EnumLoader(("stdin",), "stdin") +stdinLoader: Final[_Loader[Literal["stdin"]]] = _EnumLoader(("stdin",), "stdin") """ Only valid as a `type` for a `CommandLineTool` input with no `inputBinding` set. `stdin` must not be specified at the `CommandLineTool` @@ -26353,7 +26548,7 @@ def __init__( stdin: ${inputs.an_input_name.path} ``` """ -stdoutLoader: Final = _EnumLoader(("stdout",), "stdout") +stdoutLoader: Final[_Loader[Literal["stdout"]]] = _EnumLoader(("stdout",), "stdout") """ Only valid as a `type` for a `CommandLineTool` output with no `outputBinding` set. @@ -26397,7 +26592,7 @@ def __init__( stdout: random_stdout_filenameABCDEFG ``` """ -stderrLoader: Final = _EnumLoader(("stderr",), "stderr") +stderrLoader: Final[_Loader[Literal["stderr"]]] = _EnumLoader(("stderr",), "stderr") """ Only valid as a `type` for a `CommandLineTool` output with no `outputBinding` set. @@ -26441,30 +26636,46 @@ def __init__( stderr: random_stderr_filenameABCDEFG ``` """ -CommandLineToolLoader: Final = _RecordLoader(CommandLineTool, None, None) -SoftwarePackageLoader: Final = _RecordLoader(SoftwarePackage, None, None) -DirentLoader: Final = _RecordLoader(Dirent, None, None) -ExpressionToolOutputParameterLoader: Final = _RecordLoader( - ExpressionToolOutputParameter, None, None +CommandLineToolLoader: Final[_Loader[CommandLineTool]] = _RecordLoader( + CommandLineTool, None, None ) -WorkflowInputParameterLoader: Final = _RecordLoader(WorkflowInputParameter, None, None) -ExpressionToolLoader: Final = _RecordLoader(ExpressionTool, None, None) -LinkMergeMethodLoader: Final = _EnumLoader( - ( - "merge_nested", - "merge_flattened", - ), - "LinkMergeMethod", +SoftwarePackageLoader: Final[_Loader[SoftwarePackage]] = _RecordLoader( + SoftwarePackage, None, None +) +DirentLoader: Final[_Loader[Dirent]] = _RecordLoader(Dirent, None, None) +ExpressionToolOutputParameterLoader: Final[_Loader[ExpressionToolOutputParameter]] = ( + _RecordLoader(ExpressionToolOutputParameter, None, None) +) +WorkflowInputParameterLoader: Final[_Loader[WorkflowInputParameter]] = _RecordLoader( + WorkflowInputParameter, None, None +) +ExpressionToolLoader: Final[_Loader[ExpressionTool]] = _RecordLoader( + ExpressionTool, None, None +) +LinkMergeMethodLoader: Final[_Loader[Literal["merge_nested", "merge_flattened"]]] = ( + _EnumLoader( + ( + "merge_nested", + "merge_flattened", + ), + "LinkMergeMethod", + ) ) """ The input link merge method, described in [WorkflowStepInput](#WorkflowStepInput). """ -WorkflowOutputParameterLoader: Final = _RecordLoader( +WorkflowOutputParameterLoader: Final[_Loader[WorkflowOutputParameter]] = _RecordLoader( WorkflowOutputParameter, None, None ) -WorkflowStepInputLoader: Final = _RecordLoader(WorkflowStepInput, None, None) -WorkflowStepOutputLoader: Final = _RecordLoader(WorkflowStepOutput, None, None) -ScatterMethodLoader: Final = _EnumLoader( +WorkflowStepInputLoader: Final[_Loader[WorkflowStepInput]] = _RecordLoader( + WorkflowStepInput, None, None +) +WorkflowStepOutputLoader: Final[_Loader[WorkflowStepOutput]] = _RecordLoader( + WorkflowStepOutput, None, None +) +ScatterMethodLoader: Final[ + _Loader[Literal["dotproduct", "nested_crossproduct", "flat_crossproduct"]] +] = _EnumLoader( ( "dotproduct", "nested_crossproduct", @@ -26475,21 +26686,37 @@ def __init__( """ The scatter method, as described in [workflow step scatter](#WorkflowStep). """ -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( +WorkflowStepLoader: Final[_Loader[WorkflowStep]] = _RecordLoader( + WorkflowStep, None, None +) +WorkflowLoader: Final[_Loader[Workflow]] = _RecordLoader(Workflow, None, None) +ProcessGeneratorLoader: Final[_Loader[ProcessGenerator]] = _RecordLoader( + ProcessGenerator, None, None +) +array_of_strtype: Final[_Loader[Sequence[str]]] = _ArrayLoader(strtype) +union_of_None_type_or_strtype_or_array_of_strtype: Final[ + _Loader[None | Sequence[str] | str] +] = _UnionLoader( ( None_type, strtype, array_of_strtype, ) ) -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( +uri_strtype_True_False_None_None: Final[_Loader[str]] = _URILoader( + strtype, True, False, None, None +) +union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype: Final[ + _Loader[ + ArraySchema + | EnumSchema + | Literal["null", "boolean", "int", "long", "float", "double", "string"] + | MapSchema + | RecordSchema + | UnionSchema + | str + ] +] = _UnionLoader( ( PrimitiveTypeLoader, RecordSchemaLoader, @@ -26500,14 +26727,41 @@ def __init__( strtype, ) ) -array_of_union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype: ( - Final -) = _ArrayLoader( +array_of_union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype: Final[ + _Loader[ + Sequence[ + ArraySchema + | EnumSchema + | Literal["null", "boolean", "int", "long", "float", "double", "string"] + | MapSchema + | RecordSchema + | UnionSchema + | str + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _UnionLoader( ( PrimitiveTypeLoader, RecordSchemaLoader, @@ -26519,57 +26773,117 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: Final = _ArrayLoader(RecordFieldLoader) -union_of_None_type_or_array_of_RecordFieldLoader: Final = _UnionLoader( +array_of_RecordFieldLoader: Final[_Loader[Sequence[RecordField]]] = _ArrayLoader( + RecordFieldLoader +) +union_of_None_type_or_array_of_RecordFieldLoader: Final[ + _Loader[None | Sequence[RecordField]] +] = _UnionLoader( ( None_type, array_of_RecordFieldLoader, ) ) -idmap_fields_union_of_None_type_or_array_of_RecordFieldLoader: Final = _IdMapLoader( - union_of_None_type_or_array_of_RecordFieldLoader, "name", "type" +idmap_fields_union_of_None_type_or_array_of_RecordFieldLoader: Final[ + _Loader[None | Sequence[RecordField]] +] = _IdMapLoader(union_of_None_type_or_array_of_RecordFieldLoader, "name", "type") +Record_nameLoader: Final[_Loader[Literal["record"]]] = _EnumLoader( + ("record",), "Record_name" +) +typedsl_Record_nameLoader_2: Final[_Loader[Literal["record"]]] = _TypeDSLLoader( + Record_nameLoader, 2, "v1.1" ) -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( +union_of_None_type_or_strtype: Final[_Loader[None | str]] = _UnionLoader( ( None_type, strtype, ) ) -uri_union_of_None_type_or_strtype_True_False_None_None: Final = _URILoader( - union_of_None_type_or_strtype, True, False, None, None +uri_union_of_None_type_or_strtype_True_False_None_None: Final[_Loader[None | str]] = ( + _URILoader(union_of_None_type_or_strtype, True, False, None, None) ) -uri_array_of_strtype_True_False_None_None: Final = _URILoader( +uri_array_of_strtype_True_False_None_None: Final[_Loader[Sequence[str]]] = _URILoader( array_of_strtype, True, False, None, None ) -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( +Enum_nameLoader: Final[_Loader[Literal["enum"]]] = _EnumLoader(("enum",), "Enum_name") +typedsl_Enum_nameLoader_2: Final[_Loader[Literal["enum"]]] = _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[ + _Loader[ + 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 + ] +] = _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: 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( +Array_nameLoader: Final[_Loader[Literal["array"]]] = _EnumLoader( + ("array",), "Array_name" +) +typedsl_Array_nameLoader_2: Final[_Loader[Literal["array"]]] = _TypeDSLLoader( + Array_nameLoader, 2, "v1.1" +) +Map_nameLoader: Final[_Loader[Literal["map"]]] = _EnumLoader(("map",), "Map_name") +typedsl_Map_nameLoader_2: Final[_Loader[Literal["map"]]] = _TypeDSLLoader( + Map_nameLoader, 2, "v1.1" +) +Union_nameLoader: Final[_Loader[Literal["union"]]] = _EnumLoader( + ("union",), "Union_name" +) +typedsl_Union_nameLoader_2: Final[_Loader[Literal["union"]]] = _TypeDSLLoader( + Union_nameLoader, 2, "v1.1" +) +union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype: Final[ + _Loader[ + CWLArraySchema + | CWLRecordSchema + | EnumSchema + | Literal["null", "boolean", "int", "long", "float", "double", "string"] + | str + ] +] = _UnionLoader( ( PrimitiveTypeLoader, CWLRecordSchemaLoader, @@ -26578,14 +26892,35 @@ def __init__( strtype, ) ) -array_of_union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype: ( - Final -) = _ArrayLoader( +array_of_union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype: Final[ + _Loader[ + Sequence[ + CWLArraySchema + | CWLRecordSchema + | EnumSchema + | Literal["null", "boolean", "int", "long", "float", "double", "string"] + | str + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _UnionLoader( ( PrimitiveTypeLoader, CWLRecordSchemaLoader, @@ -26595,66 +26930,96 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: Final = _ArrayLoader(CWLRecordFieldLoader) -union_of_None_type_or_array_of_CWLRecordFieldLoader: Final = _UnionLoader( +array_of_CWLRecordFieldLoader: Final[_Loader[Sequence[CWLRecordField]]] = _ArrayLoader( + CWLRecordFieldLoader +) +union_of_None_type_or_array_of_CWLRecordFieldLoader: Final[ + _Loader[None | Sequence[CWLRecordField]] +] = _UnionLoader( ( None_type, array_of_CWLRecordFieldLoader, ) ) -idmap_fields_union_of_None_type_or_array_of_CWLRecordFieldLoader: Final = _IdMapLoader( - union_of_None_type_or_array_of_CWLRecordFieldLoader, "name", "type" -) -File_classLoader: Final = _EnumLoader(("File",), "File_class") -uri_File_classLoader_False_True_None_None: Final = _URILoader( +idmap_fields_union_of_None_type_or_array_of_CWLRecordFieldLoader: Final[ + _Loader[None | Sequence[CWLRecordField]] +] = _IdMapLoader(union_of_None_type_or_array_of_CWLRecordFieldLoader, "name", "type") +File_classLoader: Final[_Loader[Literal["File"]]] = _EnumLoader(("File",), "File_class") +uri_File_classLoader_False_True_None_None: Final[_Loader[Literal["File"]]] = _URILoader( File_classLoader, False, True, None, None ) -uri_union_of_None_type_or_strtype_False_False_None_None: Final = _URILoader( - union_of_None_type_or_strtype, False, False, None, None +uri_union_of_None_type_or_strtype_False_False_None_None: Final[_Loader[None | str]] = ( + _URILoader(union_of_None_type_or_strtype, False, False, None, None) ) -union_of_None_type_or_inttype_or_inttype: Final = _UnionLoader( +union_of_None_type_or_inttype_or_inttype: Final[_Loader[None | i32]] = _UnionLoader( ( None_type, inttype, inttype, ) ) -union_of_FileLoader_or_DirectoryLoader: Final = _UnionLoader( +union_of_FileLoader_or_DirectoryLoader: Final[_Loader[Directory | File]] = _UnionLoader( ( FileLoader, DirectoryLoader, ) ) -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: Final = ( - _UnionLoader( - ( - None_type, - array_of_union_of_FileLoader_or_DirectoryLoader, - ) +array_of_union_of_FileLoader_or_DirectoryLoader: Final[ + _Loader[Sequence[Directory | File]] +] = _ArrayLoader(union_of_FileLoader_or_DirectoryLoader) +union_of_None_type_or_array_of_union_of_FileLoader_or_DirectoryLoader: Final[ + _Loader[None | Sequence[Directory | File]] +] = _UnionLoader( + ( + None_type, + array_of_union_of_FileLoader_or_DirectoryLoader, ) ) -secondaryfilesdsl_union_of_None_type_or_array_of_union_of_FileLoader_or_DirectoryLoader: ( - Final -) = _UnionLoader( +secondaryfilesdsl_union_of_None_type_or_array_of_union_of_FileLoader_or_DirectoryLoader: Final[ + _Loader[None | Sequence[Directory | File]] +] = _UnionLoader( ( _SecondaryDSLLoader( union_of_None_type_or_array_of_union_of_FileLoader_or_DirectoryLoader @@ -26662,28 +27027,34 @@ def __init__( union_of_None_type_or_array_of_union_of_FileLoader_or_DirectoryLoader, ) ) -uri_union_of_None_type_or_strtype_True_False_None_True: Final = _URILoader( - union_of_None_type_or_strtype, True, False, None, True +uri_union_of_None_type_or_strtype_True_False_None_True: Final[_Loader[None | str]] = ( + _URILoader(union_of_None_type_or_strtype, True, False, None, True) ) -Directory_classLoader: Final = _EnumLoader(("Directory",), "Directory_class") -uri_Directory_classLoader_False_True_None_None: Final = _URILoader( - Directory_classLoader, False, True, None, None +Directory_classLoader: Final[_Loader[Literal["Directory"]]] = _EnumLoader( + ("Directory",), "Directory_class" ) -union_of_None_type_or_booltype: Final = _UnionLoader( +uri_Directory_classLoader_False_True_None_None: Final[_Loader[Literal["Directory"]]] = ( + _URILoader(Directory_classLoader, False, True, None, None) +) +union_of_None_type_or_booltype: Final[_Loader[None | bool]] = _UnionLoader( ( None_type, booltype, ) ) -union_of_None_type_or_LoadListingEnumLoader: Final = _UnionLoader( +union_of_None_type_or_LoadListingEnumLoader: Final[ + _Loader[Literal["no_listing", "shallow_listing", "deep_listing"] | None] +] = _UnionLoader( ( None_type, LoadListingEnumLoader, ) ) -array_of_SecondaryFileSchemaLoader: Final = _ArrayLoader(SecondaryFileSchemaLoader) +array_of_SecondaryFileSchemaLoader: Final[_Loader[Sequence[SecondaryFileSchema]]] = ( + _ArrayLoader(SecondaryFileSchemaLoader) +) union_of_None_type_or_SecondaryFileSchemaLoader_or_array_of_SecondaryFileSchemaLoader: ( - Final + Final[_Loader[None | SecondaryFileSchema | Sequence[SecondaryFileSchema]]] ) = _UnionLoader( ( None_type, @@ -26691,9 +27062,9 @@ def __init__( array_of_SecondaryFileSchemaLoader, ) ) -secondaryfilesdsl_union_of_None_type_or_SecondaryFileSchemaLoader_or_array_of_SecondaryFileSchemaLoader: ( - Final -) = _UnionLoader( +secondaryfilesdsl_union_of_None_type_or_SecondaryFileSchemaLoader_or_array_of_SecondaryFileSchemaLoader: Final[ + _Loader[None | SecondaryFileSchema | Sequence[SecondaryFileSchema]] +] = _UnionLoader( ( _SecondaryDSLLoader( union_of_None_type_or_SecondaryFileSchemaLoader_or_array_of_SecondaryFileSchemaLoader @@ -26701,40 +27072,58 @@ def __init__( union_of_None_type_or_SecondaryFileSchemaLoader_or_array_of_SecondaryFileSchemaLoader, ) ) -union_of_None_type_or_strtype_or_array_of_strtype_or_ExpressionLoader: Final = ( - _UnionLoader( - ( - None_type, - strtype, - array_of_strtype, - ExpressionLoader, - ) +union_of_None_type_or_strtype_or_array_of_strtype_or_ExpressionLoader: Final[ + _Loader[None | Sequence[str] | str] +] = _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: ( - Final -) = _URILoader( +uri_union_of_None_type_or_strtype_or_array_of_strtype_or_ExpressionLoader_True_False_None_True: Final[ + _Loader[None | Sequence[str] | str] +] = _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: Final = _UnionLoader( - ( - None_type, - strtype, - ExpressionLoader, +union_of_None_type_or_strtype_or_ExpressionLoader: Final[_Loader[None | str]] = ( + _UnionLoader( + ( + None_type, + strtype, + ExpressionLoader, + ) ) ) -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 - ) +uri_union_of_None_type_or_strtype_or_ExpressionLoader_True_False_None_True: Final[ + _Loader[None | str] +] = _URILoader( + union_of_None_type_or_strtype_or_ExpressionLoader, True, False, None, True ) -union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype: ( - Final -) = _UnionLoader( +union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype: Final[ + _Loader[ + InputArraySchema + | InputEnumSchema + | InputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | str + ] +] = _UnionLoader( ( CWLTypeLoader, InputRecordSchemaLoader, @@ -26743,14 +27132,65 @@ def __init__( strtype, ) ) -array_of_union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype: ( - Final -) = _ArrayLoader( +array_of_union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype: Final[ + _Loader[ + Sequence[ + InputArraySchema + | InputEnumSchema + | InputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | str + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _UnionLoader( ( CWLTypeLoader, InputRecordSchemaLoader, @@ -26760,35 +27200,121 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: Final = _ArrayLoader(InputRecordFieldLoader) -union_of_None_type_or_array_of_InputRecordFieldLoader: Final = _UnionLoader( +array_of_InputRecordFieldLoader: Final[_Loader[Sequence[InputRecordField]]] = ( + _ArrayLoader(InputRecordFieldLoader) +) +union_of_None_type_or_array_of_InputRecordFieldLoader: Final[ + _Loader[None | Sequence[InputRecordField]] +] = _UnionLoader( ( None_type, array_of_InputRecordFieldLoader, ) ) -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: ( - Final -) = _URILoader( +idmap_fields_union_of_None_type_or_array_of_InputRecordFieldLoader: Final[ + _Loader[None | Sequence[InputRecordField]] +] = _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: Final[ + _Loader[ + 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 + ] +] = _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: ( - Final -) = _UnionLoader( +union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype: Final[ + _Loader[ + Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | OutputArraySchema + | OutputEnumSchema + | OutputRecordSchema + | str + ] +] = _UnionLoader( ( CWLTypeLoader, OutputRecordSchemaLoader, @@ -26797,14 +27323,65 @@ def __init__( strtype, ) ) -array_of_union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype: ( - Final -) = _ArrayLoader( +array_of_union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype: Final[ + _Loader[ + Sequence[ + Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | OutputArraySchema + | OutputEnumSchema + | OutputRecordSchema + | str + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _UnionLoader( ( CWLTypeLoader, OutputRecordSchemaLoader, @@ -26814,89 +27391,246 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: Final = _ArrayLoader(OutputRecordFieldLoader) -union_of_None_type_or_array_of_OutputRecordFieldLoader: Final = _UnionLoader( +array_of_OutputRecordFieldLoader: Final[_Loader[Sequence[OutputRecordField]]] = ( + _ArrayLoader(OutputRecordFieldLoader) +) +union_of_None_type_or_array_of_OutputRecordFieldLoader: Final[ + _Loader[None | Sequence[OutputRecordField]] +] = _UnionLoader( ( None_type, array_of_OutputRecordFieldLoader, ) ) -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: ( - Final -) = _URILoader( +idmap_fields_union_of_None_type_or_array_of_OutputRecordFieldLoader: Final[ + _Loader[None | Sequence[OutputRecordField]] +] = _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: Final[ + _Loader[ + 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 + ] +] = _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: Final = ( - _UnionLoader( - ( - CommandInputParameterLoader, - WorkflowInputParameterLoader, - ) +union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader: Final[ + _Loader[CommandInputParameter | WorkflowInputParameter] +] = _UnionLoader( + ( + CommandInputParameterLoader, + WorkflowInputParameterLoader, ) ) -array_of_union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader: Final = ( - _ArrayLoader(union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader) -) -idmap_inputs_array_of_union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader: ( - Final -) = _IdMapLoader( +array_of_union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader: Final[ + _Loader[Sequence[CommandInputParameter | WorkflowInputParameter]] +] = _ArrayLoader(union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader) +idmap_inputs_array_of_union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader: Final[ + _Loader[Sequence[CommandInputParameter | WorkflowInputParameter]] +] = _IdMapLoader( array_of_union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader, "id", "type", ) -union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader: ( - Final -) = _UnionLoader( +union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader: Final[ + _Loader[ + CommandOutputParameter | ExpressionToolOutputParameter | WorkflowOutputParameter + ] +] = _UnionLoader( ( CommandOutputParameterLoader, ExpressionToolOutputParameterLoader, WorkflowOutputParameterLoader, ) ) -array_of_union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader: ( - Final -) = _ArrayLoader( +array_of_union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader: Final[ + _Loader[ + Sequence[ + CommandOutputParameter + | ExpressionToolOutputParameter + | WorkflowOutputParameter + ] + ] +] = _ArrayLoader( union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader ) -idmap_outputs_array_of_union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader: ( - Final -) = _IdMapLoader( +idmap_outputs_array_of_union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader: Final[ + _Loader[ + Sequence[ + CommandOutputParameter + | ExpressionToolOutputParameter + | WorkflowOutputParameter + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + None + | Sequence[ + CUDARequirement + | DockerRequirement + | EnvVarRequirement + | InitialWorkDirRequirement + | InlineJavascriptRequirement + | InplaceUpdateRequirement + | LoadListingRequirement + | MPIRequirement + | MultipleInputFeatureRequirement + | NetworkAccess + | ResourceRequirement + | ScatterFeatureRequirement + | SchemaDefRequirement + | Secrets + | ShellCommandRequirement + | ShmSize + | SoftwareRequirement + | StepInputExpressionRequirement + | SubworkflowFeatureRequirement + | ToolTimeLimit + | WorkReuse + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + None + | Sequence[ + CUDARequirement + | DockerRequirement + | EnvVarRequirement + | InitialWorkDirRequirement + | InlineJavascriptRequirement + | InplaceUpdateRequirement + | LoadListingRequirement + | MPIRequirement + | MultipleInputFeatureRequirement + | NetworkAccess + | ResourceRequirement + | ScatterFeatureRequirement + | SchemaDefRequirement + | Secrets + | ShellCommandRequirement + | ShmSize + | SoftwareRequirement + | StepInputExpressionRequirement + | SubworkflowFeatureRequirement + | ToolTimeLimit + | WorkReuse + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + Any + | CUDARequirement + | DockerRequirement + | EnvVarRequirement + | InitialWorkDirRequirement + | InlineJavascriptRequirement + | InplaceUpdateRequirement + | LoadListingRequirement + | MPIRequirement + | MultipleInputFeatureRequirement + | NetworkAccess + | ResourceRequirement + | ScatterFeatureRequirement + | SchemaDefRequirement + | Secrets + | ShellCommandRequirement + | ShmSize + | SoftwareRequirement + | StepInputExpressionRequirement + | SubworkflowFeatureRequirement + | ToolTimeLimit + | WorkReuse + ] +] = _UnionLoader( ( InlineJavascriptRequirementLoader, SchemaDefRequirementLoader, @@ -26922,118 +27656,225 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + Sequence[ + Any + | CUDARequirement + | DockerRequirement + | EnvVarRequirement + | InitialWorkDirRequirement + | InlineJavascriptRequirement + | InplaceUpdateRequirement + | LoadListingRequirement + | MPIRequirement + | MultipleInputFeatureRequirement + | NetworkAccess + | ResourceRequirement + | ScatterFeatureRequirement + | SchemaDefRequirement + | Secrets + | ShellCommandRequirement + | ShmSize + | SoftwareRequirement + | StepInputExpressionRequirement + | SubworkflowFeatureRequirement + | ToolTimeLimit + | WorkReuse + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + None + | Sequence[ + Any + | CUDARequirement + | DockerRequirement + | EnvVarRequirement + | InitialWorkDirRequirement + | InlineJavascriptRequirement + | InplaceUpdateRequirement + | LoadListingRequirement + | MPIRequirement + | MultipleInputFeatureRequirement + | NetworkAccess + | ResourceRequirement + | ScatterFeatureRequirement + | SchemaDefRequirement + | Secrets + | ShellCommandRequirement + | ShmSize + | SoftwareRequirement + | StepInputExpressionRequirement + | SubworkflowFeatureRequirement + | ToolTimeLimit + | WorkReuse + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + None + | Sequence[ + Any + | CUDARequirement + | DockerRequirement + | EnvVarRequirement + | InitialWorkDirRequirement + | InlineJavascriptRequirement + | InplaceUpdateRequirement + | LoadListingRequirement + | MPIRequirement + | MultipleInputFeatureRequirement + | NetworkAccess + | ResourceRequirement + | ScatterFeatureRequirement + | SchemaDefRequirement + | Secrets + | ShellCommandRequirement + | ShmSize + | SoftwareRequirement + | StepInputExpressionRequirement + | SubworkflowFeatureRequirement + | ToolTimeLimit + | WorkReuse + ] + ] +] = _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: Final = _UnionLoader( - ( - None_type, - CWLVersionLoader, +union_of_None_type_or_CWLVersionLoader: Final[_Loader[Literal["v1.1"] | None]] = ( + _UnionLoader( + ( + None_type, + CWLVersionLoader, + ) ) ) -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: Final = _EnumLoader( - ("InlineJavascriptRequirement",), "InlineJavascriptRequirement_class" -) -uri_InlineJavascriptRequirement_classLoader_False_True_None_None: Final = _URILoader( - InlineJavascriptRequirement_classLoader, False, True, None, None -) -union_of_None_type_or_array_of_strtype: Final = _UnionLoader( - ( - None_type, - array_of_strtype, +uri_union_of_None_type_or_CWLVersionLoader_False_True_None_None: Final[ + _Loader[Literal["v1.1"] | None] +] = _URILoader(union_of_None_type_or_CWLVersionLoader, False, True, None, None) +InlineJavascriptRequirement_classLoader: Final[ + _Loader[Literal["InlineJavascriptRequirement"]] +] = _EnumLoader(("InlineJavascriptRequirement",), "InlineJavascriptRequirement_class") +uri_InlineJavascriptRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["InlineJavascriptRequirement"]] +] = _URILoader(InlineJavascriptRequirement_classLoader, False, True, None, None) +union_of_None_type_or_array_of_strtype: Final[_Loader[None | Sequence[str]]] = ( + _UnionLoader( + ( + None_type, + array_of_strtype, + ) ) ) -SchemaDefRequirement_classLoader: Final = _EnumLoader( - ("SchemaDefRequirement",), "SchemaDefRequirement_class" +SchemaDefRequirement_classLoader: Final[_Loader[Literal["SchemaDefRequirement"]]] = ( + _EnumLoader(("SchemaDefRequirement",), "SchemaDefRequirement_class") ) -uri_SchemaDefRequirement_classLoader_False_True_None_None: Final = _URILoader( - SchemaDefRequirement_classLoader, False, True, None, None -) -union_of_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader: ( - Final -) = _UnionLoader( +uri_SchemaDefRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["SchemaDefRequirement"]] +] = _URILoader(SchemaDefRequirement_classLoader, False, True, None, None) +union_of_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader: Final[ + _Loader[CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema] +] = _UnionLoader( ( CommandInputRecordSchemaLoader, CommandInputEnumSchemaLoader, CommandInputArraySchemaLoader, ) ) -array_of_union_of_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader: ( - Final -) = _ArrayLoader( +array_of_union_of_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader: Final[ + _Loader[ + Sequence[ + CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema + ] + ] +] = _ArrayLoader( union_of_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader ) -union_of_strtype_or_ExpressionLoader: Final = _UnionLoader( +union_of_strtype_or_ExpressionLoader: Final[_Loader[str]] = _UnionLoader( ( strtype, ExpressionLoader, ) ) -union_of_None_type_or_booltype_or_ExpressionLoader: Final = _UnionLoader( +union_of_None_type_or_booltype_or_ExpressionLoader: Final[ + _Loader[None | bool | str] +] = _UnionLoader( ( None_type, booltype, ExpressionLoader, ) ) -LoadListingRequirement_classLoader: Final = _EnumLoader( - ("LoadListingRequirement",), "LoadListingRequirement_class" -) -uri_LoadListingRequirement_classLoader_False_True_None_None: Final = _URILoader( - LoadListingRequirement_classLoader, False, True, None, None -) -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: Final = ( +LoadListingRequirement_classLoader: Final[ + _Loader[Literal["LoadListingRequirement"]] +] = _EnumLoader(("LoadListingRequirement",), "LoadListingRequirement_class") +uri_LoadListingRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["LoadListingRequirement"]] +] = _URILoader(LoadListingRequirement_classLoader, False, True, None, None) +union_of_None_type_or_inttype_or_ExpressionLoader: Final[_Loader[None | i32 | str]] = ( _UnionLoader( ( None_type, - strtype, + inttype, ExpressionLoader, - array_of_strtype, ) ) ) -union_of_None_type_or_ExpressionLoader: Final = _UnionLoader( +union_of_None_type_or_strtype_or_ExpressionLoader_or_array_of_strtype: Final[ + _Loader[None | Sequence[str] | str] +] = _UnionLoader( + ( + None_type, + strtype, + ExpressionLoader, + array_of_strtype, + ) +) +union_of_None_type_or_ExpressionLoader: Final[_Loader[None | str]] = _UnionLoader( ( None_type, ExpressionLoader, ) ) -union_of_None_type_or_CommandLineBindingLoader: Final = _UnionLoader( +union_of_None_type_or_CommandLineBindingLoader: Final[ + _Loader[CommandLineBinding | None] +] = _UnionLoader( ( None_type, CommandLineBindingLoader, ) ) -union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype: ( - Final -) = _UnionLoader( +union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype: Final[ + _Loader[ + CommandInputArraySchema + | CommandInputEnumSchema + | CommandInputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | str + ] +] = _UnionLoader( ( CWLTypeLoader, CommandInputRecordSchemaLoader, @@ -27042,14 +27883,65 @@ def __init__( strtype, ) ) -array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype: ( - Final -) = _ArrayLoader( +array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype: Final[ + _Loader[ + Sequence[ + CommandInputArraySchema + | CommandInputEnumSchema + | CommandInputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | str + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _UnionLoader( ( CWLTypeLoader, CommandInputRecordSchemaLoader, @@ -27059,39 +27951,123 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: Final = _ArrayLoader( - CommandInputRecordFieldLoader -) -union_of_None_type_or_array_of_CommandInputRecordFieldLoader: Final = _UnionLoader( +array_of_CommandInputRecordFieldLoader: Final[ + _Loader[Sequence[CommandInputRecordField]] +] = _ArrayLoader(CommandInputRecordFieldLoader) +union_of_None_type_or_array_of_CommandInputRecordFieldLoader: Final[ + _Loader[None | Sequence[CommandInputRecordField]] +] = _UnionLoader( ( None_type, 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" - ) +idmap_fields_union_of_None_type_or_array_of_CommandInputRecordFieldLoader: Final[ + _Loader[None | Sequence[CommandInputRecordField]] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: ( - Final -) = _UnionLoader( +union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype: Final[ + _Loader[ + CommandOutputArraySchema + | CommandOutputEnumSchema + | CommandOutputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | str + ] +] = _UnionLoader( ( CWLTypeLoader, CommandOutputRecordSchemaLoader, @@ -27100,14 +28076,65 @@ def __init__( strtype, ) ) -array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype: ( - Final -) = _ArrayLoader( +array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype: Final[ + _Loader[ + Sequence[ + CommandOutputArraySchema + | CommandOutputEnumSchema + | CommandOutputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | str + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _UnionLoader( ( CWLTypeLoader, CommandOutputRecordSchemaLoader, @@ -27117,45 +28144,149 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: Final = _UnionLoader( +union_of_None_type_or_CommandOutputBindingLoader: Final[ + _Loader[CommandOutputBinding | None] +] = _UnionLoader( ( None_type, CommandOutputBindingLoader, ) ) -array_of_CommandOutputRecordFieldLoader: Final = _ArrayLoader( - CommandOutputRecordFieldLoader -) -union_of_None_type_or_array_of_CommandOutputRecordFieldLoader: Final = _UnionLoader( +array_of_CommandOutputRecordFieldLoader: Final[ + _Loader[Sequence[CommandOutputRecordField]] +] = _ArrayLoader(CommandOutputRecordFieldLoader) +union_of_None_type_or_array_of_CommandOutputRecordFieldLoader: Final[ + _Loader[None | Sequence[CommandOutputRecordField]] +] = _UnionLoader( ( None_type, 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" - ) +idmap_fields_union_of_None_type_or_array_of_CommandOutputRecordFieldLoader: Final[ + _Loader[None | Sequence[CommandOutputRecordField]] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _UnionLoader( ( CWLTypeLoader, stdinLoader, @@ -27166,16 +28297,85 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _UnionLoader( ( CWLTypeLoader, stdoutLoader, @@ -27187,82 +28387,125 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: Final = _EnumLoader( +CommandLineTool_classLoader: Final[_Loader[Literal["CommandLineTool"]]] = _EnumLoader( ("CommandLineTool",), "CommandLineTool_class" ) -uri_CommandLineTool_classLoader_False_True_None_None: Final = _URILoader( - CommandLineTool_classLoader, False, True, None, None -) -array_of_CommandInputParameterLoader: Final = _ArrayLoader(CommandInputParameterLoader) -idmap_inputs_array_of_CommandInputParameterLoader: Final = _IdMapLoader( - array_of_CommandInputParameterLoader, "id", "type" -) -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: Final = _UnionLoader( +uri_CommandLineTool_classLoader_False_True_None_None: Final[ + _Loader[Literal["CommandLineTool"]] +] = _URILoader(CommandLineTool_classLoader, False, True, None, None) +array_of_CommandInputParameterLoader: Final[ + _Loader[Sequence[CommandInputParameter]] +] = _ArrayLoader(CommandInputParameterLoader) +idmap_inputs_array_of_CommandInputParameterLoader: Final[ + _Loader[Sequence[CommandInputParameter]] +] = _IdMapLoader(array_of_CommandInputParameterLoader, "id", "type") +array_of_CommandOutputParameterLoader: Final[ + _Loader[Sequence[CommandOutputParameter]] +] = _ArrayLoader(CommandOutputParameterLoader) +idmap_outputs_array_of_CommandOutputParameterLoader: Final[ + _Loader[Sequence[CommandOutputParameter]] +] = _IdMapLoader(array_of_CommandOutputParameterLoader, "id", "type") +union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader: Final[ + _Loader[CommandLineBinding | str] +] = _UnionLoader( ( strtype, ExpressionLoader, 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: ( - Final -) = _UnionLoader( +array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader: Final[ + _Loader[Sequence[CommandLineBinding | str]] +] = _ArrayLoader(union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader) +union_of_None_type_or_array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader: Final[ + _Loader[None | Sequence[CommandLineBinding | str]] +] = _UnionLoader( ( None_type, array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader, ) ) -array_of_inttype: Final = _ArrayLoader(inttype) -union_of_None_type_or_array_of_inttype: Final = _UnionLoader( - ( - None_type, - array_of_inttype, +array_of_inttype: Final[_Loader[Sequence[i32]]] = _ArrayLoader(inttype) +union_of_None_type_or_array_of_inttype: Final[_Loader[None | Sequence[i32]]] = ( + _UnionLoader( + ( + None_type, + array_of_inttype, + ) ) ) -DockerRequirement_classLoader: Final = _EnumLoader( - ("DockerRequirement",), "DockerRequirement_class" +DockerRequirement_classLoader: Final[_Loader[Literal["DockerRequirement"]]] = ( + _EnumLoader(("DockerRequirement",), "DockerRequirement_class") ) -uri_DockerRequirement_classLoader_False_True_None_None: Final = _URILoader( - DockerRequirement_classLoader, False, True, None, None +uri_DockerRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["DockerRequirement"]] +] = _URILoader(DockerRequirement_classLoader, False, True, None, None) +SoftwareRequirement_classLoader: Final[_Loader[Literal["SoftwareRequirement"]]] = ( + _EnumLoader(("SoftwareRequirement",), "SoftwareRequirement_class") ) -SoftwareRequirement_classLoader: Final = _EnumLoader( - ("SoftwareRequirement",), "SoftwareRequirement_class" +uri_SoftwareRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["SoftwareRequirement"]] +] = _URILoader(SoftwareRequirement_classLoader, False, True, None, None) +array_of_SoftwarePackageLoader: Final[_Loader[Sequence[SoftwarePackage]]] = ( + _ArrayLoader(SoftwarePackageLoader) ) -uri_SoftwareRequirement_classLoader_False_True_None_None: Final = _URILoader( - SoftwareRequirement_classLoader, False, True, None, None -) -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: Final = _URILoader( - union_of_None_type_or_array_of_strtype, False, False, None, True -) -InitialWorkDirRequirement_classLoader: Final = _EnumLoader( - ("InitialWorkDirRequirement",), "InitialWorkDirRequirement_class" -) -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: ( - Final -) = _UnionLoader( +idmap_packages_array_of_SoftwarePackageLoader: Final[ + _Loader[Sequence[SoftwarePackage]] +] = _IdMapLoader(array_of_SoftwarePackageLoader, "package", "specs") +uri_union_of_None_type_or_array_of_strtype_False_False_None_True: Final[ + _Loader[None | Sequence[str]] +] = _URILoader(union_of_None_type_or_array_of_strtype, False, False, None, True) +InitialWorkDirRequirement_classLoader: Final[ + _Loader[Literal["InitialWorkDirRequirement"]] +] = _EnumLoader(("InitialWorkDirRequirement",), "InitialWorkDirRequirement_class") +uri_InitialWorkDirRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["InitialWorkDirRequirement"]] +] = _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: Final[ + _Loader[Directory | Dirent | File | None | Sequence[Directory | File] | str] +] = _UnionLoader( ( None_type, FileLoader, @@ -27272,42 +28515,51 @@ def __init__( ExpressionLoader, ) ) -array_of_union_of_None_type_or_FileLoader_or_array_of_union_of_FileLoader_or_DirectoryLoader_or_DirectoryLoader_or_DirentLoader_or_ExpressionLoader: ( - Final -) = _ArrayLoader( +array_of_union_of_None_type_or_FileLoader_or_array_of_union_of_FileLoader_or_DirectoryLoader_or_DirectoryLoader_or_DirentLoader_or_ExpressionLoader: Final[ + _Loader[ + Sequence[Directory | Dirent | File | None | Sequence[Directory | File] | str] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + Sequence[Directory | Dirent | File | None | Sequence[Directory | File] | str] + | str + ] +] = _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: Final = _EnumLoader( - ("EnvVarRequirement",), "EnvVarRequirement_class" -) -uri_EnvVarRequirement_classLoader_False_True_None_None: Final = _URILoader( - EnvVarRequirement_classLoader, False, True, None, None -) -array_of_EnvironmentDefLoader: Final = _ArrayLoader(EnvironmentDefLoader) -idmap_envDef_array_of_EnvironmentDefLoader: Final = _IdMapLoader( - array_of_EnvironmentDefLoader, "envName", "envValue" +EnvVarRequirement_classLoader: Final[_Loader[Literal["EnvVarRequirement"]]] = ( + _EnumLoader(("EnvVarRequirement",), "EnvVarRequirement_class") ) -ShellCommandRequirement_classLoader: Final = _EnumLoader( - ("ShellCommandRequirement",), "ShellCommandRequirement_class" +uri_EnvVarRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["EnvVarRequirement"]] +] = _URILoader(EnvVarRequirement_classLoader, False, True, None, None) +array_of_EnvironmentDefLoader: Final[_Loader[Sequence[EnvironmentDef]]] = _ArrayLoader( + EnvironmentDefLoader ) -uri_ShellCommandRequirement_classLoader_False_True_None_None: Final = _URILoader( - ShellCommandRequirement_classLoader, False, True, None, None +idmap_envDef_array_of_EnvironmentDefLoader: Final[_Loader[Sequence[EnvironmentDef]]] = ( + _IdMapLoader(array_of_EnvironmentDefLoader, "envName", "envValue") ) -ResourceRequirement_classLoader: Final = _EnumLoader( - ("ResourceRequirement",), "ResourceRequirement_class" +ShellCommandRequirement_classLoader: Final[ + _Loader[Literal["ShellCommandRequirement"]] +] = _EnumLoader(("ShellCommandRequirement",), "ShellCommandRequirement_class") +uri_ShellCommandRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["ShellCommandRequirement"]] +] = _URILoader(ShellCommandRequirement_classLoader, False, True, None, None) +ResourceRequirement_classLoader: Final[_Loader[Literal["ResourceRequirement"]]] = ( + _EnumLoader(("ResourceRequirement",), "ResourceRequirement_class") ) -uri_ResourceRequirement_classLoader_False_True_None_None: Final = _URILoader( - ResourceRequirement_classLoader, False, True, None, None -) -union_of_None_type_or_inttype_or_inttype_or_ExpressionLoader: Final = _UnionLoader( +uri_ResourceRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["ResourceRequirement"]] +] = _URILoader(ResourceRequirement_classLoader, False, True, None, None) +union_of_None_type_or_inttype_or_inttype_or_ExpressionLoader: Final[ + _Loader[None | i32 | str] +] = _UnionLoader( ( None_type, inttype, @@ -27315,115 +28567,129 @@ def __init__( ExpressionLoader, ) ) -WorkReuse_classLoader: Final = _EnumLoader(("WorkReuse",), "WorkReuse_class") -uri_WorkReuse_classLoader_False_True_None_None: Final = _URILoader( - WorkReuse_classLoader, False, True, None, None +WorkReuse_classLoader: Final[_Loader[Literal["WorkReuse"]]] = _EnumLoader( + ("WorkReuse",), "WorkReuse_class" +) +uri_WorkReuse_classLoader_False_True_None_None: Final[_Loader[Literal["WorkReuse"]]] = ( + _URILoader(WorkReuse_classLoader, False, True, None, None) ) -union_of_booltype_or_ExpressionLoader: Final = _UnionLoader( +union_of_booltype_or_ExpressionLoader: Final[_Loader[bool | str]] = _UnionLoader( ( booltype, ExpressionLoader, ) ) -NetworkAccess_classLoader: Final = _EnumLoader( +NetworkAccess_classLoader: Final[_Loader[Literal["NetworkAccess"]]] = _EnumLoader( ("NetworkAccess",), "NetworkAccess_class" ) -uri_NetworkAccess_classLoader_False_True_None_None: Final = _URILoader( - NetworkAccess_classLoader, False, True, None, None -) -InplaceUpdateRequirement_classLoader: Final = _EnumLoader( - ("InplaceUpdateRequirement",), "InplaceUpdateRequirement_class" -) -uri_InplaceUpdateRequirement_classLoader_False_True_None_None: Final = _URILoader( - InplaceUpdateRequirement_classLoader, False, True, None, None -) -ToolTimeLimit_classLoader: Final = _EnumLoader( +uri_NetworkAccess_classLoader_False_True_None_None: Final[ + _Loader[Literal["NetworkAccess"]] +] = _URILoader(NetworkAccess_classLoader, False, True, None, None) +InplaceUpdateRequirement_classLoader: Final[ + _Loader[Literal["InplaceUpdateRequirement"]] +] = _EnumLoader(("InplaceUpdateRequirement",), "InplaceUpdateRequirement_class") +uri_InplaceUpdateRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["InplaceUpdateRequirement"]] +] = _URILoader(InplaceUpdateRequirement_classLoader, False, True, None, None) +ToolTimeLimit_classLoader: Final[_Loader[Literal["ToolTimeLimit"]]] = _EnumLoader( ("ToolTimeLimit",), "ToolTimeLimit_class" ) -uri_ToolTimeLimit_classLoader_False_True_None_None: Final = _URILoader( - ToolTimeLimit_classLoader, False, True, None, None -) -union_of_inttype_or_inttype_or_ExpressionLoader: Final = _UnionLoader( - ( - inttype, - inttype, - ExpressionLoader, +uri_ToolTimeLimit_classLoader_False_True_None_None: Final[ + _Loader[Literal["ToolTimeLimit"]] +] = _URILoader(ToolTimeLimit_classLoader, False, True, None, None) +union_of_inttype_or_inttype_or_ExpressionLoader: Final[_Loader[i32 | str]] = ( + _UnionLoader( + ( + inttype, + inttype, + ExpressionLoader, + ) ) ) -union_of_None_type_or_InputBindingLoader: Final = _UnionLoader( - ( - None_type, - InputBindingLoader, +union_of_None_type_or_InputBindingLoader: Final[_Loader[InputBinding | None]] = ( + _UnionLoader( + ( + None_type, + InputBindingLoader, + ) ) ) -ExpressionTool_classLoader: Final = _EnumLoader( +ExpressionTool_classLoader: Final[_Loader[Literal["ExpressionTool"]]] = _EnumLoader( ("ExpressionTool",), "ExpressionTool_class" ) -uri_ExpressionTool_classLoader_False_True_None_None: Final = _URILoader( - ExpressionTool_classLoader, False, True, None, None -) -array_of_WorkflowInputParameterLoader: Final = _ArrayLoader( - WorkflowInputParameterLoader -) -idmap_inputs_array_of_WorkflowInputParameterLoader: Final = _IdMapLoader( - array_of_WorkflowInputParameterLoader, "id", "type" -) -array_of_ExpressionToolOutputParameterLoader: Final = _ArrayLoader( - ExpressionToolOutputParameterLoader -) -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: Final = ( - _URILoader(union_of_None_type_or_strtype_or_array_of_strtype, False, False, 1, None) -) -union_of_None_type_or_LinkMergeMethodLoader: Final = _UnionLoader( +uri_ExpressionTool_classLoader_False_True_None_None: Final[ + _Loader[Literal["ExpressionTool"]] +] = _URILoader(ExpressionTool_classLoader, False, True, None, None) +array_of_WorkflowInputParameterLoader: Final[ + _Loader[Sequence[WorkflowInputParameter]] +] = _ArrayLoader(WorkflowInputParameterLoader) +idmap_inputs_array_of_WorkflowInputParameterLoader: Final[ + _Loader[Sequence[WorkflowInputParameter]] +] = _IdMapLoader(array_of_WorkflowInputParameterLoader, "id", "type") +array_of_ExpressionToolOutputParameterLoader: Final[ + _Loader[Sequence[ExpressionToolOutputParameter]] +] = _ArrayLoader(ExpressionToolOutputParameterLoader) +idmap_outputs_array_of_ExpressionToolOutputParameterLoader: Final[ + _Loader[Sequence[ExpressionToolOutputParameter]] +] = _IdMapLoader(array_of_ExpressionToolOutputParameterLoader, "id", "type") +uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_1_None: Final[ + _Loader[None | Sequence[str] | str] +] = _URILoader(union_of_None_type_or_strtype_or_array_of_strtype, False, False, 1, None) +union_of_None_type_or_LinkMergeMethodLoader: Final[ + _Loader[Literal["merge_nested", "merge_flattened"] | None] +] = _UnionLoader( ( None_type, LinkMergeMethodLoader, ) ) -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) +uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_2_None: Final[ + _Loader[None | Sequence[str] | str] +] = _URILoader(union_of_None_type_or_strtype_or_array_of_strtype, False, False, 2, None) +array_of_WorkflowStepInputLoader: Final[_Loader[Sequence[WorkflowStepInput]]] = ( + _ArrayLoader(WorkflowStepInputLoader) ) -array_of_WorkflowStepInputLoader: Final = _ArrayLoader(WorkflowStepInputLoader) -idmap_in__array_of_WorkflowStepInputLoader: Final = _IdMapLoader( - array_of_WorkflowStepInputLoader, "id", "source" -) -union_of_strtype_or_WorkflowStepOutputLoader: Final = _UnionLoader( +idmap_in__array_of_WorkflowStepInputLoader: Final[ + _Loader[Sequence[WorkflowStepInput]] +] = _IdMapLoader(array_of_WorkflowStepInputLoader, "id", "source") +union_of_strtype_or_WorkflowStepOutputLoader: Final[ + _Loader[WorkflowStepOutput | str] +] = _UnionLoader( ( strtype, WorkflowStepOutputLoader, ) ) -array_of_union_of_strtype_or_WorkflowStepOutputLoader: Final = _ArrayLoader( - union_of_strtype_or_WorkflowStepOutputLoader -) -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: ( - Final -) = _URILoader( +array_of_union_of_strtype_or_WorkflowStepOutputLoader: Final[ + _Loader[Sequence[WorkflowStepOutput | str]] +] = _ArrayLoader(union_of_strtype_or_WorkflowStepOutputLoader) +union_of_array_of_union_of_strtype_or_WorkflowStepOutputLoader: Final[ + _Loader[Sequence[WorkflowStepOutput | str]] +] = _UnionLoader((array_of_union_of_strtype_or_WorkflowStepOutputLoader,)) +uri_union_of_array_of_union_of_strtype_or_WorkflowStepOutputLoader_True_False_None_None: Final[ + _Loader[Sequence[WorkflowStepOutput | str]] +] = _URILoader( union_of_array_of_union_of_strtype_or_WorkflowStepOutputLoader, True, False, None, None, ) -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, +array_of_Any_type: Final[_Loader[Sequence[Any]]] = _ArrayLoader(Any_type) +union_of_None_type_or_array_of_Any_type: Final[_Loader[None | Sequence[Any]]] = ( + _UnionLoader( + ( + None_type, + array_of_Any_type, + ) ) ) -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: ( - Final -) = _UnionLoader( +idmap_hints_union_of_None_type_or_array_of_Any_type: Final[ + _Loader[None | Sequence[Any]] +] = _IdMapLoader(union_of_None_type_or_array_of_Any_type, "class", "None") +union_of_strtype_or_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader: Final[ + _Loader[CommandLineTool | ExpressionTool | ProcessGenerator | Workflow | str] +] = _UnionLoader( ( strtype, CommandLineToolLoader, @@ -27432,87 +28698,103 @@ def __init__( ProcessGeneratorLoader, ) ) -uri_union_of_strtype_or_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader_False_False_None_None: ( - Final -) = _URILoader( +uri_union_of_strtype_or_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader_False_False_None_None: Final[ + _Loader[CommandLineTool | ExpressionTool | ProcessGenerator | Workflow | str] +] = _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: Final = ( - _URILoader(union_of_None_type_or_strtype_or_array_of_strtype, False, False, 0, None) -) -union_of_None_type_or_ScatterMethodLoader: Final = _UnionLoader( +uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_0_None: Final[ + _Loader[None | Sequence[str] | str] +] = _URILoader(union_of_None_type_or_strtype_or_array_of_strtype, False, False, 0, None) +union_of_None_type_or_ScatterMethodLoader: Final[ + _Loader[Literal["dotproduct", "nested_crossproduct", "flat_crossproduct"] | None] +] = _UnionLoader( ( None_type, ScatterMethodLoader, ) ) -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: Final = _EnumLoader(("Workflow",), "Workflow_class") -uri_Workflow_classLoader_False_True_None_None: Final = _URILoader( - Workflow_classLoader, False, True, None, None +uri_union_of_None_type_or_ScatterMethodLoader_False_True_None_None: Final[ + _Loader[Literal["dotproduct", "nested_crossproduct", "flat_crossproduct"] | None] +] = _URILoader(union_of_None_type_or_ScatterMethodLoader, False, True, None, None) +Workflow_classLoader: Final[_Loader[Literal["Workflow"]]] = _EnumLoader( + ("Workflow",), "Workflow_class" ) -array_of_WorkflowOutputParameterLoader: Final = _ArrayLoader( - WorkflowOutputParameterLoader +uri_Workflow_classLoader_False_True_None_None: Final[_Loader[Literal["Workflow"]]] = ( + _URILoader(Workflow_classLoader, False, True, None, None) ) -idmap_outputs_array_of_WorkflowOutputParameterLoader: Final = _IdMapLoader( - array_of_WorkflowOutputParameterLoader, "id", "type" +array_of_WorkflowOutputParameterLoader: Final[ + _Loader[Sequence[WorkflowOutputParameter]] +] = _ArrayLoader(WorkflowOutputParameterLoader) +idmap_outputs_array_of_WorkflowOutputParameterLoader: Final[ + _Loader[Sequence[WorkflowOutputParameter]] +] = _IdMapLoader(array_of_WorkflowOutputParameterLoader, "id", "type") +array_of_WorkflowStepLoader: Final[_Loader[Sequence[WorkflowStep]]] = _ArrayLoader( + WorkflowStepLoader ) -array_of_WorkflowStepLoader: Final = _ArrayLoader(WorkflowStepLoader) -union_of_array_of_WorkflowStepLoader: Final = _UnionLoader( - (array_of_WorkflowStepLoader,) +union_of_array_of_WorkflowStepLoader: Final[_Loader[Sequence[WorkflowStep]]] = ( + _UnionLoader((array_of_WorkflowStepLoader,)) ) -idmap_steps_union_of_array_of_WorkflowStepLoader: Final = _IdMapLoader( - union_of_array_of_WorkflowStepLoader, "id", "None" -) -SubworkflowFeatureRequirement_classLoader: Final = _EnumLoader( +idmap_steps_union_of_array_of_WorkflowStepLoader: Final[ + _Loader[Sequence[WorkflowStep]] +] = _IdMapLoader(union_of_array_of_WorkflowStepLoader, "id", "None") +SubworkflowFeatureRequirement_classLoader: Final[ + _Loader[Literal["SubworkflowFeatureRequirement"]] +] = _EnumLoader( ("SubworkflowFeatureRequirement",), "SubworkflowFeatureRequirement_class" ) -uri_SubworkflowFeatureRequirement_classLoader_False_True_None_None: Final = _URILoader( - SubworkflowFeatureRequirement_classLoader, False, True, None, None -) -ScatterFeatureRequirement_classLoader: Final = _EnumLoader( - ("ScatterFeatureRequirement",), "ScatterFeatureRequirement_class" -) -uri_ScatterFeatureRequirement_classLoader_False_True_None_None: Final = _URILoader( - ScatterFeatureRequirement_classLoader, False, True, None, None -) -MultipleInputFeatureRequirement_classLoader: Final = _EnumLoader( +uri_SubworkflowFeatureRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["SubworkflowFeatureRequirement"]] +] = _URILoader(SubworkflowFeatureRequirement_classLoader, False, True, None, None) +ScatterFeatureRequirement_classLoader: Final[ + _Loader[Literal["ScatterFeatureRequirement"]] +] = _EnumLoader(("ScatterFeatureRequirement",), "ScatterFeatureRequirement_class") +uri_ScatterFeatureRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["ScatterFeatureRequirement"]] +] = _URILoader(ScatterFeatureRequirement_classLoader, False, True, None, None) +MultipleInputFeatureRequirement_classLoader: Final[ + _Loader[Literal["MultipleInputFeatureRequirement"]] +] = _EnumLoader( ("MultipleInputFeatureRequirement",), "MultipleInputFeatureRequirement_class" ) -uri_MultipleInputFeatureRequirement_classLoader_False_True_None_None: Final = ( - _URILoader(MultipleInputFeatureRequirement_classLoader, False, True, None, None) -) -StepInputExpressionRequirement_classLoader: Final = _EnumLoader( +uri_MultipleInputFeatureRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["MultipleInputFeatureRequirement"]] +] = _URILoader(MultipleInputFeatureRequirement_classLoader, False, True, None, None) +StepInputExpressionRequirement_classLoader: Final[ + _Loader[Literal["StepInputExpressionRequirement"]] +] = _EnumLoader( ("StepInputExpressionRequirement",), "StepInputExpressionRequirement_class" ) -uri_StepInputExpressionRequirement_classLoader_False_True_None_None: Final = _URILoader( - StepInputExpressionRequirement_classLoader, False, True, None, None +uri_StepInputExpressionRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["StepInputExpressionRequirement"]] +] = _URILoader(StepInputExpressionRequirement_classLoader, False, True, None, None) +uri_strtype_False_True_None_None: Final[_Loader[str]] = _URILoader( + strtype, False, True, None, None ) -uri_strtype_False_True_None_None: Final = _URILoader(strtype, False, True, None, None) -uri_array_of_strtype_False_False_0_None: Final = _URILoader( +uri_array_of_strtype_False_False_0_None: Final[_Loader[Sequence[str]]] = _URILoader( array_of_strtype, False, False, 0, None ) -union_of_inttype_or_ExpressionLoader: Final = _UnionLoader( +union_of_inttype_or_ExpressionLoader: Final[_Loader[i32 | str]] = _UnionLoader( ( inttype, ExpressionLoader, ) ) -union_of_strtype_or_array_of_strtype: Final = _UnionLoader( - ( - strtype, - array_of_strtype, +union_of_strtype_or_array_of_strtype: Final[_Loader[Sequence[str] | str]] = ( + _UnionLoader( + ( + strtype, + array_of_strtype, + ) ) ) -union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader: ( - Final -) = _UnionLoader( +union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader: Final[ + _Loader[CommandLineTool | ExpressionTool | ProcessGenerator | Workflow] +] = _UnionLoader( ( CommandLineToolLoader, ExpressionToolLoader, @@ -27520,14 +28802,20 @@ def __init__( ProcessGeneratorLoader, ) ) -array_of_union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader: ( - Final -) = _ArrayLoader( +array_of_union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader: Final[ + _Loader[Sequence[CommandLineTool | ExpressionTool | ProcessGenerator | Workflow]] +] = _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: ( - Final -) = _UnionLoader( +union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader_or_array_of_union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_ProcessGeneratorLoader: Final[ + _Loader[ + CommandLineTool + | ExpressionTool + | ProcessGenerator + | Sequence[CommandLineTool | ExpressionTool | ProcessGenerator | Workflow] + | Workflow + ] +] = _UnionLoader( ( CommandLineToolLoader, ExpressionToolLoader, diff --git a/cwl_utils/parser/cwl_v1_2.py b/cwl_utils/parser/cwl_v1_2.py index 4b7fa99d..b7387083 100644 --- a/cwl_utils/parser/cwl_v1_2.py +++ b/cwl_utils/parser/cwl_v1_2.py @@ -45,7 +45,9 @@ IdxType: TypeAlias = MutableMapping[str, tuple[Any, "LoadingOptions"]] +E = TypeVar("E", bound=str) S = TypeVar("S", bound="Saveable") +T = TypeVar("T", covariant=True) class LoadingOptions: @@ -236,11 +238,11 @@ def save( def load_field( val: Any | None, - fieldtype: "_Loader", + fieldtype: _Loader[T], baseuri: str, loadingOptions: LoadingOptions, lc: Any | None = None, -) -> Any: +) -> T: """Load field.""" if isinstance(val, MutableMapping): if "$import" in val: @@ -442,7 +444,8 @@ def expand_url( return url -class _Loader: +class _Loader(Generic[T], metaclass=ABCMeta): + @abstractmethod def load( self, doc: Any, @@ -450,11 +453,10 @@ def load( loadingOptions: LoadingOptions, docRoot: str | None = None, lc: Any | None = None, - ) -> Any | None: - pass + ) -> T: ... -class _AnyLoader(_Loader): +class _AnyLoader(_Loader[Any]): def load( self, doc: Any, @@ -468,8 +470,8 @@ def load( raise ValidationException("Expected non-null") -class _PrimitiveLoader(_Loader): - def __init__(self, tp: type | tuple[type[str], type[str]]) -> None: +class _PrimitiveLoader(_Loader[T]): + def __init__(self, tp: type[T]) -> None: self.tp: Final = tp def load( @@ -479,7 +481,7 @@ def load( loadingOptions: LoadingOptions, docRoot: str | None = None, lc: Any | None = None, - ) -> Any: + ) -> T: if not isinstance(doc, self.tp): raise ValidationException(f"Expected a {self.tp} but got {doc.__class__.__name__}") return doc @@ -488,8 +490,8 @@ def __repr__(self) -> str: return str(self.tp) -class _ArrayLoader(_Loader): - def __init__(self, items: _Loader) -> None: +class _ArrayLoader(_Loader[Sequence[T]]): + def __init__(self, items: _Loader[T]) -> None: self.items: Final = items def load( @@ -499,7 +501,7 @@ def load( loadingOptions: LoadingOptions, docRoot: str | None = None, lc: Any | None = None, - ) -> list[Any]: + ) -> list[T]: if not isinstance(doc, MutableSequence): raise ValidationException( f"Value is a {convert_typing(extract_type(type(doc)))}, " @@ -545,10 +547,10 @@ def __repr__(self) -> str: return f"array<{self.items}>" -class _MapLoader(_Loader): +class _MapLoader(_Loader[Mapping[str, T]]): def __init__( self, - values: _Loader, + values: _Loader[T], name: str | None = None, container: str | None = None, no_link_check: bool | None = None, @@ -565,7 +567,7 @@ def load( loadingOptions: LoadingOptions, docRoot: str | None = None, lc: Any | None = None, - ) -> dict[str, Any]: + ) -> dict[str, T]: 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: @@ -588,7 +590,7 @@ def __repr__(self) -> str: return self.name if self.name is not None else f"map" -class _EnumLoader(_Loader): +class _EnumLoader(_Loader[E]): def __init__(self, symbols: Sequence[str], name: str) -> None: self.symbols: Final = symbols self.name: Final = name @@ -600,17 +602,17 @@ def load( loadingOptions: LoadingOptions, docRoot: str | None = None, lc: Any | None = None, - ) -> str: + ) -> E: if doc in self.symbols: - return cast(str, doc) + return cast(E, doc) raise ValidationException(f"Expected one of {self.symbols}") def __repr__(self) -> str: return self.name -class _SecondaryDSLLoader(_Loader): - def __init__(self, inner: _Loader) -> None: +class _SecondaryDSLLoader(_Loader[T]): + def __init__(self, inner: _Loader[T]) -> None: self.inner: Final = inner def load( @@ -620,7 +622,7 @@ def load( loadingOptions: LoadingOptions, docRoot: str | None = None, lc: Any | None = None, - ) -> Any: + ) -> T: r: Final[list[dict[str, Any]]] = [] match doc: case MutableSequence() as dlist: @@ -682,7 +684,7 @@ def load( return self.inner.load(r, baseuri, loadingOptions, docRoot, lc=lc) -class _RecordLoader(_Loader, Generic[S]): +class _RecordLoader(_Loader[S]): def __init__( self, classtype: type[S], @@ -716,7 +718,7 @@ def __repr__(self) -> str: return str(self.classtype.__name__) -class _ExpressionLoader(_Loader): +class _ExpressionLoader(_Loader[str]): def __init__(self, items: type[str]) -> None: self.items: Final = items @@ -737,12 +739,12 @@ def load( return doc -class _UnionLoader(_Loader): - def __init__(self, alternates: Sequence[_Loader], name: str | None = None) -> None: +class _UnionLoader(_Loader[T]): + def __init__(self, alternates: Sequence[_Loader[T]], name: str | None = None) -> None: self.alternates = alternates self.name: Final = name - def add_loaders(self, loaders: Sequence[_Loader]) -> None: + def add_loaders(self, loaders: Sequence[_Loader[T]]) -> None: self.alternates = tuple(loader for loader in chain(self.alternates, loaders)) def load( @@ -752,7 +754,7 @@ def load( loadingOptions: LoadingOptions, docRoot: str | None = None, lc: Any | None = None, - ) -> Any: + ) -> T: errors: Final = [] if lc is None: @@ -827,10 +829,10 @@ def __repr__(self) -> str: return self.name if self.name is not None else " | ".join(str(a) for a in self.alternates) -class _URILoader(_Loader): +class _URILoader(_Loader[T]): def __init__( self, - inner: _Loader, + inner: _Loader[T], scoped_id: bool, vocab_term: bool, scoped_ref: int | None, @@ -849,7 +851,7 @@ def load( loadingOptions: LoadingOptions, docRoot: str | None = None, lc: Any | None = None, - ) -> Any: + ) -> T: if self.no_link_check is not None: loadingOptions = LoadingOptions( copyfrom=loadingOptions, no_link_check=self.no_link_check @@ -896,8 +898,8 @@ def load( return self.inner.load(doc, baseuri, loadingOptions, lc=lc) -class _TypeDSLLoader(_Loader): - def __init__(self, inner: _Loader, refScope: int | None, salad_version: str) -> None: +class _TypeDSLLoader(_Loader[T]): + def __init__(self, inner: _Loader[T], refScope: int | None, salad_version: str) -> None: self.inner: Final = inner self.refScope: Final = refScope self.salad_version: Final = salad_version @@ -944,7 +946,7 @@ def load( loadingOptions: LoadingOptions, docRoot: str | None = None, lc: Any | None = None, - ) -> Any: + ) -> T: if isinstance(doc, MutableSequence): r: Final[list[Any]] = [] for d in doc: @@ -966,8 +968,8 @@ def load( return self.inner.load(doc, baseuri, loadingOptions, lc=lc) -class _IdMapLoader(_Loader): - def __init__(self, inner: _Loader, mapSubject: str, mapPredicate: str | None) -> None: +class _IdMapLoader(_Loader[T]): + def __init__(self, inner: _Loader[T], mapSubject: str, mapPredicate: str | None) -> None: self.inner: Final = inner self.mapSubject: Final = mapSubject self.mapPredicate: Final = mapPredicate @@ -979,7 +981,7 @@ def load( loadingOptions: LoadingOptions, docRoot: str | None = None, lc: Any | None = None, - ) -> Any: + ) -> T: if isinstance(doc, MutableMapping): r: Final[list[Any]] = [] for k in doc.keys(): @@ -1006,12 +1008,12 @@ def load( def _document_load( - loader: _Loader, + loader: _Loader[T], doc: str | MutableMapping[str, Any] | MutableSequence[Any], baseuri: str, loadingOptions: LoadingOptions, addl_metadata_fields: MutableSequence[str] | None = None, -) -> tuple[Any, LoadingOptions]: +) -> tuple[T, LoadingOptions]: if isinstance(doc, str): return _document_load_by_url( loader, @@ -1076,11 +1078,11 @@ def _document_load( def _document_load_by_url( - loader: _Loader, + loader: _Loader[T], url: str, loadingOptions: LoadingOptions, addl_metadata_fields: MutableSequence[str] | None = None, -) -> tuple[Any, LoadingOptions]: +) -> tuple[T, LoadingOptions]: if url in loadingOptions.idx: return loadingOptions.idx[url] @@ -1266,14 +1268,14 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: + name = "" _errors__.append(ValidationException("missing name")) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name doc = None if "doc" in _doc: try: @@ -1394,13 +1396,13 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, doc=doc, type_=type_, extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -1415,7 +1417,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.doc is not None: r["doc"] = save( @@ -1738,14 +1740,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name try: if _doc.get("symbols") is None: raise ValidationException("missing required field `symbols`", None, []) @@ -1867,13 +1868,13 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, symbols=symbols, type_=type_, extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -1888,7 +1889,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.symbols is not None: u = save_relative_uri(self.symbols, self.name, True, None, relative_uris) @@ -2802,14 +2803,14 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: + name = "" _errors__.append(ValidationException("missing name")) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name doc = None if "doc" in _doc: try: @@ -2930,13 +2931,13 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, doc=doc, type_=type_, extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -2951,7 +2952,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.doc is not None: r["doc"] = save( @@ -4642,14 +4643,14 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: + name = "" _errors__.append(ValidationException("missing name")) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name doc = None if "doc" in _doc: try: @@ -5052,7 +5053,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, doc=doc, type_=type_, label=label, @@ -5064,7 +5065,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -5079,7 +5080,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.doc is not None: r["doc"] = save( @@ -5259,14 +5260,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name fields = None if "fields" in _doc: try: @@ -5481,7 +5481,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, fields=fields, type_=type_, label=label, @@ -5489,7 +5489,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -5504,7 +5504,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.fields is not None: r["fields"] = save( @@ -5639,14 +5639,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name try: if _doc.get("symbols") is None: raise ValidationException("missing required field `symbols`", None, []) @@ -5862,7 +5861,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, symbols=symbols, type_=type_, label=label, @@ -5870,7 +5869,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -5885,7 +5884,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.symbols is not None: u = save_relative_uri(self.symbols, self.name, True, None, relative_uris) @@ -6019,14 +6018,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name try: if _doc.get("items") is None: raise ValidationException("missing required field `items`", None, []) @@ -6242,7 +6240,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, items=items, type_=type_, label=label, @@ -6250,7 +6248,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -6265,7 +6263,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.items is not None: u = save_relative_uri(self.items, self.name, False, 2, relative_uris) @@ -6411,14 +6409,14 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: + name = "" _errors__.append(ValidationException("missing name")) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name doc = None if "doc" in _doc: try: @@ -6727,7 +6725,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, doc=doc, type_=type_, label=label, @@ -6737,7 +6735,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -6752,7 +6750,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.doc is not None: r["doc"] = save( @@ -6904,14 +6902,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name fields = None if "fields" in _doc: try: @@ -7126,7 +7123,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, fields=fields, type_=type_, label=label, @@ -7134,7 +7131,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -7149,7 +7146,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.fields is not None: r["fields"] = save( @@ -7284,14 +7281,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name try: if _doc.get("symbols") is None: raise ValidationException("missing required field `symbols`", None, []) @@ -7507,7 +7503,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, symbols=symbols, type_=type_, label=label, @@ -7515,7 +7511,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -7530,7 +7526,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.symbols is not None: u = save_relative_uri(self.symbols, self.name, True, None, relative_uris) @@ -7664,14 +7660,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name try: if _doc.get("items") is None: raise ValidationException("missing required field `items`", None, []) @@ -7887,7 +7882,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, items=items, type_=type_, label=label, @@ -7895,7 +7890,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -7910,7 +7905,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.items is not None: u = save_relative_uri(self.items, self.name, False, 2, relative_uris) @@ -9920,14 +9915,14 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: + name = "" _errors__.append(ValidationException("missing name")) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name doc = None if "doc" in _doc: try: @@ -10377,7 +10372,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, doc=doc, type_=type_, label=label, @@ -10390,7 +10385,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -10405,7 +10400,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.doc is not None: r["doc"] = save( @@ -10605,14 +10600,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name fields = None if "fields" in _doc: try: @@ -10874,7 +10868,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, fields=fields, type_=type_, label=label, @@ -10883,7 +10877,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -10898,7 +10892,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.fields is not None: r["fields"] = save( @@ -11052,14 +11046,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name try: if _doc.get("symbols") is None: raise ValidationException("missing required field `symbols`", None, []) @@ -11322,7 +11315,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, symbols=symbols, type_=type_, label=label, @@ -11331,7 +11324,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -11346,7 +11339,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.symbols is not None: u = save_relative_uri(self.symbols, self.name, True, None, relative_uris) @@ -11492,14 +11485,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name try: if _doc.get("items") is None: raise ValidationException("missing required field `items`", None, []) @@ -11762,7 +11754,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, items=items, type_=type_, label=label, @@ -11771,7 +11763,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -11786,7 +11778,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.items is not None: u = save_relative_uri(self.items, self.name, False, 2, relative_uris) @@ -11943,14 +11935,14 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: + name = "" _errors__.append(ValidationException("missing name")) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name doc = None if "doc" in _doc: try: @@ -12306,7 +12298,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, doc=doc, type_=type_, label=label, @@ -12317,7 +12309,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -12332,7 +12324,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.doc is not None: r["doc"] = save( @@ -12502,14 +12494,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name fields = None if "fields" in _doc: try: @@ -12724,7 +12715,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, fields=fields, type_=type_, label=label, @@ -12732,7 +12723,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -12747,7 +12738,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.fields is not None: r["fields"] = save( @@ -12882,14 +12873,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name try: if _doc.get("symbols") is None: raise ValidationException("missing required field `symbols`", None, []) @@ -13105,7 +13095,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, symbols=symbols, type_=type_, label=label, @@ -13113,7 +13103,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -13128,7 +13118,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.symbols is not None: u = save_relative_uri(self.symbols, self.name, True, None, relative_uris) @@ -13262,14 +13252,13 @@ def fromDoc( ) ) - __original_name_is_none = name is None if name is None: if docRoot is not None: name = docRoot else: name = "_:" + str(_uuid__.uuid4()) - if not __original_name_is_none: - baseuri = cast(str, name) + else: + baseuri = name try: if _doc.get("items") is None: raise ValidationException("missing required field `items`", None, []) @@ -13485,7 +13474,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - name=cast(str, name), + name=name, items=items, type_=type_, label=label, @@ -13493,7 +13482,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, name)] = (_constructed, loadingOptions) + loadingOptions.idx[name] = (_constructed, loadingOptions) return _constructed def save( @@ -13508,7 +13497,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.name is not None: - u = save_relative_uri(self.name, base_url, True, None, relative_uris) + u = save_relative_uri(self.name, self.name, True, None, relative_uris) r["name"] = u if self.items is not None: u = save_relative_uri(self.items, self.name, False, 2, relative_uris) @@ -13666,14 +13655,14 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: + id = "" _errors__.append(ValidationException("missing id")) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id label = None if "label" in _doc: try: @@ -14170,7 +14159,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, label=label, secondaryFiles=secondaryFiles, streamable=streamable, @@ -14184,7 +14173,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -14199,7 +14188,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.label is not None: r["label"] = save( @@ -14414,14 +14403,14 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: + id = "" _errors__.append(ValidationException("missing id")) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id label = None if "label" in _doc: try: @@ -14777,7 +14766,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, label=label, secondaryFiles=secondaryFiles, streamable=streamable, @@ -14788,7 +14777,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -14803,7 +14792,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.label is not None: r["label"] = save( @@ -15012,14 +15001,13 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: id = "_:" + str(_uuid__.uuid4()) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id try: if _doc.get("class") is None: raise ValidationException("missing required field `class`", None, []) @@ -15815,7 +15803,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, label=label, doc=doc, inputs=inputs, @@ -15835,7 +15823,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -15850,7 +15838,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.class_ is not None: uri = self.loadingOptions.vocab[self.class_] @@ -19230,14 +19218,14 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: + id = "" _errors__.append(ValidationException("missing id")) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id label = None if "label" in _doc: try: @@ -19546,7 +19534,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, label=label, secondaryFiles=secondaryFiles, streamable=streamable, @@ -19556,7 +19544,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -19571,7 +19559,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.label is not None: r["label"] = save( @@ -19743,14 +19731,14 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: + id = "" _errors__.append(ValidationException("missing id")) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id label = None if "label" in _doc: try: @@ -20247,7 +20235,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, label=label, secondaryFiles=secondaryFiles, streamable=streamable, @@ -20261,7 +20249,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -20276,7 +20264,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.label is not None: r["label"] = save( @@ -20504,14 +20492,13 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: id = "_:" + str(_uuid__.uuid4()) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id try: if _doc.get("class") is None: raise ValidationException("missing required field `class`", None, []) @@ -20979,7 +20966,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, label=label, doc=doc, inputs=inputs, @@ -20992,7 +20979,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -21007,7 +20994,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.class_ is not None: uri = self.loadingOptions.vocab[self.class_] @@ -21226,14 +21213,14 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: + id = "" _errors__.append(ValidationException("missing id")) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id label = None if "label" in _doc: try: @@ -21683,7 +21670,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, label=label, secondaryFiles=secondaryFiles, streamable=streamable, @@ -21696,7 +21683,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -21711,7 +21698,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.label is not None: r["label"] = save( @@ -22019,14 +22006,14 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: + id = "" _errors__.append(ValidationException("missing id")) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id source = None if "source" in _doc: try: @@ -22428,7 +22415,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, source=source, linkMerge=linkMerge, pickValue=pickValue, @@ -22440,7 +22427,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -22455,7 +22442,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.source is not None: u = save_relative_uri(self.source, self.id, False, 2, relative_uris) @@ -22635,14 +22622,14 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: + id = "" _errors__.append(ValidationException("missing id")) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id extension_fields: MutableMapping[str, Any] = {} for k in _doc.keys(): if k not in cls.attrs: @@ -22666,11 +22653,11 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -22685,7 +22672,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u # top refers to the directory level @@ -22897,14 +22884,14 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: + id = "" _errors__.append(ValidationException("missing id")) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id label = None if "label" in _doc: try: @@ -23405,7 +23392,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, label=label, doc=doc, in_=in_, @@ -23419,7 +23406,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -23434,7 +23421,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.label is not None: r["label"] = save( @@ -23693,14 +23680,13 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: id = "_:" + str(_uuid__.uuid4()) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id try: if _doc.get("class") is None: raise ValidationException("missing required field `class`", None, []) @@ -24168,7 +24154,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, label=label, doc=doc, inputs=inputs, @@ -24181,7 +24167,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -24196,7 +24182,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.class_ is not None: uri = self.loadingOptions.vocab[self.class_] @@ -24882,14 +24868,14 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: + id = "" _errors__.append(ValidationException("missing id")) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id label = None if "label" in _doc: try: @@ -25339,7 +25325,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, label=label, secondaryFiles=secondaryFiles, streamable=streamable, @@ -25352,7 +25338,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -25367,7 +25353,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.label is not None: r["label"] = save( @@ -25571,14 +25557,14 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: + id = "" _errors__.append(ValidationException("missing id")) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id label = None if "label" in _doc: try: @@ -25887,7 +25873,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, label=label, secondaryFiles=secondaryFiles, streamable=streamable, @@ -25897,7 +25883,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -25912,7 +25898,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.label is not None: r["label"] = save( @@ -26093,14 +26079,13 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: id = "_:" + str(_uuid__.uuid4()) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id try: if _doc.get("class") is None: raise ValidationException("missing required field `class`", None, []) @@ -26520,7 +26505,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, label=label, doc=doc, inputs=inputs, @@ -26532,7 +26517,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -26547,7 +26532,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.class_ is not None: uri = self.loadingOptions.vocab[self.class_] @@ -26916,14 +26901,13 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: id = "_:" + str(_uuid__.uuid4()) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id try: if _doc.get("class") is None: raise ValidationException("missing required field `class`", None, []) @@ -27393,7 +27377,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, label=label, doc=doc, inputs=inputs, @@ -27406,7 +27390,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -27421,7 +27405,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.class_ is not None: uri = self.loadingOptions.vocab[self.class_] @@ -28169,14 +28153,13 @@ def fromDoc( ) ) - __original_id_is_none = id is None if id is None: if docRoot is not None: id = docRoot else: id = "_:" + str(_uuid__.uuid4()) - if not __original_id_is_none: - baseuri = cast(str, id) + else: + baseuri = id default = None if "default" in _doc: try: @@ -28437,7 +28420,7 @@ def fromDoc( if _errors__: raise ValidationException("", None, _errors__, "*") _constructed = cls( - id=cast(str, id), + id=id, default=default, linkMerge=linkMerge, loopSource=loopSource, @@ -28446,7 +28429,7 @@ def fromDoc( extension_fields=extension_fields, loadingOptions=loadingOptions, ) - loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + loadingOptions.idx[id] = (_constructed, loadingOptions) return _constructed def save( @@ -28461,7 +28444,7 @@ def save( for ef in self.extension_fields: r[ef] = self.extension_fields[ef] if self.id is not None: - u = save_relative_uri(self.id, base_url, True, None, relative_uris) + u = save_relative_uri(self.id, self.id, True, None, relative_uris) r["id"] = u if self.default is not None: r["default"] = save( @@ -29267,14 +29250,16 @@ def __init__( "https://w3id.org/cwl/cwl#v1.2": "v1.2", }) -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( +strtype: Final[_Loader[str]] = _PrimitiveLoader(str) +inttype: Final[_Loader[i32]] = _PrimitiveLoader(i32) +floattype: Final[_Loader[float]] = _PrimitiveLoader(float) +booltype: Final[_Loader[bool]] = _PrimitiveLoader(bool) +None_type: Final[_Loader[None]] = _PrimitiveLoader(type(None)) +Any_type: Final[_Loader[Any]] = _AnyLoader() +longtype: Final[_Loader[i64]] = _PrimitiveLoader(i64) +PrimitiveTypeLoader: Final[ + _Loader[Literal["null", "boolean", "int", "long", "float", "double", "string"]] +] = _EnumLoader( ( "null", "boolean", @@ -29300,17 +29285,33 @@ def __init__( double: double precision (64-bit) IEEE 754 floating-point number string: Unicode character sequence """ -AnyLoader: Final = _EnumLoader(("Any",), "Any") +AnyLoader: Final[_Loader[Literal["Any"]]] = _EnumLoader(("Any",), "Any") """ The **Any** type validates for any non-null value. """ -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( +RecordFieldLoader: Final[_Loader[RecordField]] = _RecordLoader(RecordField, None, None) +RecordSchemaLoader: Final[_Loader[RecordSchema]] = _RecordLoader( + RecordSchema, None, None +) +EnumSchemaLoader: Final[_Loader[EnumSchema]] = _RecordLoader(EnumSchema, None, None) +ArraySchemaLoader: Final[_Loader[ArraySchema]] = _RecordLoader(ArraySchema, None, None) +MapSchemaLoader: Final[_Loader[MapSchema]] = _RecordLoader(MapSchema, None, None) +UnionSchemaLoader: Final[_Loader[UnionSchema]] = _RecordLoader(UnionSchema, None, None) +CWLTypeLoader: Final[ + _Loader[ + Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + ] +] = _EnumLoader( ( "null", "boolean", @@ -29329,65 +29330,116 @@ def __init__( File: A File object Directory: A Directory object """ -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, +CWLArraySchemaLoader: Final[_Loader[CWLArraySchema]] = _RecordLoader( + CWLArraySchema, None, None +) +CWLRecordFieldLoader: Final[_Loader[CWLRecordField]] = _RecordLoader( + CWLRecordField, None, None +) +CWLRecordSchemaLoader: Final[_Loader[CWLRecordSchema]] = _RecordLoader( + CWLRecordSchema, None, None +) +FileLoader: Final[_Loader[File]] = _RecordLoader(File, None, None) +DirectoryLoader: Final[_Loader[Directory]] = _RecordLoader(Directory, None, None) +CWLObjectTypeLoader: Final[_UnionLoader[Any]] = _UnionLoader((), "CWLObjectTypeLoader") +union_of_None_type_or_CWLObjectTypeLoader: Final[_Loader[CWLObjectType | None]] = ( + _UnionLoader( + ( + None_type, + CWLObjectTypeLoader, + ) ) ) -array_of_union_of_None_type_or_CWLObjectTypeLoader: Final = _ArrayLoader( - union_of_None_type_or_CWLObjectTypeLoader +array_of_union_of_None_type_or_CWLObjectTypeLoader: Final[ + _Loader[Sequence[CWLObjectType | None]] +] = _ArrayLoader(union_of_None_type_or_CWLObjectTypeLoader) +map_of_union_of_None_type_or_CWLObjectTypeLoader: Final[ + _Loader[Mapping[str, CWLObjectType | None]] +] = _MapLoader(union_of_None_type_or_CWLObjectTypeLoader, "None", None, None) +InlineJavascriptRequirementLoader: Final[_Loader[InlineJavascriptRequirement]] = ( + _RecordLoader(InlineJavascriptRequirement, None, None) ) -map_of_union_of_None_type_or_CWLObjectTypeLoader: Final = _MapLoader( - union_of_None_type_or_CWLObjectTypeLoader, "None", None, None +SchemaDefRequirementLoader: Final[_Loader[SchemaDefRequirement]] = _RecordLoader( + SchemaDefRequirement, None, None ) -InlineJavascriptRequirementLoader: Final = _RecordLoader( - InlineJavascriptRequirement, None, None +LoadListingRequirementLoader: Final[_Loader[LoadListingRequirement]] = _RecordLoader( + LoadListingRequirement, None, None ) -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 +DockerRequirementLoader: Final[_Loader[DockerRequirement]] = _RecordLoader( + DockerRequirement, None, None ) -EnvVarRequirementLoader: Final = _RecordLoader(EnvVarRequirement, None, None) -ShellCommandRequirementLoader: Final = _RecordLoader( +SoftwareRequirementLoader: Final[_Loader[SoftwareRequirement]] = _RecordLoader( + SoftwareRequirement, None, None +) +InitialWorkDirRequirementLoader: Final[_Loader[InitialWorkDirRequirement]] = ( + _RecordLoader(InitialWorkDirRequirement, None, None) +) +EnvVarRequirementLoader: Final[_Loader[EnvVarRequirement]] = _RecordLoader( + EnvVarRequirement, None, None +) +ShellCommandRequirementLoader: Final[_Loader[ShellCommandRequirement]] = _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 +ResourceRequirementLoader: Final[_Loader[ResourceRequirement]] = _RecordLoader( + ResourceRequirement, None, None ) -ToolTimeLimitLoader: Final = _RecordLoader(ToolTimeLimit, None, None) -SubworkflowFeatureRequirementLoader: Final = _RecordLoader( - SubworkflowFeatureRequirement, None, None +WorkReuseLoader: Final[_Loader[WorkReuse]] = _RecordLoader(WorkReuse, None, None) +NetworkAccessLoader: Final[_Loader[NetworkAccess]] = _RecordLoader( + NetworkAccess, None, None ) -ScatterFeatureRequirementLoader: Final = _RecordLoader( - ScatterFeatureRequirement, None, None +InplaceUpdateRequirementLoader: Final[_Loader[InplaceUpdateRequirement]] = ( + _RecordLoader(InplaceUpdateRequirement, None, None) ) -MultipleInputFeatureRequirementLoader: Final = _RecordLoader( - MultipleInputFeatureRequirement, None, None +ToolTimeLimitLoader: Final[_Loader[ToolTimeLimit]] = _RecordLoader( + ToolTimeLimit, None, None ) -StepInputExpressionRequirementLoader: Final = _RecordLoader( - StepInputExpressionRequirement, None, None +SubworkflowFeatureRequirementLoader: Final[_Loader[SubworkflowFeatureRequirement]] = ( + _RecordLoader(SubworkflowFeatureRequirement, None, None) ) -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( +ScatterFeatureRequirementLoader: Final[_Loader[ScatterFeatureRequirement]] = ( + _RecordLoader(ScatterFeatureRequirement, None, None) +) +MultipleInputFeatureRequirementLoader: Final[ + _Loader[MultipleInputFeatureRequirement] +] = _RecordLoader(MultipleInputFeatureRequirement, None, None) +StepInputExpressionRequirementLoader: Final[_Loader[StepInputExpressionRequirement]] = ( + _RecordLoader(StepInputExpressionRequirement, None, None) +) +SecretsLoader: Final[_Loader[Secrets]] = _RecordLoader(Secrets, None, None) +MPIRequirementLoader: Final[_Loader[MPIRequirement]] = _RecordLoader( + MPIRequirement, None, None +) +CUDARequirementLoader: Final[_Loader[CUDARequirement]] = _RecordLoader( + CUDARequirement, None, None +) +LoopLoader: Final[_Loader[Loop]] = _RecordLoader(Loop, None, None) +ShmSizeLoader: Final[_Loader[ShmSize]] = _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[ + _Loader[ + CUDARequirement + | DockerRequirement + | EnvVarRequirement + | InitialWorkDirRequirement + | InlineJavascriptRequirement + | InplaceUpdateRequirement + | LoadListingRequirement + | Loop + | MPIRequirement + | MultipleInputFeatureRequirement + | NetworkAccess + | ResourceRequirement + | ScatterFeatureRequirement + | SchemaDefRequirement + | Secrets + | ShellCommandRequirement + | ShmSize + | SoftwareRequirement + | StepInputExpressionRequirement + | SubworkflowFeatureRequirement + | ToolTimeLimit + | WorkReuse + ] +] = _UnionLoader( ( InlineJavascriptRequirementLoader, SchemaDefRequirementLoader, @@ -29413,36 +29465,150 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + Sequence[ + CUDARequirement + | DockerRequirement + | EnvVarRequirement + | InitialWorkDirRequirement + | InlineJavascriptRequirement + | InplaceUpdateRequirement + | LoadListingRequirement + | Loop + | MPIRequirement + | MultipleInputFeatureRequirement + | NetworkAccess + | ResourceRequirement + | ScatterFeatureRequirement + | SchemaDefRequirement + | Secrets + | ShellCommandRequirement + | ShmSize + | SoftwareRequirement + | StepInputExpressionRequirement + | SubworkflowFeatureRequirement + | ToolTimeLimit + | WorkReuse + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + CWLObjectType + | None + | Sequence[ + CUDARequirement + | DockerRequirement + | EnvVarRequirement + | InitialWorkDirRequirement + | InlineJavascriptRequirement + | InplaceUpdateRequirement + | LoadListingRequirement + | Loop + | MPIRequirement + | MultipleInputFeatureRequirement + | NetworkAccess + | ResourceRequirement + | ScatterFeatureRequirement + | SchemaDefRequirement + | Secrets + | ShellCommandRequirement + | ShmSize + | SoftwareRequirement + | StepInputExpressionRequirement + | SubworkflowFeatureRequirement + | ToolTimeLimit + | WorkReuse + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + Mapping[ + str, + CWLObjectType + | None + | Sequence[ + CUDARequirement + | DockerRequirement + | EnvVarRequirement + | InitialWorkDirRequirement + | InlineJavascriptRequirement + | InplaceUpdateRequirement + | LoadListingRequirement + | Loop + | MPIRequirement + | MultipleInputFeatureRequirement + | NetworkAccess + | ResourceRequirement + | ScatterFeatureRequirement + | SchemaDefRequirement + | Secrets + | ShellCommandRequirement + | ShmSize + | SoftwareRequirement + | StepInputExpressionRequirement + | SubworkflowFeatureRequirement + | ToolTimeLimit + | WorkReuse + ], + ] + ] +] = _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: 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") +CWLInputFileLoader: Final[ + _Loader[ + Mapping[ + str, + CWLObjectType + | None + | Sequence[ + CUDARequirement + | DockerRequirement + | EnvVarRequirement + | InitialWorkDirRequirement + | InlineJavascriptRequirement + | InplaceUpdateRequirement + | LoadListingRequirement + | Loop + | MPIRequirement + | MultipleInputFeatureRequirement + | NetworkAccess + | ResourceRequirement + | ScatterFeatureRequirement + | SchemaDefRequirement + | Secrets + | ShellCommandRequirement + | ShmSize + | SoftwareRequirement + | StepInputExpressionRequirement + | SubworkflowFeatureRequirement + | ToolTimeLimit + | WorkReuse + ], + ] + ] +] = 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[_Loader[Literal["v1.2"]]] = _EnumLoader(("v1.2",), "CWLVersion") """ Current version symbol for CWL documents. """ -LoadListingEnumLoader: Final = _EnumLoader( +LoadListingEnumLoader: Final[ + _Loader[Literal["no_listing", "shallow_listing", "deep_listing"]] +] = _EnumLoader( ( "no_listing", "shallow_listing", @@ -29458,45 +29624,77 @@ def __init__( 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: 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( +ExpressionLoader = _ExpressionLoader(str) +InputBindingLoader: Final[_Loader[InputBinding]] = _RecordLoader( + InputBinding, None, None +) +InputRecordFieldLoader: Final[_Loader[InputRecordField]] = _RecordLoader( + InputRecordField, None, None +) +InputRecordSchemaLoader: Final[_Loader[InputRecordSchema]] = _RecordLoader( + InputRecordSchema, None, None +) +InputEnumSchemaLoader: Final[_Loader[InputEnumSchema]] = _RecordLoader( + InputEnumSchema, None, None +) +InputArraySchemaLoader: Final[_Loader[InputArraySchema]] = _RecordLoader( + InputArraySchema, None, None +) +OutputRecordFieldLoader: Final[_Loader[OutputRecordField]] = _RecordLoader( + OutputRecordField, None, None +) +OutputRecordSchemaLoader: Final[_Loader[OutputRecordSchema]] = _RecordLoader( + OutputRecordSchema, None, None +) +OutputEnumSchemaLoader: Final[_Loader[OutputEnumSchema]] = _RecordLoader( + OutputEnumSchema, None, None +) +OutputArraySchemaLoader: Final[_Loader[OutputArraySchema]] = _RecordLoader( + OutputArraySchema, None, None +) +SecondaryFileSchemaLoader: Final[_Loader[SecondaryFileSchema]] = _RecordLoader( + SecondaryFileSchema, None, None +) +EnvironmentDefLoader: Final[_Loader[EnvironmentDef]] = _RecordLoader( + EnvironmentDef, None, None +) +CommandLineBindingLoader: Final[_Loader[CommandLineBinding]] = _RecordLoader( + CommandLineBinding, None, None +) +CommandOutputBindingLoader: Final[_Loader[CommandOutputBinding]] = _RecordLoader( + CommandOutputBinding, None, None +) +CommandInputRecordFieldLoader: Final[_Loader[CommandInputRecordField]] = _RecordLoader( CommandInputRecordField, None, None ) -CommandInputRecordSchemaLoader: Final = _RecordLoader( - CommandInputRecordSchema, None, None +CommandInputRecordSchemaLoader: Final[_Loader[CommandInputRecordSchema]] = ( + _RecordLoader(CommandInputRecordSchema, None, None) +) +CommandInputEnumSchemaLoader: Final[_Loader[CommandInputEnumSchema]] = _RecordLoader( + CommandInputEnumSchema, None, None ) -CommandInputEnumSchemaLoader: Final = _RecordLoader(CommandInputEnumSchema, None, None) -CommandInputArraySchemaLoader: Final = _RecordLoader( +CommandInputArraySchemaLoader: Final[_Loader[CommandInputArraySchema]] = _RecordLoader( CommandInputArraySchema, None, None ) -CommandOutputRecordFieldLoader: Final = _RecordLoader( - CommandOutputRecordField, None, None +CommandOutputRecordFieldLoader: Final[_Loader[CommandOutputRecordField]] = ( + _RecordLoader(CommandOutputRecordField, None, None) ) -CommandOutputRecordSchemaLoader: Final = _RecordLoader( - CommandOutputRecordSchema, None, None +CommandOutputRecordSchemaLoader: Final[_Loader[CommandOutputRecordSchema]] = ( + _RecordLoader(CommandOutputRecordSchema, None, None) ) -CommandOutputEnumSchemaLoader: Final = _RecordLoader( +CommandOutputEnumSchemaLoader: Final[_Loader[CommandOutputEnumSchema]] = _RecordLoader( CommandOutputEnumSchema, None, None ) -CommandOutputArraySchemaLoader: Final = _RecordLoader( - CommandOutputArraySchema, None, None +CommandOutputArraySchemaLoader: Final[_Loader[CommandOutputArraySchema]] = ( + _RecordLoader(CommandOutputArraySchema, None, None) +) +CommandInputParameterLoader: Final[_Loader[CommandInputParameter]] = _RecordLoader( + CommandInputParameter, None, None ) -CommandInputParameterLoader: Final = _RecordLoader(CommandInputParameter, None, None) -CommandOutputParameterLoader: Final = _RecordLoader(CommandOutputParameter, None, None) -stdinLoader: Final = _EnumLoader(("stdin",), "stdin") +CommandOutputParameterLoader: Final[_Loader[CommandOutputParameter]] = _RecordLoader( + CommandOutputParameter, None, None +) +stdinLoader: Final[_Loader[Literal["stdin"]]] = _EnumLoader(("stdin",), "stdin") """ Only valid as a `type` for a `CommandLineTool` input with no `inputBinding` set. `stdin` must not be specified at the `CommandLineTool` @@ -29518,7 +29716,7 @@ def __init__( stdin: $(inputs.an_input_name.path) ``` """ -stdoutLoader: Final = _EnumLoader(("stdout",), "stdout") +stdoutLoader: Final[_Loader[Literal["stdout"]]] = _EnumLoader(("stdout",), "stdout") """ Only valid as a `type` for a `CommandLineTool` output with no `outputBinding` set. @@ -29566,7 +29764,7 @@ def __init__( (e.g. `echo a && echo b`) `stdout` must include the output of every command. """ -stderrLoader: Final = _EnumLoader(("stderr",), "stderr") +stderrLoader: Final[_Loader[Literal["stderr"]]] = _EnumLoader(("stderr",), "stderr") """ Only valid as a `type` for a `CommandLineTool` output with no `outputBinding` set. @@ -29610,25 +29808,37 @@ def __init__( stderr: random_stderr_filenameABCDEFG ``` """ -CommandLineToolLoader: Final = _RecordLoader(CommandLineTool, None, None) -SoftwarePackageLoader: Final = _RecordLoader(SoftwarePackage, None, None) -DirentLoader: Final = _RecordLoader(Dirent, None, None) -ExpressionToolOutputParameterLoader: Final = _RecordLoader( - ExpressionToolOutputParameter, None, None +CommandLineToolLoader: Final[_Loader[CommandLineTool]] = _RecordLoader( + CommandLineTool, None, None ) -WorkflowInputParameterLoader: Final = _RecordLoader(WorkflowInputParameter, None, None) -ExpressionToolLoader: Final = _RecordLoader(ExpressionTool, None, None) -LinkMergeMethodLoader: Final = _EnumLoader( - ( - "merge_nested", - "merge_flattened", - ), - "LinkMergeMethod", +SoftwarePackageLoader: Final[_Loader[SoftwarePackage]] = _RecordLoader( + SoftwarePackage, None, None +) +DirentLoader: Final[_Loader[Dirent]] = _RecordLoader(Dirent, None, None) +ExpressionToolOutputParameterLoader: Final[_Loader[ExpressionToolOutputParameter]] = ( + _RecordLoader(ExpressionToolOutputParameter, None, None) +) +WorkflowInputParameterLoader: Final[_Loader[WorkflowInputParameter]] = _RecordLoader( + WorkflowInputParameter, None, None +) +ExpressionToolLoader: Final[_Loader[ExpressionTool]] = _RecordLoader( + ExpressionTool, None, None +) +LinkMergeMethodLoader: Final[_Loader[Literal["merge_nested", "merge_flattened"]]] = ( + _EnumLoader( + ( + "merge_nested", + "merge_flattened", + ), + "LinkMergeMethod", + ) ) """ The input link merge method, described in [WorkflowStepInput](#WorkflowStepInput). """ -PickValueMethodLoader: Final = _EnumLoader( +PickValueMethodLoader: Final[ + _Loader[Literal["first_non_null", "the_only_non_null", "all_non_null"]] +] = _EnumLoader( ( "first_non_null", "the_only_non_null", @@ -29639,12 +29849,18 @@ def __init__( """ Picking non-null values among inbound data links, described in [WorkflowStepInput](#WorkflowStepInput). """ -WorkflowOutputParameterLoader: Final = _RecordLoader( +WorkflowOutputParameterLoader: Final[_Loader[WorkflowOutputParameter]] = _RecordLoader( WorkflowOutputParameter, None, None ) -WorkflowStepInputLoader: Final = _RecordLoader(WorkflowStepInput, None, None) -WorkflowStepOutputLoader: Final = _RecordLoader(WorkflowStepOutput, None, None) -ScatterMethodLoader: Final = _EnumLoader( +WorkflowStepInputLoader: Final[_Loader[WorkflowStepInput]] = _RecordLoader( + WorkflowStepInput, None, None +) +WorkflowStepOutputLoader: Final[_Loader[WorkflowStepOutput]] = _RecordLoader( + WorkflowStepOutput, None, None +) +ScatterMethodLoader: Final[ + _Loader[Literal["dotproduct", "nested_crossproduct", "flat_crossproduct"]] +] = _EnumLoader( ( "dotproduct", "nested_crossproduct", @@ -29655,29 +29871,45 @@ def __init__( """ The scatter method, as described in [workflow step scatter](#WorkflowStep). """ -WorkflowStepLoader: Final = _RecordLoader(WorkflowStep, None, None) -WorkflowLoader: Final = _RecordLoader(Workflow, None, None) -OperationInputParameterLoader: Final = _RecordLoader( +WorkflowStepLoader: Final[_Loader[WorkflowStep]] = _RecordLoader( + WorkflowStep, None, None +) +WorkflowLoader: Final[_Loader[Workflow]] = _RecordLoader(Workflow, None, None) +OperationInputParameterLoader: Final[_Loader[OperationInputParameter]] = _RecordLoader( OperationInputParameter, None, None ) -OperationOutputParameterLoader: Final = _RecordLoader( - OperationOutputParameter, None, None +OperationOutputParameterLoader: Final[_Loader[OperationOutputParameter]] = ( + _RecordLoader(OperationOutputParameter, None, None) +) +OperationLoader: Final[_Loader[Operation]] = _RecordLoader(Operation, None, None) +ProcessGeneratorLoader: Final[_Loader[ProcessGenerator]] = _RecordLoader( + ProcessGenerator, 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( +LoopInputLoader: Final[_Loader[LoopInput]] = _RecordLoader(LoopInput, None, None) +array_of_strtype: Final[_Loader[Sequence[str]]] = _ArrayLoader(strtype) +union_of_None_type_or_strtype_or_array_of_strtype: Final[ + _Loader[None | Sequence[str] | str] +] = _UnionLoader( ( None_type, strtype, array_of_strtype, ) ) -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( +uri_strtype_True_False_None_None: Final[_Loader[str]] = _URILoader( + strtype, True, False, None, None +) +union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype: Final[ + _Loader[ + ArraySchema + | EnumSchema + | Literal["null", "boolean", "int", "long", "float", "double", "string"] + | MapSchema + | RecordSchema + | UnionSchema + | str + ] +] = _UnionLoader( ( PrimitiveTypeLoader, RecordSchemaLoader, @@ -29688,14 +29920,41 @@ def __init__( strtype, ) ) -array_of_union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype: ( - Final -) = _ArrayLoader( +array_of_union_of_PrimitiveTypeLoader_or_RecordSchemaLoader_or_EnumSchemaLoader_or_ArraySchemaLoader_or_MapSchemaLoader_or_UnionSchemaLoader_or_strtype: Final[ + _Loader[ + Sequence[ + ArraySchema + | EnumSchema + | Literal["null", "boolean", "int", "long", "float", "double", "string"] + | MapSchema + | RecordSchema + | UnionSchema + | str + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _UnionLoader( ( PrimitiveTypeLoader, RecordSchemaLoader, @@ -29707,57 +29966,117 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: Final = _ArrayLoader(RecordFieldLoader) -union_of_None_type_or_array_of_RecordFieldLoader: Final = _UnionLoader( +array_of_RecordFieldLoader: Final[_Loader[Sequence[RecordField]]] = _ArrayLoader( + RecordFieldLoader +) +union_of_None_type_or_array_of_RecordFieldLoader: Final[ + _Loader[None | Sequence[RecordField]] +] = _UnionLoader( ( None_type, array_of_RecordFieldLoader, ) ) -idmap_fields_union_of_None_type_or_array_of_RecordFieldLoader: Final = _IdMapLoader( - union_of_None_type_or_array_of_RecordFieldLoader, "name", "type" +idmap_fields_union_of_None_type_or_array_of_RecordFieldLoader: Final[ + _Loader[None | Sequence[RecordField]] +] = _IdMapLoader(union_of_None_type_or_array_of_RecordFieldLoader, "name", "type") +Record_nameLoader: Final[_Loader[Literal["record"]]] = _EnumLoader( + ("record",), "Record_name" +) +typedsl_Record_nameLoader_2: Final[_Loader[Literal["record"]]] = _TypeDSLLoader( + Record_nameLoader, 2, "v1.1" ) -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( +union_of_None_type_or_strtype: Final[_Loader[None | str]] = _UnionLoader( ( None_type, strtype, ) ) -uri_union_of_None_type_or_strtype_True_False_None_None: Final = _URILoader( - union_of_None_type_or_strtype, True, False, None, None +uri_union_of_None_type_or_strtype_True_False_None_None: Final[_Loader[None | str]] = ( + _URILoader(union_of_None_type_or_strtype, True, False, None, None) ) -uri_array_of_strtype_True_False_None_None: Final = _URILoader( +uri_array_of_strtype_True_False_None_None: Final[_Loader[Sequence[str]]] = _URILoader( array_of_strtype, True, False, None, None ) -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( +Enum_nameLoader: Final[_Loader[Literal["enum"]]] = _EnumLoader(("enum",), "Enum_name") +typedsl_Enum_nameLoader_2: Final[_Loader[Literal["enum"]]] = _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[ + _Loader[ + 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 + ] +] = _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: 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( +Array_nameLoader: Final[_Loader[Literal["array"]]] = _EnumLoader( + ("array",), "Array_name" +) +typedsl_Array_nameLoader_2: Final[_Loader[Literal["array"]]] = _TypeDSLLoader( + Array_nameLoader, 2, "v1.1" +) +Map_nameLoader: Final[_Loader[Literal["map"]]] = _EnumLoader(("map",), "Map_name") +typedsl_Map_nameLoader_2: Final[_Loader[Literal["map"]]] = _TypeDSLLoader( + Map_nameLoader, 2, "v1.1" +) +Union_nameLoader: Final[_Loader[Literal["union"]]] = _EnumLoader( + ("union",), "Union_name" +) +typedsl_Union_nameLoader_2: Final[_Loader[Literal["union"]]] = _TypeDSLLoader( + Union_nameLoader, 2, "v1.1" +) +union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype: Final[ + _Loader[ + CWLArraySchema + | CWLRecordSchema + | EnumSchema + | Literal["null", "boolean", "int", "long", "float", "double", "string"] + | str + ] +] = _UnionLoader( ( PrimitiveTypeLoader, CWLRecordSchemaLoader, @@ -29766,14 +30085,35 @@ def __init__( strtype, ) ) -array_of_union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype: ( - Final -) = _ArrayLoader( +array_of_union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype: Final[ + _Loader[ + Sequence[ + CWLArraySchema + | CWLRecordSchema + | EnumSchema + | Literal["null", "boolean", "int", "long", "float", "double", "string"] + | str + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _UnionLoader( ( PrimitiveTypeLoader, CWLRecordSchemaLoader, @@ -29783,66 +30123,96 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: Final = _ArrayLoader(CWLRecordFieldLoader) -union_of_None_type_or_array_of_CWLRecordFieldLoader: Final = _UnionLoader( +array_of_CWLRecordFieldLoader: Final[_Loader[Sequence[CWLRecordField]]] = _ArrayLoader( + CWLRecordFieldLoader +) +union_of_None_type_or_array_of_CWLRecordFieldLoader: Final[ + _Loader[None | Sequence[CWLRecordField]] +] = _UnionLoader( ( None_type, array_of_CWLRecordFieldLoader, ) ) -idmap_fields_union_of_None_type_or_array_of_CWLRecordFieldLoader: Final = _IdMapLoader( - union_of_None_type_or_array_of_CWLRecordFieldLoader, "name", "type" -) -File_classLoader: Final = _EnumLoader(("File",), "File_class") -uri_File_classLoader_False_True_None_None: Final = _URILoader( +idmap_fields_union_of_None_type_or_array_of_CWLRecordFieldLoader: Final[ + _Loader[None | Sequence[CWLRecordField]] +] = _IdMapLoader(union_of_None_type_or_array_of_CWLRecordFieldLoader, "name", "type") +File_classLoader: Final[_Loader[Literal["File"]]] = _EnumLoader(("File",), "File_class") +uri_File_classLoader_False_True_None_None: Final[_Loader[Literal["File"]]] = _URILoader( File_classLoader, False, True, None, None ) -uri_union_of_None_type_or_strtype_False_False_None_None: Final = _URILoader( - union_of_None_type_or_strtype, False, False, None, None +uri_union_of_None_type_or_strtype_False_False_None_None: Final[_Loader[None | str]] = ( + _URILoader(union_of_None_type_or_strtype, False, False, None, None) ) -union_of_None_type_or_inttype_or_inttype: Final = _UnionLoader( +union_of_None_type_or_inttype_or_inttype: Final[_Loader[None | i32]] = _UnionLoader( ( None_type, inttype, inttype, ) ) -union_of_FileLoader_or_DirectoryLoader: Final = _UnionLoader( +union_of_FileLoader_or_DirectoryLoader: Final[_Loader[Directory | File]] = _UnionLoader( ( FileLoader, DirectoryLoader, ) ) -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: Final = ( - _UnionLoader( - ( - None_type, - array_of_union_of_FileLoader_or_DirectoryLoader, - ) +array_of_union_of_FileLoader_or_DirectoryLoader: Final[ + _Loader[Sequence[Directory | File]] +] = _ArrayLoader(union_of_FileLoader_or_DirectoryLoader) +union_of_None_type_or_array_of_union_of_FileLoader_or_DirectoryLoader: Final[ + _Loader[None | Sequence[Directory | File]] +] = _UnionLoader( + ( + None_type, + array_of_union_of_FileLoader_or_DirectoryLoader, ) ) -secondaryfilesdsl_union_of_None_type_or_array_of_union_of_FileLoader_or_DirectoryLoader: ( - Final -) = _UnionLoader( +secondaryfilesdsl_union_of_None_type_or_array_of_union_of_FileLoader_or_DirectoryLoader: Final[ + _Loader[None | Sequence[Directory | File]] +] = _UnionLoader( ( _SecondaryDSLLoader( union_of_None_type_or_array_of_union_of_FileLoader_or_DirectoryLoader @@ -29850,28 +30220,34 @@ def __init__( union_of_None_type_or_array_of_union_of_FileLoader_or_DirectoryLoader, ) ) -uri_union_of_None_type_or_strtype_True_False_None_True: Final = _URILoader( - union_of_None_type_or_strtype, True, False, None, True +uri_union_of_None_type_or_strtype_True_False_None_True: Final[_Loader[None | str]] = ( + _URILoader(union_of_None_type_or_strtype, True, False, None, True) ) -Directory_classLoader: Final = _EnumLoader(("Directory",), "Directory_class") -uri_Directory_classLoader_False_True_None_None: Final = _URILoader( - Directory_classLoader, False, True, None, None +Directory_classLoader: Final[_Loader[Literal["Directory"]]] = _EnumLoader( + ("Directory",), "Directory_class" ) -union_of_None_type_or_booltype: Final = _UnionLoader( +uri_Directory_classLoader_False_True_None_None: Final[_Loader[Literal["Directory"]]] = ( + _URILoader(Directory_classLoader, False, True, None, None) +) +union_of_None_type_or_booltype: Final[_Loader[None | bool]] = _UnionLoader( ( None_type, booltype, ) ) -union_of_None_type_or_LoadListingEnumLoader: Final = _UnionLoader( +union_of_None_type_or_LoadListingEnumLoader: Final[ + _Loader[Literal["no_listing", "shallow_listing", "deep_listing"] | None] +] = _UnionLoader( ( None_type, LoadListingEnumLoader, ) ) -array_of_SecondaryFileSchemaLoader: Final = _ArrayLoader(SecondaryFileSchemaLoader) +array_of_SecondaryFileSchemaLoader: Final[_Loader[Sequence[SecondaryFileSchema]]] = ( + _ArrayLoader(SecondaryFileSchemaLoader) +) union_of_None_type_or_SecondaryFileSchemaLoader_or_array_of_SecondaryFileSchemaLoader: ( - Final + Final[_Loader[None | SecondaryFileSchema | Sequence[SecondaryFileSchema]]] ) = _UnionLoader( ( None_type, @@ -29879,9 +30255,9 @@ def __init__( array_of_SecondaryFileSchemaLoader, ) ) -secondaryfilesdsl_union_of_None_type_or_SecondaryFileSchemaLoader_or_array_of_SecondaryFileSchemaLoader: ( - Final -) = _UnionLoader( +secondaryfilesdsl_union_of_None_type_or_SecondaryFileSchemaLoader_or_array_of_SecondaryFileSchemaLoader: Final[ + _Loader[None | SecondaryFileSchema | Sequence[SecondaryFileSchema]] +] = _UnionLoader( ( _SecondaryDSLLoader( union_of_None_type_or_SecondaryFileSchemaLoader_or_array_of_SecondaryFileSchemaLoader @@ -29889,40 +30265,58 @@ def __init__( union_of_None_type_or_SecondaryFileSchemaLoader_or_array_of_SecondaryFileSchemaLoader, ) ) -union_of_None_type_or_strtype_or_array_of_strtype_or_ExpressionLoader: Final = ( - _UnionLoader( - ( - None_type, - strtype, - array_of_strtype, - ExpressionLoader, - ) +union_of_None_type_or_strtype_or_array_of_strtype_or_ExpressionLoader: Final[ + _Loader[None | Sequence[str] | str] +] = _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: ( - Final -) = _URILoader( +uri_union_of_None_type_or_strtype_or_array_of_strtype_or_ExpressionLoader_True_False_None_True: Final[ + _Loader[None | Sequence[str] | str] +] = _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: Final = _UnionLoader( - ( - None_type, - strtype, - ExpressionLoader, +union_of_None_type_or_strtype_or_ExpressionLoader: Final[_Loader[None | str]] = ( + _UnionLoader( + ( + None_type, + strtype, + ExpressionLoader, + ) ) ) -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 - ) +uri_union_of_None_type_or_strtype_or_ExpressionLoader_True_False_None_True: Final[ + _Loader[None | str] +] = _URILoader( + union_of_None_type_or_strtype_or_ExpressionLoader, True, False, None, True ) -union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype: ( - Final -) = _UnionLoader( +union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype: Final[ + _Loader[ + InputArraySchema + | InputEnumSchema + | InputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | str + ] +] = _UnionLoader( ( CWLTypeLoader, InputRecordSchemaLoader, @@ -29931,14 +30325,65 @@ def __init__( strtype, ) ) -array_of_union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype: ( - Final -) = _ArrayLoader( +array_of_union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype: Final[ + _Loader[ + Sequence[ + InputArraySchema + | InputEnumSchema + | InputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | str + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _UnionLoader( ( CWLTypeLoader, InputRecordSchemaLoader, @@ -29948,35 +30393,121 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: Final = _ArrayLoader(InputRecordFieldLoader) -union_of_None_type_or_array_of_InputRecordFieldLoader: Final = _UnionLoader( +array_of_InputRecordFieldLoader: Final[_Loader[Sequence[InputRecordField]]] = ( + _ArrayLoader(InputRecordFieldLoader) +) +union_of_None_type_or_array_of_InputRecordFieldLoader: Final[ + _Loader[None | Sequence[InputRecordField]] +] = _UnionLoader( ( None_type, array_of_InputRecordFieldLoader, ) ) -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: ( - Final -) = _URILoader( +idmap_fields_union_of_None_type_or_array_of_InputRecordFieldLoader: Final[ + _Loader[None | Sequence[InputRecordField]] +] = _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: Final[ + _Loader[ + 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 + ] +] = _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: ( - Final -) = _UnionLoader( +union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype: Final[ + _Loader[ + Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | OutputArraySchema + | OutputEnumSchema + | OutputRecordSchema + | str + ] +] = _UnionLoader( ( CWLTypeLoader, OutputRecordSchemaLoader, @@ -29985,14 +30516,65 @@ def __init__( strtype, ) ) -array_of_union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype: ( - Final -) = _ArrayLoader( +array_of_union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype: Final[ + _Loader[ + Sequence[ + Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | OutputArraySchema + | OutputEnumSchema + | OutputRecordSchema + | str + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _UnionLoader( ( CWLTypeLoader, OutputRecordSchemaLoader, @@ -30002,56 +30584,139 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: Final = _ArrayLoader(OutputRecordFieldLoader) -union_of_None_type_or_array_of_OutputRecordFieldLoader: Final = _UnionLoader( +array_of_OutputRecordFieldLoader: Final[_Loader[Sequence[OutputRecordField]]] = ( + _ArrayLoader(OutputRecordFieldLoader) +) +union_of_None_type_or_array_of_OutputRecordFieldLoader: Final[ + _Loader[None | Sequence[OutputRecordField]] +] = _UnionLoader( ( None_type, array_of_OutputRecordFieldLoader, ) ) -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: ( - Final -) = _URILoader( +idmap_fields_union_of_None_type_or_array_of_OutputRecordFieldLoader: Final[ + _Loader[None | Sequence[OutputRecordField]] +] = _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: Final[ + _Loader[ + 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 + ] +] = _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: ( - Final -) = _UnionLoader( +union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader_or_OperationInputParameterLoader: Final[ + _Loader[CommandInputParameter | OperationInputParameter | WorkflowInputParameter] +] = _UnionLoader( ( CommandInputParameterLoader, WorkflowInputParameterLoader, OperationInputParameterLoader, ) ) -array_of_union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader_or_OperationInputParameterLoader: ( - Final -) = _ArrayLoader( +array_of_union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader_or_OperationInputParameterLoader: Final[ + _Loader[ + Sequence[ + CommandInputParameter | OperationInputParameter | WorkflowInputParameter + ] + ] +] = _ArrayLoader( union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader_or_OperationInputParameterLoader ) -idmap_inputs_array_of_union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader_or_OperationInputParameterLoader: ( - Final -) = _IdMapLoader( +idmap_inputs_array_of_union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader_or_OperationInputParameterLoader: Final[ + _Loader[ + Sequence[ + CommandInputParameter | OperationInputParameter | WorkflowInputParameter + ] + ] +] = _IdMapLoader( array_of_union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader_or_OperationInputParameterLoader, "id", "type", ) -union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader_or_OperationOutputParameterLoader: ( - Final -) = _UnionLoader( +union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader_or_OperationOutputParameterLoader: Final[ + _Loader[ + CommandOutputParameter + | ExpressionToolOutputParameter + | OperationOutputParameter + | WorkflowOutputParameter + ] +] = _UnionLoader( ( CommandOutputParameterLoader, ExpressionToolOutputParameterLoader, @@ -30059,36 +30724,126 @@ def __init__( OperationOutputParameterLoader, ) ) -array_of_union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader_or_OperationOutputParameterLoader: ( - Final -) = _ArrayLoader( +array_of_union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader_or_OperationOutputParameterLoader: Final[ + _Loader[ + Sequence[ + CommandOutputParameter + | ExpressionToolOutputParameter + | OperationOutputParameter + | WorkflowOutputParameter + ] + ] +] = _ArrayLoader( union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader_or_OperationOutputParameterLoader ) -idmap_outputs_array_of_union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader_or_OperationOutputParameterLoader: ( - Final -) = _IdMapLoader( +idmap_outputs_array_of_union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader_or_OperationOutputParameterLoader: Final[ + _Loader[ + Sequence[ + CommandOutputParameter + | ExpressionToolOutputParameter + | OperationOutputParameter + | WorkflowOutputParameter + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + None + | Sequence[ + CUDARequirement + | DockerRequirement + | EnvVarRequirement + | InitialWorkDirRequirement + | InlineJavascriptRequirement + | InplaceUpdateRequirement + | LoadListingRequirement + | Loop + | MPIRequirement + | MultipleInputFeatureRequirement + | NetworkAccess + | ResourceRequirement + | ScatterFeatureRequirement + | SchemaDefRequirement + | Secrets + | ShellCommandRequirement + | ShmSize + | SoftwareRequirement + | StepInputExpressionRequirement + | SubworkflowFeatureRequirement + | ToolTimeLimit + | WorkReuse + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + None + | Sequence[ + CUDARequirement + | DockerRequirement + | EnvVarRequirement + | InitialWorkDirRequirement + | InlineJavascriptRequirement + | InplaceUpdateRequirement + | LoadListingRequirement + | Loop + | MPIRequirement + | MultipleInputFeatureRequirement + | NetworkAccess + | ResourceRequirement + | ScatterFeatureRequirement + | SchemaDefRequirement + | Secrets + | ShellCommandRequirement + | ShmSize + | SoftwareRequirement + | StepInputExpressionRequirement + | SubworkflowFeatureRequirement + | ToolTimeLimit + | WorkReuse + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + Any + | CUDARequirement + | DockerRequirement + | EnvVarRequirement + | InitialWorkDirRequirement + | InlineJavascriptRequirement + | InplaceUpdateRequirement + | LoadListingRequirement + | Loop + | MPIRequirement + | MultipleInputFeatureRequirement + | NetworkAccess + | ResourceRequirement + | ScatterFeatureRequirement + | SchemaDefRequirement + | Secrets + | ShellCommandRequirement + | ShmSize + | SoftwareRequirement + | StepInputExpressionRequirement + | SubworkflowFeatureRequirement + | ToolTimeLimit + | WorkReuse + ] +] = _UnionLoader( ( InlineJavascriptRequirementLoader, SchemaDefRequirementLoader, @@ -30115,121 +30870,231 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + Sequence[ + Any + | CUDARequirement + | DockerRequirement + | EnvVarRequirement + | InitialWorkDirRequirement + | InlineJavascriptRequirement + | InplaceUpdateRequirement + | LoadListingRequirement + | Loop + | MPIRequirement + | MultipleInputFeatureRequirement + | NetworkAccess + | ResourceRequirement + | ScatterFeatureRequirement + | SchemaDefRequirement + | Secrets + | ShellCommandRequirement + | ShmSize + | SoftwareRequirement + | StepInputExpressionRequirement + | SubworkflowFeatureRequirement + | ToolTimeLimit + | WorkReuse + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] + ] +] = _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: Final = _UnionLoader( - ( - None_type, - CWLVersionLoader, +union_of_None_type_or_CWLVersionLoader: Final[_Loader[Literal["v1.2"] | None]] = ( + _UnionLoader( + ( + None_type, + CWLVersionLoader, + ) ) ) -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: Final = _UnionLoader( - ( - None_type, - array_of_strtype, +uri_union_of_None_type_or_CWLVersionLoader_False_True_None_None: Final[ + _Loader[Literal["v1.2"] | None] +] = _URILoader(union_of_None_type_or_CWLVersionLoader, False, True, None, None) +union_of_None_type_or_array_of_strtype: Final[_Loader[None | Sequence[str]]] = ( + _UnionLoader( + ( + None_type, + array_of_strtype, + ) ) ) -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 +uri_union_of_None_type_or_array_of_strtype_True_False_None_None: Final[ + _Loader[None | Sequence[str]] +] = _URILoader(union_of_None_type_or_array_of_strtype, True, False, None, None) +InlineJavascriptRequirement_classLoader: Final[ + _Loader[Literal["InlineJavascriptRequirement"]] +] = _EnumLoader(("InlineJavascriptRequirement",), "InlineJavascriptRequirement_class") +uri_InlineJavascriptRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["InlineJavascriptRequirement"]] +] = _URILoader(InlineJavascriptRequirement_classLoader, False, True, None, None) +SchemaDefRequirement_classLoader: Final[_Loader[Literal["SchemaDefRequirement"]]] = ( + _EnumLoader(("SchemaDefRequirement",), "SchemaDefRequirement_class") ) -InlineJavascriptRequirement_classLoader: Final = _EnumLoader( - ("InlineJavascriptRequirement",), "InlineJavascriptRequirement_class" -) -uri_InlineJavascriptRequirement_classLoader_False_True_None_None: Final = _URILoader( - InlineJavascriptRequirement_classLoader, False, True, None, None -) -SchemaDefRequirement_classLoader: Final = _EnumLoader( - ("SchemaDefRequirement",), "SchemaDefRequirement_class" -) -uri_SchemaDefRequirement_classLoader_False_True_None_None: Final = _URILoader( - SchemaDefRequirement_classLoader, False, True, None, None -) -union_of_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader: ( - Final -) = _UnionLoader( +uri_SchemaDefRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["SchemaDefRequirement"]] +] = _URILoader(SchemaDefRequirement_classLoader, False, True, None, None) +union_of_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader: Final[ + _Loader[CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema] +] = _UnionLoader( ( CommandInputRecordSchemaLoader, CommandInputEnumSchemaLoader, CommandInputArraySchemaLoader, ) ) -array_of_union_of_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader: ( - Final -) = _ArrayLoader( +array_of_union_of_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader: Final[ + _Loader[ + Sequence[ + CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema + ] + ] +] = _ArrayLoader( union_of_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader ) -union_of_strtype_or_ExpressionLoader: Final = _UnionLoader( +union_of_strtype_or_ExpressionLoader: Final[_Loader[str]] = _UnionLoader( ( strtype, ExpressionLoader, ) ) -union_of_None_type_or_booltype_or_ExpressionLoader: Final = _UnionLoader( +union_of_None_type_or_booltype_or_ExpressionLoader: Final[ + _Loader[None | bool | str] +] = _UnionLoader( ( None_type, booltype, ExpressionLoader, ) ) -LoadListingRequirement_classLoader: Final = _EnumLoader( - ("LoadListingRequirement",), "LoadListingRequirement_class" -) -uri_LoadListingRequirement_classLoader_False_True_None_None: Final = _URILoader( - LoadListingRequirement_classLoader, False, True, None, None -) -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: Final = ( +LoadListingRequirement_classLoader: Final[ + _Loader[Literal["LoadListingRequirement"]] +] = _EnumLoader(("LoadListingRequirement",), "LoadListingRequirement_class") +uri_LoadListingRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["LoadListingRequirement"]] +] = _URILoader(LoadListingRequirement_classLoader, False, True, None, None) +union_of_None_type_or_inttype_or_ExpressionLoader: Final[_Loader[None | i32 | str]] = ( _UnionLoader( ( None_type, - strtype, + inttype, ExpressionLoader, - array_of_strtype, ) ) ) -union_of_None_type_or_ExpressionLoader: Final = _UnionLoader( +union_of_None_type_or_strtype_or_ExpressionLoader_or_array_of_strtype: Final[ + _Loader[None | Sequence[str] | str] +] = _UnionLoader( + ( + None_type, + strtype, + ExpressionLoader, + array_of_strtype, + ) +) +union_of_None_type_or_ExpressionLoader: Final[_Loader[None | str]] = _UnionLoader( ( None_type, ExpressionLoader, ) ) -union_of_None_type_or_CommandLineBindingLoader: Final = _UnionLoader( +union_of_None_type_or_CommandLineBindingLoader: Final[ + _Loader[CommandLineBinding | None] +] = _UnionLoader( ( None_type, CommandLineBindingLoader, ) ) -union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype: ( - Final -) = _UnionLoader( +union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype: Final[ + _Loader[ + CommandInputArraySchema + | CommandInputEnumSchema + | CommandInputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | str + ] +] = _UnionLoader( ( CWLTypeLoader, CommandInputRecordSchemaLoader, @@ -30238,14 +31103,65 @@ def __init__( strtype, ) ) -array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype: ( - Final -) = _ArrayLoader( +array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype: Final[ + _Loader[ + Sequence[ + CommandInputArraySchema + | CommandInputEnumSchema + | CommandInputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | str + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _UnionLoader( ( CWLTypeLoader, CommandInputRecordSchemaLoader, @@ -30255,39 +31171,123 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: Final = _ArrayLoader( - CommandInputRecordFieldLoader -) -union_of_None_type_or_array_of_CommandInputRecordFieldLoader: Final = _UnionLoader( +array_of_CommandInputRecordFieldLoader: Final[ + _Loader[Sequence[CommandInputRecordField]] +] = _ArrayLoader(CommandInputRecordFieldLoader) +union_of_None_type_or_array_of_CommandInputRecordFieldLoader: Final[ + _Loader[None | Sequence[CommandInputRecordField]] +] = _UnionLoader( ( None_type, 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" - ) +idmap_fields_union_of_None_type_or_array_of_CommandInputRecordFieldLoader: Final[ + _Loader[None | Sequence[CommandInputRecordField]] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: ( - Final -) = _UnionLoader( +union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype: Final[ + _Loader[ + CommandOutputArraySchema + | CommandOutputEnumSchema + | CommandOutputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | str + ] +] = _UnionLoader( ( CWLTypeLoader, CommandOutputRecordSchemaLoader, @@ -30296,14 +31296,65 @@ def __init__( strtype, ) ) -array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype: ( - Final -) = _ArrayLoader( +array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype: Final[ + _Loader[ + Sequence[ + CommandOutputArraySchema + | CommandOutputEnumSchema + | CommandOutputRecordSchema + | Literal[ + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ] + | str + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _UnionLoader( ( CWLTypeLoader, CommandOutputRecordSchemaLoader, @@ -30313,45 +31364,149 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: Final = _UnionLoader( +union_of_None_type_or_CommandOutputBindingLoader: Final[ + _Loader[CommandOutputBinding | None] +] = _UnionLoader( ( None_type, CommandOutputBindingLoader, ) ) -array_of_CommandOutputRecordFieldLoader: Final = _ArrayLoader( - CommandOutputRecordFieldLoader -) -union_of_None_type_or_array_of_CommandOutputRecordFieldLoader: Final = _UnionLoader( +array_of_CommandOutputRecordFieldLoader: Final[ + _Loader[Sequence[CommandOutputRecordField]] +] = _ArrayLoader(CommandOutputRecordFieldLoader) +union_of_None_type_or_array_of_CommandOutputRecordFieldLoader: Final[ + _Loader[None | Sequence[CommandOutputRecordField]] +] = _UnionLoader( ( None_type, 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" - ) +idmap_fields_union_of_None_type_or_array_of_CommandOutputRecordFieldLoader: Final[ + _Loader[None | Sequence[CommandOutputRecordField]] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _UnionLoader( ( CWLTypeLoader, stdinLoader, @@ -30362,16 +31517,85 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _UnionLoader( ( CWLTypeLoader, stdoutLoader, @@ -30383,82 +31607,125 @@ def __init__( 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: ( - Final -) = _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[ + _Loader[ + 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 + ] +] = _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: Final = _EnumLoader( +CommandLineTool_classLoader: Final[_Loader[Literal["CommandLineTool"]]] = _EnumLoader( ("CommandLineTool",), "CommandLineTool_class" ) -uri_CommandLineTool_classLoader_False_True_None_None: Final = _URILoader( - CommandLineTool_classLoader, False, True, None, None -) -array_of_CommandInputParameterLoader: Final = _ArrayLoader(CommandInputParameterLoader) -idmap_inputs_array_of_CommandInputParameterLoader: Final = _IdMapLoader( - array_of_CommandInputParameterLoader, "id", "type" -) -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: Final = _UnionLoader( +uri_CommandLineTool_classLoader_False_True_None_None: Final[ + _Loader[Literal["CommandLineTool"]] +] = _URILoader(CommandLineTool_classLoader, False, True, None, None) +array_of_CommandInputParameterLoader: Final[ + _Loader[Sequence[CommandInputParameter]] +] = _ArrayLoader(CommandInputParameterLoader) +idmap_inputs_array_of_CommandInputParameterLoader: Final[ + _Loader[Sequence[CommandInputParameter]] +] = _IdMapLoader(array_of_CommandInputParameterLoader, "id", "type") +array_of_CommandOutputParameterLoader: Final[ + _Loader[Sequence[CommandOutputParameter]] +] = _ArrayLoader(CommandOutputParameterLoader) +idmap_outputs_array_of_CommandOutputParameterLoader: Final[ + _Loader[Sequence[CommandOutputParameter]] +] = _IdMapLoader(array_of_CommandOutputParameterLoader, "id", "type") +union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader: Final[ + _Loader[CommandLineBinding | str] +] = _UnionLoader( ( strtype, ExpressionLoader, 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: ( - Final -) = _UnionLoader( +array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader: Final[ + _Loader[Sequence[CommandLineBinding | str]] +] = _ArrayLoader(union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader) +union_of_None_type_or_array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader: Final[ + _Loader[None | Sequence[CommandLineBinding | str]] +] = _UnionLoader( ( None_type, array_of_union_of_strtype_or_ExpressionLoader_or_CommandLineBindingLoader, ) ) -array_of_inttype: Final = _ArrayLoader(inttype) -union_of_None_type_or_array_of_inttype: Final = _UnionLoader( - ( - None_type, - array_of_inttype, +array_of_inttype: Final[_Loader[Sequence[i32]]] = _ArrayLoader(inttype) +union_of_None_type_or_array_of_inttype: Final[_Loader[None | Sequence[i32]]] = ( + _UnionLoader( + ( + None_type, + array_of_inttype, + ) ) ) -DockerRequirement_classLoader: Final = _EnumLoader( - ("DockerRequirement",), "DockerRequirement_class" -) -uri_DockerRequirement_classLoader_False_True_None_None: Final = _URILoader( - DockerRequirement_classLoader, False, True, None, None -) -SoftwareRequirement_classLoader: Final = _EnumLoader( - ("SoftwareRequirement",), "SoftwareRequirement_class" -) -uri_SoftwareRequirement_classLoader_False_True_None_None: Final = _URILoader( - SoftwareRequirement_classLoader, False, True, None, None -) -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: Final = _URILoader( - union_of_None_type_or_array_of_strtype, False, False, None, True +DockerRequirement_classLoader: Final[_Loader[Literal["DockerRequirement"]]] = ( + _EnumLoader(("DockerRequirement",), "DockerRequirement_class") ) -InitialWorkDirRequirement_classLoader: Final = _EnumLoader( - ("InitialWorkDirRequirement",), "InitialWorkDirRequirement_class" +uri_DockerRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["DockerRequirement"]] +] = _URILoader(DockerRequirement_classLoader, False, True, None, None) +SoftwareRequirement_classLoader: Final[_Loader[Literal["SoftwareRequirement"]]] = ( + _EnumLoader(("SoftwareRequirement",), "SoftwareRequirement_class") ) -uri_InitialWorkDirRequirement_classLoader_False_True_None_None: Final = _URILoader( - InitialWorkDirRequirement_classLoader, False, True, None, None +uri_SoftwareRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["SoftwareRequirement"]] +] = _URILoader(SoftwareRequirement_classLoader, False, True, None, None) +array_of_SoftwarePackageLoader: Final[_Loader[Sequence[SoftwarePackage]]] = ( + _ArrayLoader(SoftwarePackageLoader) ) -union_of_None_type_or_DirentLoader_or_ExpressionLoader_or_FileLoader_or_DirectoryLoader_or_array_of_union_of_FileLoader_or_DirectoryLoader: ( - Final -) = _UnionLoader( +idmap_packages_array_of_SoftwarePackageLoader: Final[ + _Loader[Sequence[SoftwarePackage]] +] = _IdMapLoader(array_of_SoftwarePackageLoader, "package", "specs") +uri_union_of_None_type_or_array_of_strtype_False_False_None_True: Final[ + _Loader[None | Sequence[str]] +] = _URILoader(union_of_None_type_or_array_of_strtype, False, False, None, True) +InitialWorkDirRequirement_classLoader: Final[ + _Loader[Literal["InitialWorkDirRequirement"]] +] = _EnumLoader(("InitialWorkDirRequirement",), "InitialWorkDirRequirement_class") +uri_InitialWorkDirRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["InitialWorkDirRequirement"]] +] = _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: Final[ + _Loader[Directory | Dirent | File | None | Sequence[Directory | File] | str] +] = _UnionLoader( ( None_type, DirentLoader, @@ -30468,167 +31735,192 @@ def __init__( 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: ( - Final -) = _ArrayLoader( +array_of_union_of_None_type_or_DirentLoader_or_ExpressionLoader_or_FileLoader_or_DirectoryLoader_or_array_of_union_of_FileLoader_or_DirectoryLoader: Final[ + _Loader[ + Sequence[Directory | Dirent | File | None | Sequence[Directory | File] | str] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + Sequence[Directory | Dirent | File | None | Sequence[Directory | File] | str] + | str + ] +] = _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: Final = _EnumLoader( - ("EnvVarRequirement",), "EnvVarRequirement_class" -) -uri_EnvVarRequirement_classLoader_False_True_None_None: Final = _URILoader( - EnvVarRequirement_classLoader, False, True, None, None +EnvVarRequirement_classLoader: Final[_Loader[Literal["EnvVarRequirement"]]] = ( + _EnumLoader(("EnvVarRequirement",), "EnvVarRequirement_class") ) -array_of_EnvironmentDefLoader: Final = _ArrayLoader(EnvironmentDefLoader) -idmap_envDef_array_of_EnvironmentDefLoader: Final = _IdMapLoader( - array_of_EnvironmentDefLoader, "envName", "envValue" +uri_EnvVarRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["EnvVarRequirement"]] +] = _URILoader(EnvVarRequirement_classLoader, False, True, None, None) +array_of_EnvironmentDefLoader: Final[_Loader[Sequence[EnvironmentDef]]] = _ArrayLoader( + EnvironmentDefLoader ) -ShellCommandRequirement_classLoader: Final = _EnumLoader( - ("ShellCommandRequirement",), "ShellCommandRequirement_class" +idmap_envDef_array_of_EnvironmentDefLoader: Final[_Loader[Sequence[EnvironmentDef]]] = ( + _IdMapLoader(array_of_EnvironmentDefLoader, "envName", "envValue") ) -uri_ShellCommandRequirement_classLoader_False_True_None_None: Final = _URILoader( - ShellCommandRequirement_classLoader, False, True, None, None +ShellCommandRequirement_classLoader: Final[ + _Loader[Literal["ShellCommandRequirement"]] +] = _EnumLoader(("ShellCommandRequirement",), "ShellCommandRequirement_class") +uri_ShellCommandRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["ShellCommandRequirement"]] +] = _URILoader(ShellCommandRequirement_classLoader, False, True, None, None) +ResourceRequirement_classLoader: Final[_Loader[Literal["ResourceRequirement"]]] = ( + _EnumLoader(("ResourceRequirement",), "ResourceRequirement_class") ) -ResourceRequirement_classLoader: Final = _EnumLoader( - ("ResourceRequirement",), "ResourceRequirement_class" -) -uri_ResourceRequirement_classLoader_False_True_None_None: Final = _URILoader( - ResourceRequirement_classLoader, False, True, None, None -) -union_of_None_type_or_inttype_or_inttype_or_floattype_or_ExpressionLoader: Final = ( - _UnionLoader( - ( - None_type, - inttype, - inttype, - floattype, - ExpressionLoader, - ) +uri_ResourceRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["ResourceRequirement"]] +] = _URILoader(ResourceRequirement_classLoader, False, True, None, None) +union_of_None_type_or_inttype_or_inttype_or_floattype_or_ExpressionLoader: Final[ + _Loader[None | float | i32 | str] +] = _UnionLoader( + ( + None_type, + inttype, + inttype, + floattype, + ExpressionLoader, ) ) -WorkReuse_classLoader: Final = _EnumLoader(("WorkReuse",), "WorkReuse_class") -uri_WorkReuse_classLoader_False_True_None_None: Final = _URILoader( - WorkReuse_classLoader, False, True, None, None +WorkReuse_classLoader: Final[_Loader[Literal["WorkReuse"]]] = _EnumLoader( + ("WorkReuse",), "WorkReuse_class" +) +uri_WorkReuse_classLoader_False_True_None_None: Final[_Loader[Literal["WorkReuse"]]] = ( + _URILoader(WorkReuse_classLoader, False, True, None, None) ) -union_of_booltype_or_ExpressionLoader: Final = _UnionLoader( +union_of_booltype_or_ExpressionLoader: Final[_Loader[bool | str]] = _UnionLoader( ( booltype, ExpressionLoader, ) ) -NetworkAccess_classLoader: Final = _EnumLoader( +NetworkAccess_classLoader: Final[_Loader[Literal["NetworkAccess"]]] = _EnumLoader( ("NetworkAccess",), "NetworkAccess_class" ) -uri_NetworkAccess_classLoader_False_True_None_None: Final = _URILoader( - NetworkAccess_classLoader, False, True, None, None -) -InplaceUpdateRequirement_classLoader: Final = _EnumLoader( - ("InplaceUpdateRequirement",), "InplaceUpdateRequirement_class" -) -uri_InplaceUpdateRequirement_classLoader_False_True_None_None: Final = _URILoader( - InplaceUpdateRequirement_classLoader, False, True, None, None -) -ToolTimeLimit_classLoader: Final = _EnumLoader( +uri_NetworkAccess_classLoader_False_True_None_None: Final[ + _Loader[Literal["NetworkAccess"]] +] = _URILoader(NetworkAccess_classLoader, False, True, None, None) +InplaceUpdateRequirement_classLoader: Final[ + _Loader[Literal["InplaceUpdateRequirement"]] +] = _EnumLoader(("InplaceUpdateRequirement",), "InplaceUpdateRequirement_class") +uri_InplaceUpdateRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["InplaceUpdateRequirement"]] +] = _URILoader(InplaceUpdateRequirement_classLoader, False, True, None, None) +ToolTimeLimit_classLoader: Final[_Loader[Literal["ToolTimeLimit"]]] = _EnumLoader( ("ToolTimeLimit",), "ToolTimeLimit_class" ) -uri_ToolTimeLimit_classLoader_False_True_None_None: Final = _URILoader( - ToolTimeLimit_classLoader, False, True, None, None -) -union_of_inttype_or_inttype_or_ExpressionLoader: Final = _UnionLoader( - ( - inttype, - inttype, - ExpressionLoader, +uri_ToolTimeLimit_classLoader_False_True_None_None: Final[ + _Loader[Literal["ToolTimeLimit"]] +] = _URILoader(ToolTimeLimit_classLoader, False, True, None, None) +union_of_inttype_or_inttype_or_ExpressionLoader: Final[_Loader[i32 | str]] = ( + _UnionLoader( + ( + inttype, + inttype, + ExpressionLoader, + ) ) ) -union_of_None_type_or_InputBindingLoader: Final = _UnionLoader( - ( - None_type, - InputBindingLoader, +union_of_None_type_or_InputBindingLoader: Final[_Loader[InputBinding | None]] = ( + _UnionLoader( + ( + None_type, + InputBindingLoader, + ) ) ) -ExpressionTool_classLoader: Final = _EnumLoader( +ExpressionTool_classLoader: Final[_Loader[Literal["ExpressionTool"]]] = _EnumLoader( ("ExpressionTool",), "ExpressionTool_class" ) -uri_ExpressionTool_classLoader_False_True_None_None: Final = _URILoader( - ExpressionTool_classLoader, False, True, None, None -) -array_of_WorkflowInputParameterLoader: Final = _ArrayLoader( - WorkflowInputParameterLoader -) -idmap_inputs_array_of_WorkflowInputParameterLoader: Final = _IdMapLoader( - array_of_WorkflowInputParameterLoader, "id", "type" -) -array_of_ExpressionToolOutputParameterLoader: Final = _ArrayLoader( - ExpressionToolOutputParameterLoader -) -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: Final = ( - _URILoader(union_of_None_type_or_strtype_or_array_of_strtype, False, False, 1, None) -) -union_of_None_type_or_LinkMergeMethodLoader: Final = _UnionLoader( +uri_ExpressionTool_classLoader_False_True_None_None: Final[ + _Loader[Literal["ExpressionTool"]] +] = _URILoader(ExpressionTool_classLoader, False, True, None, None) +array_of_WorkflowInputParameterLoader: Final[ + _Loader[Sequence[WorkflowInputParameter]] +] = _ArrayLoader(WorkflowInputParameterLoader) +idmap_inputs_array_of_WorkflowInputParameterLoader: Final[ + _Loader[Sequence[WorkflowInputParameter]] +] = _IdMapLoader(array_of_WorkflowInputParameterLoader, "id", "type") +array_of_ExpressionToolOutputParameterLoader: Final[ + _Loader[Sequence[ExpressionToolOutputParameter]] +] = _ArrayLoader(ExpressionToolOutputParameterLoader) +idmap_outputs_array_of_ExpressionToolOutputParameterLoader: Final[ + _Loader[Sequence[ExpressionToolOutputParameter]] +] = _IdMapLoader(array_of_ExpressionToolOutputParameterLoader, "id", "type") +uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_1_None: Final[ + _Loader[None | Sequence[str] | str] +] = _URILoader(union_of_None_type_or_strtype_or_array_of_strtype, False, False, 1, None) +union_of_None_type_or_LinkMergeMethodLoader: Final[ + _Loader[Literal["merge_nested", "merge_flattened"] | None] +] = _UnionLoader( ( None_type, LinkMergeMethodLoader, ) ) -union_of_None_type_or_PickValueMethodLoader: Final = _UnionLoader( +union_of_None_type_or_PickValueMethodLoader: Final[ + _Loader[Literal["first_non_null", "the_only_non_null", "all_non_null"] | None] +] = _UnionLoader( ( None_type, PickValueMethodLoader, ) ) -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: Final = _ArrayLoader(WorkflowStepInputLoader) -idmap_in__array_of_WorkflowStepInputLoader: Final = _IdMapLoader( - array_of_WorkflowStepInputLoader, "id", "source" +uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_2_None: Final[ + _Loader[None | Sequence[str] | str] +] = _URILoader(union_of_None_type_or_strtype_or_array_of_strtype, False, False, 2, None) +array_of_WorkflowStepInputLoader: Final[_Loader[Sequence[WorkflowStepInput]]] = ( + _ArrayLoader(WorkflowStepInputLoader) ) -union_of_strtype_or_WorkflowStepOutputLoader: Final = _UnionLoader( +idmap_in__array_of_WorkflowStepInputLoader: Final[ + _Loader[Sequence[WorkflowStepInput]] +] = _IdMapLoader(array_of_WorkflowStepInputLoader, "id", "source") +union_of_strtype_or_WorkflowStepOutputLoader: Final[ + _Loader[WorkflowStepOutput | str] +] = _UnionLoader( ( strtype, WorkflowStepOutputLoader, ) ) -array_of_union_of_strtype_or_WorkflowStepOutputLoader: Final = _ArrayLoader( - union_of_strtype_or_WorkflowStepOutputLoader -) -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: ( - Final -) = _URILoader( +array_of_union_of_strtype_or_WorkflowStepOutputLoader: Final[ + _Loader[Sequence[WorkflowStepOutput | str]] +] = _ArrayLoader(union_of_strtype_or_WorkflowStepOutputLoader) +union_of_array_of_union_of_strtype_or_WorkflowStepOutputLoader: Final[ + _Loader[Sequence[WorkflowStepOutput | str]] +] = _UnionLoader((array_of_union_of_strtype_or_WorkflowStepOutputLoader,)) +uri_union_of_array_of_union_of_strtype_or_WorkflowStepOutputLoader_True_False_None_None: Final[ + _Loader[Sequence[WorkflowStepOutput | str]] +] = _URILoader( union_of_array_of_union_of_strtype_or_WorkflowStepOutputLoader, True, False, None, None, ) -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, +array_of_Any_type: Final[_Loader[Sequence[Any]]] = _ArrayLoader(Any_type) +union_of_None_type_or_array_of_Any_type: Final[_Loader[None | Sequence[Any]]] = ( + _UnionLoader( + ( + None_type, + array_of_Any_type, + ) ) ) -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: ( - Final -) = _UnionLoader( +idmap_hints_union_of_None_type_or_array_of_Any_type: Final[ + _Loader[None | Sequence[Any]] +] = _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: Final[ + _Loader[ + CommandLineTool | ExpressionTool | Operation | ProcessGenerator | Workflow | str + ] +] = _UnionLoader( ( strtype, CommandLineToolLoader, @@ -30638,120 +31930,142 @@ def __init__( ProcessGeneratorLoader, ) ) -uri_union_of_strtype_or_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader_or_ProcessGeneratorLoader_False_False_None_None: ( - Final -) = _URILoader( +uri_union_of_strtype_or_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader_or_ProcessGeneratorLoader_False_False_None_None: Final[ + _Loader[ + CommandLineTool | ExpressionTool | Operation | ProcessGenerator | Workflow | str + ] +] = _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: Final = ( - _URILoader(union_of_None_type_or_strtype_or_array_of_strtype, False, False, 0, None) -) -union_of_None_type_or_ScatterMethodLoader: Final = _UnionLoader( +uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_0_None: Final[ + _Loader[None | Sequence[str] | str] +] = _URILoader(union_of_None_type_or_strtype_or_array_of_strtype, False, False, 0, None) +union_of_None_type_or_ScatterMethodLoader: Final[ + _Loader[Literal["dotproduct", "nested_crossproduct", "flat_crossproduct"] | None] +] = _UnionLoader( ( None_type, ScatterMethodLoader, ) ) -uri_union_of_None_type_or_ScatterMethodLoader_False_True_None_None: Final = _URILoader( - union_of_None_type_or_ScatterMethodLoader, False, True, None, None +uri_union_of_None_type_or_ScatterMethodLoader_False_True_None_None: Final[ + _Loader[Literal["dotproduct", "nested_crossproduct", "flat_crossproduct"] | None] +] = _URILoader(union_of_None_type_or_ScatterMethodLoader, False, True, None, None) +Workflow_classLoader: Final[_Loader[Literal["Workflow"]]] = _EnumLoader( + ("Workflow",), "Workflow_class" ) -Workflow_classLoader: Final = _EnumLoader(("Workflow",), "Workflow_class") -uri_Workflow_classLoader_False_True_None_None: Final = _URILoader( - Workflow_classLoader, False, True, None, None +uri_Workflow_classLoader_False_True_None_None: Final[_Loader[Literal["Workflow"]]] = ( + _URILoader(Workflow_classLoader, False, True, None, None) ) -array_of_WorkflowOutputParameterLoader: Final = _ArrayLoader( - WorkflowOutputParameterLoader +array_of_WorkflowOutputParameterLoader: Final[ + _Loader[Sequence[WorkflowOutputParameter]] +] = _ArrayLoader(WorkflowOutputParameterLoader) +idmap_outputs_array_of_WorkflowOutputParameterLoader: Final[ + _Loader[Sequence[WorkflowOutputParameter]] +] = _IdMapLoader(array_of_WorkflowOutputParameterLoader, "id", "type") +array_of_WorkflowStepLoader: Final[_Loader[Sequence[WorkflowStep]]] = _ArrayLoader( + WorkflowStepLoader ) -idmap_outputs_array_of_WorkflowOutputParameterLoader: Final = _IdMapLoader( - array_of_WorkflowOutputParameterLoader, "id", "type" +union_of_array_of_WorkflowStepLoader: Final[_Loader[Sequence[WorkflowStep]]] = ( + _UnionLoader((array_of_WorkflowStepLoader,)) ) -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: Final = _EnumLoader( +idmap_steps_union_of_array_of_WorkflowStepLoader: Final[ + _Loader[Sequence[WorkflowStep]] +] = _IdMapLoader(union_of_array_of_WorkflowStepLoader, "id", "None") +SubworkflowFeatureRequirement_classLoader: Final[ + _Loader[Literal["SubworkflowFeatureRequirement"]] +] = _EnumLoader( ("SubworkflowFeatureRequirement",), "SubworkflowFeatureRequirement_class" ) -uri_SubworkflowFeatureRequirement_classLoader_False_True_None_None: Final = _URILoader( - SubworkflowFeatureRequirement_classLoader, False, True, None, None -) -ScatterFeatureRequirement_classLoader: Final = _EnumLoader( - ("ScatterFeatureRequirement",), "ScatterFeatureRequirement_class" -) -uri_ScatterFeatureRequirement_classLoader_False_True_None_None: Final = _URILoader( - ScatterFeatureRequirement_classLoader, False, True, None, None -) -MultipleInputFeatureRequirement_classLoader: Final = _EnumLoader( +uri_SubworkflowFeatureRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["SubworkflowFeatureRequirement"]] +] = _URILoader(SubworkflowFeatureRequirement_classLoader, False, True, None, None) +ScatterFeatureRequirement_classLoader: Final[ + _Loader[Literal["ScatterFeatureRequirement"]] +] = _EnumLoader(("ScatterFeatureRequirement",), "ScatterFeatureRequirement_class") +uri_ScatterFeatureRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["ScatterFeatureRequirement"]] +] = _URILoader(ScatterFeatureRequirement_classLoader, False, True, None, None) +MultipleInputFeatureRequirement_classLoader: Final[ + _Loader[Literal["MultipleInputFeatureRequirement"]] +] = _EnumLoader( ("MultipleInputFeatureRequirement",), "MultipleInputFeatureRequirement_class" ) -uri_MultipleInputFeatureRequirement_classLoader_False_True_None_None: Final = ( - _URILoader(MultipleInputFeatureRequirement_classLoader, False, True, None, None) -) -StepInputExpressionRequirement_classLoader: Final = _EnumLoader( +uri_MultipleInputFeatureRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["MultipleInputFeatureRequirement"]] +] = _URILoader(MultipleInputFeatureRequirement_classLoader, False, True, None, None) +StepInputExpressionRequirement_classLoader: Final[ + _Loader[Literal["StepInputExpressionRequirement"]] +] = _EnumLoader( ("StepInputExpressionRequirement",), "StepInputExpressionRequirement_class" ) -uri_StepInputExpressionRequirement_classLoader_False_True_None_None: Final = _URILoader( - StepInputExpressionRequirement_classLoader, False, True, None, None +uri_StepInputExpressionRequirement_classLoader_False_True_None_None: Final[ + _Loader[Literal["StepInputExpressionRequirement"]] +] = _URILoader(StepInputExpressionRequirement_classLoader, False, True, None, None) +Operation_classLoader: Final[_Loader[Literal["Operation"]]] = _EnumLoader( + ("Operation",), "Operation_class" ) -Operation_classLoader: Final = _EnumLoader(("Operation",), "Operation_class") -uri_Operation_classLoader_False_True_None_None: Final = _URILoader( - Operation_classLoader, False, True, None, None +uri_Operation_classLoader_False_True_None_None: Final[_Loader[Literal["Operation"]]] = ( + _URILoader(Operation_classLoader, False, True, None, None) ) -array_of_OperationInputParameterLoader: Final = _ArrayLoader( - OperationInputParameterLoader +array_of_OperationInputParameterLoader: Final[ + _Loader[Sequence[OperationInputParameter]] +] = _ArrayLoader(OperationInputParameterLoader) +idmap_inputs_array_of_OperationInputParameterLoader: Final[ + _Loader[Sequence[OperationInputParameter]] +] = _IdMapLoader(array_of_OperationInputParameterLoader, "id", "type") +array_of_OperationOutputParameterLoader: Final[ + _Loader[Sequence[OperationOutputParameter]] +] = _ArrayLoader(OperationOutputParameterLoader) +idmap_outputs_array_of_OperationOutputParameterLoader: Final[ + _Loader[Sequence[OperationOutputParameter]] +] = _IdMapLoader(array_of_OperationOutputParameterLoader, "id", "type") +uri_strtype_False_True_None_None: Final[_Loader[str]] = _URILoader( + strtype, False, True, None, None ) -idmap_inputs_array_of_OperationInputParameterLoader: Final = _IdMapLoader( - array_of_OperationInputParameterLoader, "id", "type" -) -array_of_OperationOutputParameterLoader: Final = _ArrayLoader( - OperationOutputParameterLoader -) -idmap_outputs_array_of_OperationOutputParameterLoader: Final = _IdMapLoader( - array_of_OperationOutputParameterLoader, "id", "type" -) -uri_strtype_False_True_None_None: Final = _URILoader(strtype, False, True, None, None) -uri_array_of_strtype_False_False_0_None: Final = _URILoader( +uri_array_of_strtype_False_False_0_None: Final[_Loader[Sequence[str]]] = _URILoader( array_of_strtype, False, False, 0, None ) -union_of_inttype_or_ExpressionLoader: Final = _UnionLoader( +union_of_inttype_or_ExpressionLoader: Final[_Loader[i32 | str]] = _UnionLoader( ( inttype, ExpressionLoader, ) ) -union_of_strtype_or_array_of_strtype: Final = _UnionLoader( - ( - strtype, - array_of_strtype, +union_of_strtype_or_array_of_strtype: Final[_Loader[Sequence[str] | str]] = ( + _UnionLoader( + ( + strtype, + array_of_strtype, + ) ) ) -union_of_None_type_or_Any_type: Final = _UnionLoader( +union_of_None_type_or_Any_type: Final[_Loader[Any | None]] = _UnionLoader( ( None_type, Any_type, ) ) -array_of_LoopInputLoader: Final = _ArrayLoader(LoopInputLoader) -idmap_loop_array_of_LoopInputLoader: Final = _IdMapLoader( +array_of_LoopInputLoader: Final[_Loader[Sequence[LoopInput]]] = _ArrayLoader( + LoopInputLoader +) +idmap_loop_array_of_LoopInputLoader: Final[_Loader[Sequence[LoopInput]]] = _IdMapLoader( array_of_LoopInputLoader, "id", "loopSource" ) -LoopOutputModesLoader: Final = _EnumLoader( +LoopOutputModesLoader: Final[_Loader[Literal["last", "all"]]] = _EnumLoader( ( "last", "all", ), "LoopOutputModes", ) -union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader_or_ProcessGeneratorLoader: ( - Final -) = _UnionLoader( +union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader_or_ProcessGeneratorLoader: Final[ + _Loader[CommandLineTool | ExpressionTool | Operation | ProcessGenerator | Workflow] +] = _UnionLoader( ( CommandLineToolLoader, ExpressionToolLoader, @@ -30760,14 +32074,27 @@ def __init__( ProcessGeneratorLoader, ) ) -array_of_union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader_or_ProcessGeneratorLoader: ( - Final -) = _ArrayLoader( +array_of_union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader_or_ProcessGeneratorLoader: Final[ + _Loader[ + Sequence[ + CommandLineTool | ExpressionTool | Operation | ProcessGenerator | Workflow + ] + ] +] = _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: ( - Final -) = _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[ + _Loader[ + CommandLineTool + | ExpressionTool + | Operation + | ProcessGenerator + | Sequence[ + CommandLineTool | ExpressionTool | Operation | ProcessGenerator | Workflow + ] + | Workflow + ] +] = _UnionLoader( ( CommandLineToolLoader, ExpressionToolLoader, From 9af07e74294dcaa5f89f5aab44f9dc725e1e5918 Mon Sep 17 00:00:00 2001 From: GlassOfWhiskey Date: Sun, 5 Apr 2026 20:30:10 +0200 Subject: [PATCH 19/22] Regenerate parsers with mypyc annotations --- cwl_utils/parser/cwl_v1_0.py | 83 ++++++++++++++++++++++++++++++++- cwl_utils/parser/cwl_v1_1.py | 84 +++++++++++++++++++++++++++++++++- cwl_utils/parser/cwl_v1_2.py | 89 +++++++++++++++++++++++++++++++++++- 3 files changed, 253 insertions(+), 3 deletions(-) diff --git a/cwl_utils/parser/cwl_v1_0.py b/cwl_utils/parser/cwl_v1_0.py index 23db1d74..5d522ff2 100644 --- a/cwl_utils/parser/cwl_v1_0.py +++ b/cwl_utils/parser/cwl_v1_0.py @@ -18,7 +18,7 @@ from collections.abc import MutableMapping, MutableSequence, Sequence from io import StringIO from itertools import chain -from mypy_extensions import i32, i64 +from mypy_extensions import i32, i64, mypyc_attr from typing import ClassVar, Literal, Mapping # pylint: disable=unused-import # noqa: F401 from typing import Any, Final, Generic, TypeAlias, TypeVar, cast from urllib.parse import quote, urldefrag, urlparse, urlsplit, urlunsplit @@ -50,6 +50,7 @@ T = TypeVar("T", covariant=True) +@mypyc_attr(native_class=True) class LoadingOptions: idx: Final[IdxType] fileuri: Final[str | None] @@ -215,6 +216,7 @@ def graph(self) -> Graph: return graph +@mypyc_attr(native_class=True) class Saveable(metaclass=ABCMeta): """Mark classes than have a save() and fromDoc() function.""" @@ -444,6 +446,7 @@ def expand_url( return url +@mypyc_attr(native_class=True) class _Loader(Generic[T], metaclass=ABCMeta): @abstractmethod def load( @@ -456,6 +459,7 @@ def load( ) -> T: ... +@mypyc_attr(native_class=True) class _AnyLoader(_Loader[Any]): def load( self, @@ -470,6 +474,7 @@ def load( raise ValidationException("Expected non-null") +@mypyc_attr(native_class=True) class _PrimitiveLoader(_Loader[T]): def __init__(self, tp: type[T]) -> None: self.tp: Final = tp @@ -490,6 +495,7 @@ def __repr__(self) -> str: return str(self.tp) +@mypyc_attr(native_class=True) class _ArrayLoader(_Loader[Sequence[T]]): def __init__(self, items: _Loader[T]) -> None: self.items: Final = items @@ -547,6 +553,7 @@ def __repr__(self) -> str: return f"array<{self.items}>" +@mypyc_attr(native_class=True) class _MapLoader(_Loader[Mapping[str, T]]): def __init__( self, @@ -590,6 +597,7 @@ def __repr__(self) -> str: return self.name if self.name is not None else f"map" +@mypyc_attr(native_class=True) class _EnumLoader(_Loader[E]): def __init__(self, symbols: Sequence[str], name: str) -> None: self.symbols: Final = symbols @@ -611,6 +619,7 @@ def __repr__(self) -> str: return self.name +@mypyc_attr(native_class=True) class _SecondaryDSLLoader(_Loader[T]): def __init__(self, inner: _Loader[T]) -> None: self.inner: Final = inner @@ -684,6 +693,7 @@ def load( return self.inner.load(r, baseuri, loadingOptions, docRoot, lc=lc) +@mypyc_attr(native_class=True) class _RecordLoader(_Loader[S]): def __init__( self, @@ -718,6 +728,7 @@ def __repr__(self) -> str: return str(self.classtype.__name__) +@mypyc_attr(native_class=True) class _ExpressionLoader(_Loader[str]): def __init__(self, items: type[str]) -> None: self.items: Final = items @@ -739,6 +750,7 @@ def load( return doc +@mypyc_attr(native_class=True) class _UnionLoader(_Loader[T]): def __init__(self, alternates: Sequence[_Loader[T]], name: str | None = None) -> None: self.alternates = alternates @@ -829,6 +841,7 @@ def __repr__(self) -> str: return self.name if self.name is not None else " | ".join(str(a) for a in self.alternates) +@mypyc_attr(native_class=True) class _URILoader(_Loader[T]): def __init__( self, @@ -898,6 +911,7 @@ def load( return self.inner.load(doc, baseuri, loadingOptions, lc=lc) +@mypyc_attr(native_class=True) class _TypeDSLLoader(_Loader[T]): def __init__(self, inner: _Loader[T], refScope: int | None, salad_version: str) -> None: self.inner: Final = inner @@ -968,6 +982,7 @@ def load( return self.inner.load(doc, baseuri, loadingOptions, lc=lc) +@mypyc_attr(native_class=True) class _IdMapLoader(_Loader[T]): def __init__(self, inner: _Loader[T], mapSubject: str, mapPredicate: str | None) -> None: self.inner: Final = inner @@ -1187,6 +1202,7 @@ def parser_info() -> str: return "org.w3id.cwl.v1_0" +@mypyc_attr(native_class=True) class RecordField(Saveable): """ A field of a record. @@ -1459,6 +1475,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["doc", "name", "type"]) +@mypyc_attr(native_class=True) class RecordSchema(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, RecordSchema): @@ -1658,6 +1675,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["fields", "type"]) +@mypyc_attr(native_class=True) class EnumSchema(Saveable): """ Define an enumerated type. @@ -1930,6 +1948,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["name", "symbols", "type"]) +@mypyc_attr(native_class=True) class ArraySchema(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, ArraySchema): @@ -2129,6 +2148,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["items", "type"]) +@mypyc_attr(native_class=True) class MapSchema(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, MapSchema): @@ -2328,6 +2348,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["type", "values"]) +@mypyc_attr(native_class=True) class UnionSchema(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, UnionSchema): @@ -2527,6 +2548,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["names", "type"]) +@mypyc_attr(native_class=True) class CWLArraySchema(ArraySchema): def __eq__(self, other: Any) -> bool: if isinstance(other, CWLArraySchema): @@ -2726,6 +2748,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["items", "type"]) +@mypyc_attr(native_class=True) class CWLRecordField(RecordField): name: str @@ -2994,6 +3017,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["doc", "name", "type"]) +@mypyc_attr(native_class=True) class CWLRecordSchema(RecordSchema): def __eq__(self, other: Any) -> bool: if isinstance(other, CWLRecordSchema): @@ -3193,6 +3217,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["fields", "type"]) +@mypyc_attr(native_class=True) class File(Saveable): """ Represents a file (or group of files when `secondaryFiles` is provided) that @@ -4015,6 +4040,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class Directory(Saveable): """ Represents a directory to present to a command line tool. @@ -4401,6 +4427,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class InputRecordField(CWLRecordField): name: str @@ -4784,6 +4811,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class InputRecordSchema(CWLRecordSchema): name: str @@ -5106,6 +5134,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["fields", "type", "label", "name"]) +@mypyc_attr(native_class=True) class InputEnumSchema(EnumSchema): name: str @@ -5490,6 +5519,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class InputArraySchema(CWLArraySchema): def __eq__(self, other: Any) -> bool: if isinstance(other, InputArraySchema): @@ -5807,6 +5837,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class OutputRecordField(CWLRecordField): name: str @@ -6135,6 +6166,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class OutputRecordSchema(CWLRecordSchema): def __eq__(self, other: Any) -> bool: if isinstance(other, OutputRecordSchema): @@ -6392,6 +6424,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["fields", "type", "label"]) +@mypyc_attr(native_class=True) class OutputEnumSchema(EnumSchema): name: str @@ -6776,6 +6809,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class OutputArraySchema(CWLArraySchema): def __eq__(self, other: Any) -> bool: if isinstance(other, OutputArraySchema): @@ -7093,6 +7127,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class InputParameter(Saveable): id: str @@ -7722,6 +7757,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class OutputParameter(Saveable): id: str @@ -8237,6 +8273,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class InlineJavascriptRequirement(Saveable): """ Indicates that the workflow platform must support inline Javascript expressions. @@ -8419,6 +8456,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "expressionLib"]) +@mypyc_attr(native_class=True) class SchemaDefRequirement(Saveable): """ This field consists of an array of type definitions which must be used when @@ -8600,6 +8638,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "types"]) +@mypyc_attr(native_class=True) class EnvironmentDef(Saveable): """ Define an environment variable that will be set in the runtime environment @@ -8809,6 +8848,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["envName", "envValue"]) +@mypyc_attr(native_class=True) class CommandLineBinding(Saveable): """ @@ -9356,6 +9396,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandOutputBinding(Saveable): """ Describes how to generate an output parameter based on the files produced @@ -9632,6 +9673,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["glob", "loadContents", "outputEval"]) +@mypyc_attr(native_class=True) class CommandInputRecordField(InputRecordField): name: str @@ -10015,6 +10057,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandInputRecordSchema(InputRecordSchema): name: str @@ -10337,6 +10380,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["fields", "type", "label", "name"]) +@mypyc_attr(native_class=True) class CommandInputEnumSchema(InputEnumSchema): name: str @@ -10721,6 +10765,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandInputArraySchema(InputArraySchema): def __eq__(self, other: Any) -> bool: if isinstance(other, CommandInputArraySchema): @@ -11038,6 +11083,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandOutputRecordField(OutputRecordField): name: str @@ -11366,6 +11412,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandOutputRecordSchema(OutputRecordSchema): name: str @@ -11688,6 +11735,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["fields", "type", "label", "name"]) +@mypyc_attr(native_class=True) class CommandOutputEnumSchema(OutputEnumSchema): name: str @@ -12072,6 +12120,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandOutputArraySchema(OutputArraySchema): def __eq__(self, other: Any) -> bool: if isinstance(other, CommandOutputArraySchema): @@ -12389,6 +12438,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandInputParameter(InputParameter): """ An input parameter for a CommandLineTool. @@ -13022,6 +13072,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandOutputParameter(OutputParameter): """ An output parameter for a CommandLineTool. @@ -13598,6 +13649,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandLineTool(Saveable): """ This defines the schema of the CWL Command Line Tool Description document. @@ -14666,6 +14718,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class DockerRequirement(Saveable): """ Indicates that a workflow component should be run in a @@ -15188,6 +15241,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class SoftwareRequirement(Saveable): """ A list of software packages that should be configured in the environment of @@ -15364,6 +15418,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "packages"]) +@mypyc_attr(native_class=True) class SoftwarePackage(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, SoftwarePackage): @@ -15620,6 +15675,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["package", "version", "specs"]) +@mypyc_attr(native_class=True) class Dirent(Saveable): """ Define a file or subdirectory that must be placed in the designated output @@ -15888,6 +15944,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["entryname", "entry", "writable"]) +@mypyc_attr(native_class=True) class InitialWorkDirRequirement(Saveable): """ 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. @@ -16062,6 +16119,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "listing"]) +@mypyc_attr(native_class=True) class EnvVarRequirement(Saveable): """ Define a list of environment variables which will be set in the @@ -16238,6 +16296,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "envDef"]) +@mypyc_attr(native_class=True) class ShellCommandRequirement(Saveable): """ Modify the behavior of CommandLineTool to generate a single string @@ -16362,6 +16421,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class"]) +@mypyc_attr(native_class=True) class ResourceRequirement(Saveable): """ Specify basic hardware resource requirements. @@ -16979,6 +17039,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class ExpressionToolOutputParameter(OutputParameter): id: str @@ -17551,6 +17612,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class ExpressionTool(Saveable): """ Execute an expression as a Workflow step. @@ -18212,6 +18274,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class WorkflowOutputParameter(OutputParameter): """ Describe an output parameter of a workflow. The parameter must be @@ -18904,6 +18967,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class WorkflowStepInput(Saveable): """ The input of a workflow step connects an upstream parameter (from the @@ -19327,6 +19391,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class WorkflowStepOutput(Saveable): """ Associate an output parameter of the underlying process with a workflow @@ -19488,6 +19553,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["id"]) +@mypyc_attr(native_class=True) class WorkflowStep(Saveable): """ A workflow step is an executable element of a workflow. It specifies the @@ -20229,6 +20295,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class Workflow(Saveable): """ A workflow describes a set of **steps** and the **dependencies** between @@ -20931,6 +20998,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class SubworkflowFeatureRequirement(Saveable): """ Indicates that the workflow platform must support nested workflows in @@ -21050,6 +21118,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class"]) +@mypyc_attr(native_class=True) class ScatterFeatureRequirement(Saveable): """ Indicates that the workflow platform must support the `scatter` and @@ -21169,6 +21238,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class"]) +@mypyc_attr(native_class=True) class MultipleInputFeatureRequirement(Saveable): """ Indicates that the workflow platform must support multiple inbound data links @@ -21288,6 +21358,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class"]) +@mypyc_attr(native_class=True) class StepInputExpressionRequirement(Saveable): """ Indicate that the workflow platform must support the `valueFrom` field @@ -21407,6 +21478,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class"]) +@mypyc_attr(native_class=True) class LoadListingRequirement(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, LoadListingRequirement): @@ -21582,6 +21654,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "loadListing"]) +@mypyc_attr(native_class=True) class InplaceUpdateRequirement(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, InplaceUpdateRequirement): @@ -21758,6 +21831,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "inplaceUpdate"]) +@mypyc_attr(native_class=True) class Secrets(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, Secrets): @@ -21927,6 +22001,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "secrets"]) +@mypyc_attr(native_class=True) class TimeLimit(Saveable): """ Set an upper limit on the execution time of a CommandLineTool or @@ -22110,6 +22185,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "timelimit"]) +@mypyc_attr(native_class=True) class WorkReuse(Saveable): """ For implementations that support reusing output from past work (on @@ -22298,6 +22374,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "enableReuse"]) +@mypyc_attr(native_class=True) class NetworkAccess(Saveable): """ Indicate whether a process requires outgoing IPv4/IPv6 network @@ -22493,6 +22570,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "networkAccess"]) +@mypyc_attr(native_class=True) class ProcessGenerator(Saveable): id: str @@ -23145,6 +23223,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class MPIRequirement(Saveable): """ Indicates that a process requires an MPI runtime. @@ -23325,6 +23404,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "processes"]) +@mypyc_attr(native_class=True) class CUDARequirement(Saveable): """ Require support for NVIDA CUDA (GPU hardware acceleration). @@ -23697,6 +23777,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class ShmSize(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, ShmSize): diff --git a/cwl_utils/parser/cwl_v1_1.py b/cwl_utils/parser/cwl_v1_1.py index b458d593..4fa86d51 100644 --- a/cwl_utils/parser/cwl_v1_1.py +++ b/cwl_utils/parser/cwl_v1_1.py @@ -18,7 +18,7 @@ from collections.abc import MutableMapping, MutableSequence, Sequence from io import StringIO from itertools import chain -from mypy_extensions import i32, i64 +from mypy_extensions import i32, i64, mypyc_attr from typing import ClassVar, Literal, Mapping # pylint: disable=unused-import # noqa: F401 from typing import Any, Final, Generic, TypeAlias, TypeVar, cast from urllib.parse import quote, urldefrag, urlparse, urlsplit, urlunsplit @@ -50,6 +50,7 @@ T = TypeVar("T", covariant=True) +@mypyc_attr(native_class=True) class LoadingOptions: idx: Final[IdxType] fileuri: Final[str | None] @@ -215,6 +216,7 @@ def graph(self) -> Graph: return graph +@mypyc_attr(native_class=True) class Saveable(metaclass=ABCMeta): """Mark classes than have a save() and fromDoc() function.""" @@ -444,6 +446,7 @@ def expand_url( return url +@mypyc_attr(native_class=True) class _Loader(Generic[T], metaclass=ABCMeta): @abstractmethod def load( @@ -456,6 +459,7 @@ def load( ) -> T: ... +@mypyc_attr(native_class=True) class _AnyLoader(_Loader[Any]): def load( self, @@ -470,6 +474,7 @@ def load( raise ValidationException("Expected non-null") +@mypyc_attr(native_class=True) class _PrimitiveLoader(_Loader[T]): def __init__(self, tp: type[T]) -> None: self.tp: Final = tp @@ -490,6 +495,7 @@ def __repr__(self) -> str: return str(self.tp) +@mypyc_attr(native_class=True) class _ArrayLoader(_Loader[Sequence[T]]): def __init__(self, items: _Loader[T]) -> None: self.items: Final = items @@ -547,6 +553,7 @@ def __repr__(self) -> str: return f"array<{self.items}>" +@mypyc_attr(native_class=True) class _MapLoader(_Loader[Mapping[str, T]]): def __init__( self, @@ -590,6 +597,7 @@ def __repr__(self) -> str: return self.name if self.name is not None else f"map" +@mypyc_attr(native_class=True) class _EnumLoader(_Loader[E]): def __init__(self, symbols: Sequence[str], name: str) -> None: self.symbols: Final = symbols @@ -611,6 +619,7 @@ def __repr__(self) -> str: return self.name +@mypyc_attr(native_class=True) class _SecondaryDSLLoader(_Loader[T]): def __init__(self, inner: _Loader[T]) -> None: self.inner: Final = inner @@ -684,6 +693,7 @@ def load( return self.inner.load(r, baseuri, loadingOptions, docRoot, lc=lc) +@mypyc_attr(native_class=True) class _RecordLoader(_Loader[S]): def __init__( self, @@ -718,6 +728,7 @@ def __repr__(self) -> str: return str(self.classtype.__name__) +@mypyc_attr(native_class=True) class _ExpressionLoader(_Loader[str]): def __init__(self, items: type[str]) -> None: self.items: Final = items @@ -739,6 +750,7 @@ def load( return doc +@mypyc_attr(native_class=True) class _UnionLoader(_Loader[T]): def __init__(self, alternates: Sequence[_Loader[T]], name: str | None = None) -> None: self.alternates = alternates @@ -829,6 +841,7 @@ def __repr__(self) -> str: return self.name if self.name is not None else " | ".join(str(a) for a in self.alternates) +@mypyc_attr(native_class=True) class _URILoader(_Loader[T]): def __init__( self, @@ -898,6 +911,7 @@ def load( return self.inner.load(doc, baseuri, loadingOptions, lc=lc) +@mypyc_attr(native_class=True) class _TypeDSLLoader(_Loader[T]): def __init__(self, inner: _Loader[T], refScope: int | None, salad_version: str) -> None: self.inner: Final = inner @@ -968,6 +982,7 @@ def load( return self.inner.load(doc, baseuri, loadingOptions, lc=lc) +@mypyc_attr(native_class=True) class _IdMapLoader(_Loader[T]): def __init__(self, inner: _Loader[T], mapSubject: str, mapPredicate: str | None) -> None: self.inner: Final = inner @@ -1187,6 +1202,7 @@ def parser_info() -> str: return "org.w3id.cwl.v1_1" +@mypyc_attr(native_class=True) class RecordField(Saveable): """ A field of a record. @@ -1459,6 +1475,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["doc", "name", "type"]) +@mypyc_attr(native_class=True) class RecordSchema(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, RecordSchema): @@ -1658,6 +1675,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["fields", "type"]) +@mypyc_attr(native_class=True) class EnumSchema(Saveable): """ Define an enumerated type. @@ -1930,6 +1948,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["name", "symbols", "type"]) +@mypyc_attr(native_class=True) class ArraySchema(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, ArraySchema): @@ -2129,6 +2148,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["items", "type"]) +@mypyc_attr(native_class=True) class MapSchema(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, MapSchema): @@ -2328,6 +2348,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["type", "values"]) +@mypyc_attr(native_class=True) class UnionSchema(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, UnionSchema): @@ -2527,6 +2548,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["names", "type"]) +@mypyc_attr(native_class=True) class CWLArraySchema(ArraySchema): def __eq__(self, other: Any) -> bool: if isinstance(other, CWLArraySchema): @@ -2726,6 +2748,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["items", "type"]) +@mypyc_attr(native_class=True) class CWLRecordField(RecordField): name: str @@ -2994,6 +3017,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["doc", "name", "type"]) +@mypyc_attr(native_class=True) class CWLRecordSchema(RecordSchema): def __eq__(self, other: Any) -> bool: if isinstance(other, CWLRecordSchema): @@ -3193,6 +3217,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["fields", "type"]) +@mypyc_attr(native_class=True) class File(Saveable): """ Represents a file (or group of files when `secondaryFiles` is provided) that @@ -4015,6 +4040,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class Directory(Saveable): """ Represents a directory to present to a command line tool. @@ -4401,6 +4427,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class InputBinding(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, InputBinding): @@ -4548,6 +4575,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["loadContents"]) +@mypyc_attr(native_class=True) class InputRecordField(CWLRecordField): name: str @@ -5181,6 +5209,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class InputRecordSchema(CWLRecordSchema): name: str @@ -5560,6 +5589,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class InputEnumSchema(EnumSchema): name: str @@ -5939,6 +5969,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class InputArraySchema(CWLArraySchema): name: str @@ -6318,6 +6349,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class OutputRecordField(CWLRecordField): name: str @@ -6823,6 +6855,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class OutputRecordSchema(CWLRecordSchema): name: str @@ -7202,6 +7235,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class OutputEnumSchema(EnumSchema): name: str @@ -7581,6 +7615,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class OutputArraySchema(CWLArraySchema): name: str @@ -7960,6 +7995,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class InlineJavascriptRequirement(Saveable): """ Indicates that the workflow platform must support inline Javascript expressions. @@ -8142,6 +8178,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "expressionLib"]) +@mypyc_attr(native_class=True) class SchemaDefRequirement(Saveable): """ This field consists of an array of type definitions which must be used when @@ -8323,6 +8360,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "types"]) +@mypyc_attr(native_class=True) class SecondaryFileSchema(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, SecondaryFileSchema): @@ -8524,6 +8562,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["pattern", "required"]) +@mypyc_attr(native_class=True) class LoadListingRequirement(Saveable): """ Specify the desired behavior for loading the `listing` field of @@ -8704,6 +8743,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "loadListing"]) +@mypyc_attr(native_class=True) class EnvironmentDef(Saveable): """ Define an environment variable that will be set in the runtime environment @@ -8913,6 +8953,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["envName", "envValue"]) +@mypyc_attr(native_class=True) class CommandLineBinding(InputBinding): """ @@ -9460,6 +9501,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandOutputBinding(Saveable): """ Describes how to generate an output parameter based on the files produced @@ -9796,6 +9838,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandInputRecordField(InputRecordField): name: str @@ -10489,6 +10532,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandInputRecordSchema(InputRecordSchema): name: str @@ -10935,6 +10979,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandInputEnumSchema(InputEnumSchema): name: str @@ -11381,6 +11426,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandInputArraySchema(InputArraySchema): name: str @@ -11820,6 +11866,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandOutputRecordField(OutputRecordField): name: str @@ -12393,6 +12440,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandOutputRecordSchema(OutputRecordSchema): name: str @@ -12772,6 +12820,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandOutputEnumSchema(OutputEnumSchema): name: str @@ -13151,6 +13200,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandOutputArraySchema(OutputArraySchema): name: str @@ -13530,6 +13580,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandInputParameter(Saveable): """ An input parameter for a CommandLineTool. @@ -14284,6 +14335,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandOutputParameter(Saveable): """ An output parameter for a CommandLineTool. @@ -14861,6 +14913,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandLineTool(Saveable): """ This defines the schema of the CWL Command Line Tool Description document. @@ -15929,6 +15982,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class DockerRequirement(Saveable): """ Indicates that a workflow component should be run in a @@ -16469,6 +16523,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class SoftwareRequirement(Saveable): """ A list of software packages that should be configured in the environment of @@ -16645,6 +16700,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "packages"]) +@mypyc_attr(native_class=True) class SoftwarePackage(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, SoftwarePackage): @@ -16901,6 +16957,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["package", "version", "specs"]) +@mypyc_attr(native_class=True) class Dirent(Saveable): """ Define a file or subdirectory that must be placed in the designated output @@ -17169,6 +17226,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["entryname", "entry", "writable"]) +@mypyc_attr(native_class=True) class InitialWorkDirRequirement(Saveable): """ 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. @@ -17343,6 +17401,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "listing"]) +@mypyc_attr(native_class=True) class EnvVarRequirement(Saveable): """ Define a list of environment variables which will be set in the @@ -17519,6 +17578,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "envDef"]) +@mypyc_attr(native_class=True) class ShellCommandRequirement(Saveable): """ Modify the behavior of CommandLineTool to generate a single string @@ -17643,6 +17703,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class"]) +@mypyc_attr(native_class=True) class ResourceRequirement(Saveable): """ Specify basic hardware resource requirements. @@ -18260,6 +18321,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class WorkReuse(Saveable): """ For implementations that support reusing output from past work (on @@ -18448,6 +18510,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "enableReuse"]) +@mypyc_attr(native_class=True) class NetworkAccess(Saveable): """ Indicate whether a process requires outgoing IPv4/IPv6 network @@ -18643,6 +18706,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "networkAccess"]) +@mypyc_attr(native_class=True) class InplaceUpdateRequirement(Saveable): """ @@ -18853,6 +18917,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "inplaceUpdate"]) +@mypyc_attr(native_class=True) class ToolTimeLimit(Saveable): """ Set an upper limit on the execution time of a CommandLineTool. @@ -19039,6 +19104,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "timelimit"]) +@mypyc_attr(native_class=True) class ExpressionToolOutputParameter(Saveable): id: str @@ -19544,6 +19610,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class WorkflowInputParameter(Saveable): id: str @@ -20294,6 +20361,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class ExpressionTool(Saveable): """ An ExpressionTool is a type of Process object that can be run by itself @@ -20961,6 +21029,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class WorkflowOutputParameter(Saveable): """ Describe an output parameter of a workflow. The parameter must be @@ -21595,6 +21664,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class WorkflowStepInput(Saveable): """ The input of a workflow step connects an upstream parameter (from the @@ -22211,6 +22281,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class WorkflowStepOutput(Saveable): """ Associate an output parameter of the underlying process with a workflow @@ -22376,6 +22447,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["id"]) +@mypyc_attr(native_class=True) class WorkflowStep(Saveable): """ A workflow step is an executable element of a workflow. It specifies the @@ -23119,6 +23191,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class Workflow(Saveable): """ A workflow describes a set of **steps** and the **dependencies** between @@ -23821,6 +23894,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class SubworkflowFeatureRequirement(Saveable): """ Indicates that the workflow platform must support nested workflows in @@ -23940,6 +24014,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class"]) +@mypyc_attr(native_class=True) class ScatterFeatureRequirement(Saveable): """ Indicates that the workflow platform must support the `scatter` and @@ -24059,6 +24134,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class"]) +@mypyc_attr(native_class=True) class MultipleInputFeatureRequirement(Saveable): """ Indicates that the workflow platform must support multiple inbound data links @@ -24178,6 +24254,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class"]) +@mypyc_attr(native_class=True) class StepInputExpressionRequirement(Saveable): """ Indicate that the workflow platform must support the `valueFrom` field @@ -24297,6 +24374,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class"]) +@mypyc_attr(native_class=True) class Secrets(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, Secrets): @@ -24466,6 +24544,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "secrets"]) +@mypyc_attr(native_class=True) class ProcessGenerator(Saveable): id: str @@ -25120,6 +25199,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class MPIRequirement(Saveable): """ Indicates that a process requires an MPI runtime. @@ -25300,6 +25380,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "processes"]) +@mypyc_attr(native_class=True) class CUDARequirement(Saveable): """ Require support for NVIDA CUDA (GPU hardware acceleration). @@ -25672,6 +25753,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class ShmSize(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, ShmSize): diff --git a/cwl_utils/parser/cwl_v1_2.py b/cwl_utils/parser/cwl_v1_2.py index b7387083..a138ccfa 100644 --- a/cwl_utils/parser/cwl_v1_2.py +++ b/cwl_utils/parser/cwl_v1_2.py @@ -18,7 +18,7 @@ from collections.abc import MutableMapping, MutableSequence, Sequence from io import StringIO from itertools import chain -from mypy_extensions import i32, i64 +from mypy_extensions import i32, i64, mypyc_attr from typing import ClassVar, Literal, Mapping # pylint: disable=unused-import # noqa: F401 from typing import Any, Final, Generic, TypeAlias, TypeVar, cast from urllib.parse import quote, urldefrag, urlparse, urlsplit, urlunsplit @@ -50,6 +50,7 @@ T = TypeVar("T", covariant=True) +@mypyc_attr(native_class=True) class LoadingOptions: idx: Final[IdxType] fileuri: Final[str | None] @@ -215,6 +216,7 @@ def graph(self) -> Graph: return graph +@mypyc_attr(native_class=True) class Saveable(metaclass=ABCMeta): """Mark classes than have a save() and fromDoc() function.""" @@ -444,6 +446,7 @@ def expand_url( return url +@mypyc_attr(native_class=True) class _Loader(Generic[T], metaclass=ABCMeta): @abstractmethod def load( @@ -456,6 +459,7 @@ def load( ) -> T: ... +@mypyc_attr(native_class=True) class _AnyLoader(_Loader[Any]): def load( self, @@ -470,6 +474,7 @@ def load( raise ValidationException("Expected non-null") +@mypyc_attr(native_class=True) class _PrimitiveLoader(_Loader[T]): def __init__(self, tp: type[T]) -> None: self.tp: Final = tp @@ -490,6 +495,7 @@ def __repr__(self) -> str: return str(self.tp) +@mypyc_attr(native_class=True) class _ArrayLoader(_Loader[Sequence[T]]): def __init__(self, items: _Loader[T]) -> None: self.items: Final = items @@ -547,6 +553,7 @@ def __repr__(self) -> str: return f"array<{self.items}>" +@mypyc_attr(native_class=True) class _MapLoader(_Loader[Mapping[str, T]]): def __init__( self, @@ -590,6 +597,7 @@ def __repr__(self) -> str: return self.name if self.name is not None else f"map" +@mypyc_attr(native_class=True) class _EnumLoader(_Loader[E]): def __init__(self, symbols: Sequence[str], name: str) -> None: self.symbols: Final = symbols @@ -611,6 +619,7 @@ def __repr__(self) -> str: return self.name +@mypyc_attr(native_class=True) class _SecondaryDSLLoader(_Loader[T]): def __init__(self, inner: _Loader[T]) -> None: self.inner: Final = inner @@ -684,6 +693,7 @@ def load( return self.inner.load(r, baseuri, loadingOptions, docRoot, lc=lc) +@mypyc_attr(native_class=True) class _RecordLoader(_Loader[S]): def __init__( self, @@ -718,6 +728,7 @@ def __repr__(self) -> str: return str(self.classtype.__name__) +@mypyc_attr(native_class=True) class _ExpressionLoader(_Loader[str]): def __init__(self, items: type[str]) -> None: self.items: Final = items @@ -739,6 +750,7 @@ def load( return doc +@mypyc_attr(native_class=True) class _UnionLoader(_Loader[T]): def __init__(self, alternates: Sequence[_Loader[T]], name: str | None = None) -> None: self.alternates = alternates @@ -829,6 +841,7 @@ def __repr__(self) -> str: return self.name if self.name is not None else " | ".join(str(a) for a in self.alternates) +@mypyc_attr(native_class=True) class _URILoader(_Loader[T]): def __init__( self, @@ -898,6 +911,7 @@ def load( return self.inner.load(doc, baseuri, loadingOptions, lc=lc) +@mypyc_attr(native_class=True) class _TypeDSLLoader(_Loader[T]): def __init__(self, inner: _Loader[T], refScope: int | None, salad_version: str) -> None: self.inner: Final = inner @@ -968,6 +982,7 @@ def load( return self.inner.load(doc, baseuri, loadingOptions, lc=lc) +@mypyc_attr(native_class=True) class _IdMapLoader(_Loader[T]): def __init__(self, inner: _Loader[T], mapSubject: str, mapPredicate: str | None) -> None: self.inner: Final = inner @@ -1187,6 +1202,7 @@ def parser_info() -> str: return "org.w3id.cwl.v1_2" +@mypyc_attr(native_class=True) class RecordField(Saveable): """ A field of a record. @@ -1459,6 +1475,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["doc", "name", "type"]) +@mypyc_attr(native_class=True) class RecordSchema(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, RecordSchema): @@ -1658,6 +1675,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["fields", "type"]) +@mypyc_attr(native_class=True) class EnumSchema(Saveable): """ Define an enumerated type. @@ -1930,6 +1948,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["name", "symbols", "type"]) +@mypyc_attr(native_class=True) class ArraySchema(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, ArraySchema): @@ -2129,6 +2148,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["items", "type"]) +@mypyc_attr(native_class=True) class MapSchema(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, MapSchema): @@ -2328,6 +2348,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["type", "values"]) +@mypyc_attr(native_class=True) class UnionSchema(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, UnionSchema): @@ -2527,6 +2548,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["names", "type"]) +@mypyc_attr(native_class=True) class CWLArraySchema(ArraySchema): def __eq__(self, other: Any) -> bool: if isinstance(other, CWLArraySchema): @@ -2726,6 +2748,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["items", "type"]) +@mypyc_attr(native_class=True) class CWLRecordField(RecordField): name: str @@ -2994,6 +3017,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["doc", "name", "type"]) +@mypyc_attr(native_class=True) class CWLRecordSchema(RecordSchema): def __eq__(self, other: Any) -> bool: if isinstance(other, CWLRecordSchema): @@ -3193,6 +3217,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["fields", "type"]) +@mypyc_attr(native_class=True) class File(Saveable): """ Represents a file (or group of files when `secondaryFiles` is provided) that @@ -4015,6 +4040,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class Directory(Saveable): """ Represents a directory to present to a command line tool. @@ -4401,6 +4427,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class InputBinding(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, InputBinding): @@ -4548,6 +4575,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["loadContents"]) +@mypyc_attr(native_class=True) class InputRecordField(CWLRecordField): name: str @@ -5181,6 +5209,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class InputRecordSchema(CWLRecordSchema): name: str @@ -5560,6 +5589,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class InputEnumSchema(EnumSchema): name: str @@ -5939,6 +5969,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class InputArraySchema(CWLArraySchema): name: str @@ -6318,6 +6349,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class OutputRecordField(CWLRecordField): name: str @@ -6823,6 +6855,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class OutputRecordSchema(CWLRecordSchema): name: str @@ -7202,6 +7235,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class OutputEnumSchema(EnumSchema): name: str @@ -7581,6 +7615,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class OutputArraySchema(CWLArraySchema): name: str @@ -7960,6 +7995,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class InlineJavascriptRequirement(Saveable): """ Indicates that the workflow platform must support inline Javascript expressions. @@ -8142,6 +8178,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "expressionLib"]) +@mypyc_attr(native_class=True) class SchemaDefRequirement(Saveable): """ This field consists of an array of type definitions which must be used when @@ -8328,6 +8365,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "types"]) +@mypyc_attr(native_class=True) class SecondaryFileSchema(Saveable): """ Secondary files are specified using the following micro-DSL for secondary files: @@ -8546,6 +8584,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["pattern", "required"]) +@mypyc_attr(native_class=True) class LoadListingRequirement(Saveable): """ Specify the desired behavior for loading the `listing` field of @@ -8726,6 +8765,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "loadListing"]) +@mypyc_attr(native_class=True) class EnvironmentDef(Saveable): """ Define an environment variable that will be set in the runtime environment @@ -8935,6 +8975,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["envName", "envValue"]) +@mypyc_attr(native_class=True) class CommandLineBinding(InputBinding): """ @@ -9482,6 +9523,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandOutputBinding(Saveable): """ Describes how to generate an output parameter based on the files produced @@ -9818,6 +9860,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandInputRecordField(InputRecordField): name: str @@ -10511,6 +10554,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandInputRecordSchema(InputRecordSchema): name: str @@ -10957,6 +11001,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandInputEnumSchema(InputEnumSchema): name: str @@ -11403,6 +11448,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandInputArraySchema(InputArraySchema): name: str @@ -11842,6 +11888,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandOutputRecordField(OutputRecordField): name: str @@ -12415,6 +12462,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandOutputRecordSchema(OutputRecordSchema): name: str @@ -12794,6 +12842,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandOutputEnumSchema(OutputEnumSchema): name: str @@ -13173,6 +13222,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandOutputArraySchema(OutputArraySchema): name: str @@ -13552,6 +13602,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandInputParameter(Saveable): """ An input parameter for a CommandLineTool. @@ -14306,6 +14357,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandOutputParameter(Saveable): """ An output parameter for a CommandLineTool. @@ -14883,6 +14935,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class CommandLineTool(Saveable): """ This defines the schema of the CWL Command Line Tool Description document. @@ -16007,6 +16060,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class DockerRequirement(Saveable): """ Indicates that a workflow component should be run in a @@ -16547,6 +16601,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class SoftwareRequirement(Saveable): """ A list of software packages that should be configured in the environment of @@ -16723,6 +16778,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "packages"]) +@mypyc_attr(native_class=True) class SoftwarePackage(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, SoftwarePackage): @@ -16979,6 +17035,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["package", "version", "specs"]) +@mypyc_attr(native_class=True) class Dirent(Saveable): """ Define a file or subdirectory that must be staged to a particular @@ -17251,6 +17308,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["entryname", "entry", "writable"]) +@mypyc_attr(native_class=True) class InitialWorkDirRequirement(Saveable): """ Define a list of files and subdirectories that must be staged by the workflow platform prior to executing the command line tool. @@ -17426,6 +17484,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "listing"]) +@mypyc_attr(native_class=True) class EnvVarRequirement(Saveable): """ Define a list of environment variables which will be set in the @@ -17602,6 +17661,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "envDef"]) +@mypyc_attr(native_class=True) class ShellCommandRequirement(Saveable): """ Modify the behavior of CommandLineTool to generate a single string @@ -17726,6 +17786,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class"]) +@mypyc_attr(native_class=True) class ResourceRequirement(Saveable): """ Specify basic hardware resource requirements. @@ -18348,6 +18409,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class WorkReuse(Saveable): """ For implementations that support reusing output from past work (on @@ -18536,6 +18598,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "enableReuse"]) +@mypyc_attr(native_class=True) class NetworkAccess(Saveable): """ Indicate whether a process requires outgoing IPv4/IPv6 network @@ -18731,6 +18794,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "networkAccess"]) +@mypyc_attr(native_class=True) class InplaceUpdateRequirement(Saveable): """ @@ -18941,6 +19005,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "inplaceUpdate"]) +@mypyc_attr(native_class=True) class ToolTimeLimit(Saveable): """ Set an upper limit on the execution time of a CommandLineTool. @@ -19127,6 +19192,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "timelimit"]) +@mypyc_attr(native_class=True) class ExpressionToolOutputParameter(Saveable): id: str @@ -19632,6 +19698,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class WorkflowInputParameter(Saveable): id: str @@ -20382,6 +20449,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class ExpressionTool(Saveable): """ An ExpressionTool is a type of Process object that can be run by itself @@ -21105,6 +21173,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class WorkflowOutputParameter(Saveable): """ Describe an output parameter of a workflow. The parameter must be @@ -21799,6 +21868,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class WorkflowStepInput(Saveable): """ The input of a workflow step connects an upstream parameter (from the @@ -22537,6 +22607,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class WorkflowStepOutput(Saveable): """ Associate an output parameter of the underlying process with a workflow @@ -22702,6 +22773,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["id"]) +@mypyc_attr(native_class=True) class WorkflowStep(Saveable): """ A workflow step is an executable element of a workflow. It specifies the @@ -23526,6 +23598,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class Workflow(Saveable): """ A workflow describes a set of **steps** and the **dependencies** between @@ -24290,6 +24363,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class SubworkflowFeatureRequirement(Saveable): """ Indicates that the workflow platform must support nested workflows in @@ -24409,6 +24483,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class"]) +@mypyc_attr(native_class=True) class ScatterFeatureRequirement(Saveable): """ Indicates that the workflow platform must support the `scatter` and @@ -24528,6 +24603,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class"]) +@mypyc_attr(native_class=True) class MultipleInputFeatureRequirement(Saveable): """ Indicates that the workflow platform must support multiple inbound data links @@ -24647,6 +24723,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class"]) +@mypyc_attr(native_class=True) class StepInputExpressionRequirement(Saveable): """ Indicate that the workflow platform must support the `valueFrom` field @@ -24766,6 +24843,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class"]) +@mypyc_attr(native_class=True) class OperationInputParameter(Saveable): """ Describe an input parameter of an operation. @@ -25461,6 +25539,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class OperationOutputParameter(Saveable): """ Describe an output parameter of an operation. @@ -25971,6 +26050,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class Operation(Saveable): """ This record describes an abstract operation. It is a potential @@ -26633,6 +26713,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class Secrets(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, Secrets): @@ -26802,6 +26883,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "secrets"]) +@mypyc_attr(native_class=True) class ProcessGenerator(Saveable): id: str @@ -27512,6 +27594,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class MPIRequirement(Saveable): """ Indicates that a process requires an MPI runtime. @@ -27692,6 +27775,7 @@ def __init__( attrs: ClassVar[Collection[str]] = frozenset(["class", "processes"]) +@mypyc_attr(native_class=True) class CUDARequirement(Saveable): """ Require support for NVIDA CUDA (GPU hardware acceleration). @@ -28064,6 +28148,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class LoopInput(Saveable): id: str @@ -28505,6 +28590,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class Loop(Saveable): """ Prototype to enable workflow-level looping of a step. @@ -28811,6 +28897,7 @@ def __init__( ) +@mypyc_attr(native_class=True) class ShmSize(Saveable): def __eq__(self, other: Any) -> bool: if isinstance(other, ShmSize): From 41f3078abe9e573cadee344a66278407317f25b5 Mon Sep 17 00:00:00 2001 From: GlassOfWhiskey Date: Sun, 5 Apr 2026 22:40:25 +0200 Subject: [PATCH 20/22] Regenerate parsers with explicit Enum types --- cwl_utils/parser/__init__.py | 4 +- cwl_utils/parser/cwl_v1_0.py | 1092 +++++++--------------------- cwl_utils/parser/cwl_v1_0_utils.py | 62 +- cwl_utils/parser/cwl_v1_1.py | 1034 ++++++++------------------ cwl_utils/parser/cwl_v1_1_utils.py | 75 +- cwl_utils/parser/cwl_v1_2.py | 1079 ++++++++------------------- cwl_utils/parser/cwl_v1_2_utils.py | 75 +- cwl_utils/parser/utils.py | 11 +- cwl_utils/utils.py | 11 +- 9 files changed, 906 insertions(+), 2537 deletions(-) diff --git a/cwl_utils/parser/__init__.py b/cwl_utils/parser/__init__.py index c77a6be9..a26797a7 100644 --- a/cwl_utils/parser/__init__.py +++ b/cwl_utils/parser/__init__.py @@ -256,7 +256,9 @@ class NoType(ABC): ) """Type Union for a CWL v1.x SchemaDefRequirement object.""" __T = TypeVar("__T", covariant=True) -_Loader: TypeAlias = cwl_v1_0._Loader[__T] | cwl_v1_1._Loader[__T] | cwl_v1_2._Loader[__T] +_Loader: TypeAlias = ( + cwl_v1_0._Loader[__T] | cwl_v1_1._Loader[__T] | cwl_v1_2._Loader[__T] +) """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 5d522ff2..02fe801e 100644 --- a/cwl_utils/parser/cwl_v1_0.py +++ b/cwl_utils/parser/cwl_v1_0.py @@ -1455,7 +1455,7 @@ def save( def __init__( self, 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, + type_: ArraySchema | EnumSchema | MapSchema | PrimitiveType | RecordSchema | Sequence[ArraySchema | EnumSchema | MapSchema | PrimitiveType | RecordSchema | UnionSchema | str] | UnionSchema | str, doc: None | Sequence[str] | str = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, @@ -1656,7 +1656,7 @@ def save( def __init__( self, - type_: Literal["record"], + type_: Record_name, fields: None | Sequence[RecordField] = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, @@ -1928,7 +1928,7 @@ def save( def __init__( self, symbols: Sequence[str], - type_: Literal["enum"], + type_: Enum_name, name: None | str = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, @@ -2129,8 +2129,8 @@ def save( def __init__( 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, - type_: Literal["array"], + items: ArraySchema | EnumSchema | MapSchema | PrimitiveType | RecordSchema | Sequence[ArraySchema | EnumSchema | MapSchema | PrimitiveType | RecordSchema | UnionSchema | str] | UnionSchema | str, + type_: Array_name, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -2329,8 +2329,8 @@ def save( def __init__( self, - 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, + type_: Map_name, + values: ArraySchema | EnumSchema | MapSchema | PrimitiveType | RecordSchema | Sequence[ArraySchema | EnumSchema | MapSchema | PrimitiveType | RecordSchema | UnionSchema | str] | UnionSchema | str, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -2529,8 +2529,8 @@ def save( def __init__( 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, - type_: Literal["union"], + names: ArraySchema | EnumSchema | MapSchema | PrimitiveType | RecordSchema | Sequence[ArraySchema | EnumSchema | MapSchema | PrimitiveType | RecordSchema | UnionSchema | str] | UnionSchema | str, + type_: Union_name, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -2729,8 +2729,8 @@ def save( def __init__( 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, - type_: Literal["array"], + items: CWLArraySchema | CWLRecordSchema | EnumSchema | PrimitiveType | Sequence[CWLArraySchema | CWLRecordSchema | EnumSchema | PrimitiveType | str] | str, + type_: Array_name, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -2997,7 +2997,7 @@ def save( def __init__( self, 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, + type_: CWLArraySchema | CWLRecordSchema | EnumSchema | PrimitiveType | Sequence[CWLArraySchema | CWLRecordSchema | EnumSchema | PrimitiveType | str] | str, doc: None | Sequence[str] | str = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, @@ -3198,7 +3198,7 @@ def save( def __init__( self, - type_: Literal["record"], + type_: Record_name, fields: None | Sequence[CWLRecordField] = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, @@ -4785,7 +4785,7 @@ def save( 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, + type_: CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | Sequence[CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | str] | str, doc: None | Sequence[str] | str = None, inputBinding: CommandLineBinding | None = None, label: None | str = None, @@ -5111,7 +5111,7 @@ def save( def __init__( self, - type_: Literal["record"], + type_: Record_name, fields: None | Sequence[InputRecordField] = None, label: None | str = None, name: None | str = None, @@ -5493,7 +5493,7 @@ def save( def __init__( self, symbols: Sequence[str], - type_: Literal["enum"], + type_: Enum_name, name: None | str = None, label: None | str = None, inputBinding: CommandLineBinding | None = None, @@ -5812,8 +5812,8 @@ def save( def __init__( 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, - type_: Literal["array"], + items: CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | Sequence[CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | str] | str, + type_: Array_name, label: None | str = None, inputBinding: CommandLineBinding | None = None, extension_fields: MutableMapping[str, Any] | None = None, @@ -6142,7 +6142,7 @@ def save( def __init__( self, 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, + type_: CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str, doc: None | Sequence[str] | str = None, outputBinding: CommandOutputBinding | None = None, extension_fields: MutableMapping[str, Any] | None = None, @@ -6403,7 +6403,7 @@ def save( def __init__( self, - type_: Literal["record"], + type_: Record_name, fields: None | Sequence[OutputRecordField] = None, label: None | str = None, extension_fields: MutableMapping[str, Any] | None = None, @@ -6783,7 +6783,7 @@ def save( def __init__( self, symbols: Sequence[str], - type_: Literal["enum"], + type_: Enum_name, name: None | str = None, label: None | str = None, outputBinding: CommandOutputBinding | None = None, @@ -7102,8 +7102,8 @@ def save( 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"], + items: CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str, + type_: Array_name, label: None | str = None, outputBinding: CommandOutputBinding | None = None, extension_fields: MutableMapping[str, Any] | None = None, @@ -7720,7 +7720,7 @@ def __init__( 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, + type_: CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | None | Sequence[CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | str] | str = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -10031,7 +10031,7 @@ def save( 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, + type_: CWLType | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Sequence[CWLType | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | str] | str, doc: None | Sequence[str] | str = None, inputBinding: CommandLineBinding | None = None, label: None | str = None, @@ -10357,7 +10357,7 @@ def save( def __init__( self, - type_: Literal["record"], + type_: Record_name, fields: None | Sequence[CommandInputRecordField] = None, label: None | str = None, name: None | str = None, @@ -10739,7 +10739,7 @@ def save( def __init__( self, symbols: Sequence[str], - type_: Literal["enum"], + type_: Enum_name, name: None | str = None, label: None | str = None, inputBinding: CommandLineBinding | None = None, @@ -11058,8 +11058,8 @@ def save( def __init__( 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, - type_: Literal["array"], + items: CWLType | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Sequence[CWLType | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | str] | str, + type_: Array_name, label: None | str = None, inputBinding: CommandLineBinding | None = None, extension_fields: MutableMapping[str, Any] | None = None, @@ -11388,7 +11388,7 @@ def save( 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, + type_: CWLType | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Sequence[CWLType | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | str] | str, doc: None | Sequence[str] | str = None, outputBinding: CommandOutputBinding | None = None, extension_fields: MutableMapping[str, Any] | None = None, @@ -11712,7 +11712,7 @@ def save( def __init__( self, - type_: Literal["record"], + type_: Record_name, fields: None | Sequence[CommandOutputRecordField] = None, label: None | str = None, name: None | str = None, @@ -12094,7 +12094,7 @@ def save( def __init__( self, symbols: Sequence[str], - type_: Literal["enum"], + type_: Enum_name, name: None | str = None, label: None | str = None, outputBinding: CommandOutputBinding | None = None, @@ -12413,8 +12413,8 @@ def save( def __init__( 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, - type_: Literal["array"], + items: CWLType | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Sequence[CWLType | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | str] | str, + type_: Array_name, label: None | str = None, outputBinding: CommandOutputBinding | None = None, extension_fields: MutableMapping[str, Any] | None = None, @@ -13035,7 +13035,7 @@ def __init__( 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, + type_: CWLType | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | None | Sequence[CWLType | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | str] | str = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -13614,7 +13614,7 @@ def __init__( 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, + type_: CWLType | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | None | Sequence[CWLType | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | str] | stderr | stdout | str = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -14657,7 +14657,7 @@ def __init__( 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, + cwlVersion: CWLVersion | None = None, baseCommand: None | Sequence[str] | str = None, arguments: None | Sequence[CommandLineBinding | str] = None, stdin: None | str = None, @@ -17577,7 +17577,7 @@ def __init__( 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, + type_: CWLType | None | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -18235,7 +18235,7 @@ def __init__( 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, + cwlVersion: CWLVersion | None = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -18927,8 +18927,8 @@ def __init__( 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, + linkMerge: LinkMergeMethod | None = None, + type_: CWLType | None | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -19366,7 +19366,7 @@ def __init__( self, id: str, source: None | Sequence[str] | str = None, - linkMerge: Literal["merge_nested", "merge_flattened"] | None = None, + linkMerge: LinkMergeMethod | None = None, default: CWLObjectType | None = None, valueFrom: None | str = None, extension_fields: MutableMapping[str, Any] | None = None, @@ -20256,7 +20256,7 @@ def __init__( label: None | str = None, doc: None | str = None, scatter: None | Sequence[str] | str = None, - scatterMethod: Literal["dotproduct", "nested_crossproduct", "flat_crossproduct"] | None = None, + scatterMethod: None | ScatterMethod = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -20959,7 +20959,7 @@ def __init__( 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, + cwlVersion: CWLVersion | None = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -21636,7 +21636,7 @@ def save( def __init__( self, - loadListing: Literal["no_listing", "shallow_listing", "deep_listing"], + loadListing: LoadListingEnum, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -23184,7 +23184,7 @@ def __init__( 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, + cwlVersion: CWLVersion | None = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -24178,9 +24178,10 @@ def __init__( None_type: Final[_Loader[None]] = _PrimitiveLoader(type(None)) Any_type: Final[_Loader[Any]] = _AnyLoader() longtype: Final[_Loader[i64]] = _PrimitiveLoader(i64) -PrimitiveTypeLoader: Final[ - _Loader[Literal["null", "boolean", "int", "long", "float", "double", "string"]] -] = _EnumLoader( +PrimitiveType: TypeAlias = Literal[ + "null", "boolean", "int", "long", "float", "double", "string" +] +PrimitiveTypeLoader: Final[_Loader[PrimitiveType]] = _EnumLoader( ( "null", "boolean", @@ -24206,7 +24207,8 @@ def __init__( double: double precision (64-bit) IEEE 754 floating-point number string: Unicode character sequence """ -AnyLoader: Final[_Loader[Literal["Any"]]] = _EnumLoader(("Any",), "Any") +Any_: TypeAlias = Literal["Any"] +Any_Loader: Final[_Loader[Any_]] = _EnumLoader(("Any",), "Any_") """ The **Any** type validates for any non-null value. """ @@ -24218,21 +24220,10 @@ def __init__( ArraySchemaLoader: Final[_Loader[ArraySchema]] = _RecordLoader(ArraySchema, None, None) MapSchemaLoader: Final[_Loader[MapSchema]] = _RecordLoader(MapSchema, None, None) UnionSchemaLoader: Final[_Loader[UnionSchema]] = _RecordLoader(UnionSchema, None, None) -CWLTypeLoader: Final[ - _Loader[ - Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - ] -] = _EnumLoader( +CWLType: TypeAlias = Literal[ + "null", "boolean", "int", "long", "float", "double", "string", "File", "Directory" +] +CWLTypeLoader: Final[_Loader[CWLType]] = _EnumLoader( ( "null", "boolean", @@ -24280,11 +24271,13 @@ def __init__( CWLInputFileLoader: Final[_Loader[Mapping[str, CWLObjectType | None]]] = ( map_of_union_of_None_type_or_CWLObjectTypeLoader ) -CWLVersionLoader: Final[_Loader[Literal["v1.0"]]] = _EnumLoader(("v1.0",), "CWLVersion") +CWLVersion: TypeAlias = Literal["v1.0"] +CWLVersionLoader: Final[_Loader[CWLVersion]] = _EnumLoader(("v1.0",), "CWLVersion") """ Current version symbol for CWL documents. """ -ExpressionLoader = _ExpressionLoader(str) +Expression: TypeAlias = Literal["ExpressionPlaceholder"] +ExpressionLoader: Final[_Loader[str]] = _ExpressionLoader(str) InputRecordFieldLoader: Final[_Loader[InputRecordField]] = _RecordLoader( InputRecordField, None, None ) @@ -24360,7 +24353,8 @@ def __init__( CommandOutputParameterLoader: Final[_Loader[CommandOutputParameter]] = _RecordLoader( CommandOutputParameter, None, None ) -stdoutLoader: Final[_Loader[Literal["stdout"]]] = _EnumLoader(("stdout",), "stdout") +stdout: TypeAlias = Literal["stdout"] +stdoutLoader: Final[_Loader[stdout]] = _EnumLoader(("stdout",), "stdout") """ Only valid as a `type` for a `CommandLineTool` output with no `outputBinding` set. @@ -24404,7 +24398,8 @@ def __init__( stdout: random_stdout_filenameABCDEFG ``` """ -stderrLoader: Final[_Loader[Literal["stderr"]]] = _EnumLoader(("stderr",), "stderr") +stderr: TypeAlias = Literal["stderr"] +stderrLoader: Final[_Loader[stderr]] = _EnumLoader(("stderr",), "stderr") """ Only valid as a `type` for a `CommandLineTool` output with no `outputBinding` set. @@ -24479,14 +24474,13 @@ def __init__( ExpressionToolLoader: Final[_Loader[ExpressionTool]] = _RecordLoader( ExpressionTool, None, None ) -LinkMergeMethodLoader: Final[_Loader[Literal["merge_nested", "merge_flattened"]]] = ( - _EnumLoader( - ( - "merge_nested", - "merge_flattened", - ), - "LinkMergeMethod", - ) +LinkMergeMethod: TypeAlias = Literal["merge_nested", "merge_flattened"] +LinkMergeMethodLoader: Final[_Loader[LinkMergeMethod]] = _EnumLoader( + ( + "merge_nested", + "merge_flattened", + ), + "LinkMergeMethod", ) """ The input link merge method, described in [WorkflowStepInput](#WorkflowStepInput). @@ -24500,9 +24494,10 @@ def __init__( WorkflowStepOutputLoader: Final[_Loader[WorkflowStepOutput]] = _RecordLoader( WorkflowStepOutput, None, None ) -ScatterMethodLoader: Final[ - _Loader[Literal["dotproduct", "nested_crossproduct", "flat_crossproduct"]] -] = _EnumLoader( +ScatterMethod: TypeAlias = Literal[ + "dotproduct", "nested_crossproduct", "flat_crossproduct" +] +ScatterMethodLoader: Final[_Loader[ScatterMethod]] = _EnumLoader( ( "dotproduct", "nested_crossproduct", @@ -24568,8 +24563,8 @@ def __init__( _Loader[ ArraySchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema + | PrimitiveType | RecordSchema | UnionSchema | str @@ -24590,8 +24585,8 @@ def __init__( Sequence[ ArraySchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema + | PrimitiveType | RecordSchema | UnionSchema | str @@ -24604,14 +24599,14 @@ def __init__( _Loader[ ArraySchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema + | PrimitiveType | RecordSchema | Sequence[ ArraySchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema + | PrimitiveType | RecordSchema | UnionSchema | str @@ -24635,14 +24630,14 @@ def __init__( _Loader[ ArraySchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema + | PrimitiveType | RecordSchema | Sequence[ ArraySchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema + | PrimitiveType | RecordSchema | UnionSchema | str @@ -24669,10 +24664,9 @@ def __init__( idmap_fields_union_of_None_type_or_array_of_RecordFieldLoader: Final[ _Loader[None | Sequence[RecordField]] ] = _IdMapLoader(union_of_None_type_or_array_of_RecordFieldLoader, "name", "type") -Record_nameLoader: Final[_Loader[Literal["record"]]] = _EnumLoader( - ("record",), "Record_name" -) -typedsl_Record_nameLoader_2: Final[_Loader[Literal["record"]]] = _TypeDSLLoader( +Record_name: TypeAlias = Literal["record"] +Record_nameLoader: Final[_Loader[Record_name]] = _EnumLoader(("record",), "Record_name") +typedsl_Record_nameLoader_2: Final[_Loader[Record_name]] = _TypeDSLLoader( Record_nameLoader, 2, "v1.1" ) union_of_None_type_or_strtype: Final[_Loader[None | str]] = _UnionLoader( @@ -24687,22 +24681,23 @@ def __init__( uri_array_of_strtype_True_False_None_None: Final[_Loader[Sequence[str]]] = _URILoader( array_of_strtype, True, False, None, None ) -Enum_nameLoader: Final[_Loader[Literal["enum"]]] = _EnumLoader(("enum",), "Enum_name") -typedsl_Enum_nameLoader_2: Final[_Loader[Literal["enum"]]] = _TypeDSLLoader( +Enum_name: TypeAlias = Literal["enum"] +Enum_nameLoader: Final[_Loader[Enum_name]] = _EnumLoader(("enum",), "Enum_name") +typedsl_Enum_nameLoader_2: Final[_Loader[Enum_name]] = _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[ _Loader[ ArraySchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema + | PrimitiveType | RecordSchema | Sequence[ ArraySchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema + | PrimitiveType | RecordSchema | UnionSchema | str @@ -24717,30 +24712,23 @@ def __init__( 2, None, ) -Array_nameLoader: Final[_Loader[Literal["array"]]] = _EnumLoader( - ("array",), "Array_name" -) -typedsl_Array_nameLoader_2: Final[_Loader[Literal["array"]]] = _TypeDSLLoader( +Array_name: TypeAlias = Literal["array"] +Array_nameLoader: Final[_Loader[Array_name]] = _EnumLoader(("array",), "Array_name") +typedsl_Array_nameLoader_2: Final[_Loader[Array_name]] = _TypeDSLLoader( Array_nameLoader, 2, "v1.1" ) -Map_nameLoader: Final[_Loader[Literal["map"]]] = _EnumLoader(("map",), "Map_name") -typedsl_Map_nameLoader_2: Final[_Loader[Literal["map"]]] = _TypeDSLLoader( +Map_name: TypeAlias = Literal["map"] +Map_nameLoader: Final[_Loader[Map_name]] = _EnumLoader(("map",), "Map_name") +typedsl_Map_nameLoader_2: Final[_Loader[Map_name]] = _TypeDSLLoader( Map_nameLoader, 2, "v1.1" ) -Union_nameLoader: Final[_Loader[Literal["union"]]] = _EnumLoader( - ("union",), "Union_name" -) -typedsl_Union_nameLoader_2: Final[_Loader[Literal["union"]]] = _TypeDSLLoader( +Union_name: TypeAlias = Literal["union"] +Union_nameLoader: Final[_Loader[Union_name]] = _EnumLoader(("union",), "Union_name") +typedsl_Union_nameLoader_2: Final[_Loader[Union_name]] = _TypeDSLLoader( Union_nameLoader, 2, "v1.1" ) union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype: Final[ - _Loader[ - CWLArraySchema - | CWLRecordSchema - | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] - | str - ] + _Loader[CWLArraySchema | CWLRecordSchema | EnumSchema | PrimitiveType | str] ] = _UnionLoader( ( PrimitiveTypeLoader, @@ -24752,13 +24740,7 @@ def __init__( ) array_of_union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype: Final[ _Loader[ - Sequence[ - CWLArraySchema - | CWLRecordSchema - | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] - | str - ] + Sequence[CWLArraySchema | CWLRecordSchema | EnumSchema | PrimitiveType | str] ] ] = _ArrayLoader( union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype @@ -24768,14 +24750,8 @@ def __init__( CWLArraySchema | CWLRecordSchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] - | Sequence[ - CWLArraySchema - | CWLRecordSchema - | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] - | str - ] + | PrimitiveType + | Sequence[CWLArraySchema | CWLRecordSchema | EnumSchema | PrimitiveType | str] | str ] ] = _UnionLoader( @@ -24793,14 +24769,8 @@ def __init__( CWLArraySchema | CWLRecordSchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] - | Sequence[ - CWLArraySchema - | CWLRecordSchema - | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] - | str - ] + | PrimitiveType + | Sequence[CWLArraySchema | CWLRecordSchema | EnumSchema | PrimitiveType | str] | str ] ] = _URILoader( @@ -24815,14 +24785,8 @@ def __init__( CWLArraySchema | CWLRecordSchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] - | Sequence[ - CWLArraySchema - | CWLRecordSchema - | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] - | str - ] + | PrimitiveType + | Sequence[CWLArraySchema | CWLRecordSchema | EnumSchema | PrimitiveType | str] | str ] ] = _TypeDSLLoader( @@ -24844,8 +24808,9 @@ def __init__( idmap_fields_union_of_None_type_or_array_of_CWLRecordFieldLoader: Final[ _Loader[None | Sequence[CWLRecordField]] ] = _IdMapLoader(union_of_None_type_or_array_of_CWLRecordFieldLoader, "name", "type") -File_classLoader: Final[_Loader[Literal["File"]]] = _EnumLoader(("File",), "File_class") -uri_File_classLoader_False_True_None_None: Final[_Loader[Literal["File"]]] = _URILoader( +File_class: TypeAlias = Literal["File"] +File_classLoader: Final[_Loader[File_class]] = _EnumLoader(("File",), "File_class") +uri_File_classLoader_False_True_None_None: Final[_Loader[File_class]] = _URILoader( File_classLoader, False, True, None, None ) uri_union_of_None_type_or_strtype_False_False_None_None: Final[_Loader[None | str]] = ( @@ -24878,10 +24843,11 @@ def __init__( uri_union_of_None_type_or_strtype_True_False_None_True: Final[_Loader[None | str]] = ( _URILoader(union_of_None_type_or_strtype, True, False, None, True) ) -Directory_classLoader: Final[_Loader[Literal["Directory"]]] = _EnumLoader( +Directory_class: TypeAlias = Literal["Directory"] +Directory_classLoader: Final[_Loader[Directory_class]] = _EnumLoader( ("Directory",), "Directory_class" ) -uri_Directory_classLoader_False_True_None_None: Final[_Loader[Literal["Directory"]]] = ( +uri_Directory_classLoader_False_True_None_None: Final[_Loader[Directory_class]] = ( _URILoader(Directory_classLoader, False, True, None, None) ) union_of_strtype_or_ExpressionLoader: Final[_Loader[str]] = _UnionLoader( @@ -24910,23 +24876,7 @@ def __init__( ) ) union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype: Final[ - _Loader[ - InputArraySchema - | InputEnumSchema - | InputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | str - ] + _Loader[CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | str] ] = _UnionLoader( ( CWLTypeLoader, @@ -24938,59 +24888,19 @@ def __init__( ) array_of_union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype: Final[ _Loader[ - Sequence[ - InputArraySchema - | InputEnumSchema - | InputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | str - ] + Sequence[CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | str] ] ] = _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: Final[ _Loader[ - InputArraySchema + CWLType + | 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 + CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | str ] | str ] @@ -25006,36 +24916,12 @@ def __init__( ) 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[ _Loader[ - InputArraySchema + CWLType + | 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 + CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | str ] | str ] @@ -25068,36 +24954,12 @@ def __init__( ] = _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: Final[ _Loader[ - InputArraySchema + CWLType + | 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 + CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | str ] | str ] @@ -25109,23 +24971,7 @@ def __init__( None, ) union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype: Final[ - _Loader[ - Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | OutputArraySchema - | OutputEnumSchema - | OutputRecordSchema - | str - ] + _Loader[CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] ] = _UnionLoader( ( CWLTypeLoader, @@ -25138,21 +24984,7 @@ def __init__( array_of_union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype: Final[ _Loader[ Sequence[ - Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | OutputArraySchema - | OutputEnumSchema - | OutputRecordSchema - | str + CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str ] ] ] = _ArrayLoader( @@ -25160,36 +24992,12 @@ def __init__( ) 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[ _Loader[ - Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] + CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[ - Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | OutputArraySchema - | OutputEnumSchema - | OutputRecordSchema - | str + CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str ] | str ] @@ -25205,36 +25013,12 @@ def __init__( ) 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[ _Loader[ - Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] + CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[ - Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | OutputArraySchema - | OutputEnumSchema - | OutputRecordSchema - | str + CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str ] | str ] @@ -25267,36 +25051,12 @@ def __init__( ] = _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: Final[ _Loader[ - Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] + CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[ - Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | OutputArraySchema - | OutputEnumSchema - | OutputRecordSchema - | str + CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str ] | str ] @@ -25328,37 +25088,13 @@ def __init__( ) 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[ _Loader[ - InputArraySchema + CWLType + | 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 + CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | str ] | str ] @@ -25375,37 +25111,13 @@ def __init__( ) 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[ _Loader[ - InputArraySchema + CWLType + | 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 + CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | str ] | str ] @@ -25731,7 +25443,7 @@ def __init__( "class", "None", ) -union_of_None_type_or_CWLVersionLoader: Final[_Loader[Literal["v1.0"] | None]] = ( +union_of_None_type_or_CWLVersionLoader: Final[_Loader[CWLVersion | None]] = ( _UnionLoader( ( None_type, @@ -25740,13 +25452,14 @@ def __init__( ) ) uri_union_of_None_type_or_CWLVersionLoader_False_True_None_None: Final[ - _Loader[Literal["v1.0"] | None] + _Loader[CWLVersion | None] ] = _URILoader(union_of_None_type_or_CWLVersionLoader, False, True, None, None) +InlineJavascriptRequirement_class: TypeAlias = Literal["InlineJavascriptRequirement"] InlineJavascriptRequirement_classLoader: Final[ - _Loader[Literal["InlineJavascriptRequirement"]] + _Loader[InlineJavascriptRequirement_class] ] = _EnumLoader(("InlineJavascriptRequirement",), "InlineJavascriptRequirement_class") uri_InlineJavascriptRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["InlineJavascriptRequirement"]] + _Loader[InlineJavascriptRequirement_class] ] = _URILoader(InlineJavascriptRequirement_classLoader, False, True, None, None) union_of_None_type_or_array_of_strtype: Final[_Loader[None | Sequence[str]]] = ( _UnionLoader( @@ -25756,11 +25469,12 @@ def __init__( ) ) ) -SchemaDefRequirement_classLoader: Final[_Loader[Literal["SchemaDefRequirement"]]] = ( +SchemaDefRequirement_class: TypeAlias = Literal["SchemaDefRequirement"] +SchemaDefRequirement_classLoader: Final[_Loader[SchemaDefRequirement_class]] = ( _EnumLoader(("SchemaDefRequirement",), "SchemaDefRequirement_class") ) uri_SchemaDefRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["SchemaDefRequirement"]] + _Loader[SchemaDefRequirement_class] ] = _URILoader(SchemaDefRequirement_classLoader, False, True, None, None) union_of_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader: ( Final[_Loader[InputArraySchema | InputEnumSchema | InputRecordSchema]] @@ -25794,20 +25508,10 @@ def __init__( ) union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype: Final[ _Loader[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] ] = _UnionLoader( @@ -25822,20 +25526,10 @@ def __init__( array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype: Final[ _Loader[ Sequence[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] ] @@ -25844,35 +25538,15 @@ def __init__( ) 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[ _Loader[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | Sequence[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] | str @@ -25889,35 +25563,15 @@ def __init__( ) 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[ _Loader[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | Sequence[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] | str @@ -25945,35 +25599,15 @@ def __init__( ) 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[ _Loader[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | Sequence[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] | str @@ -25987,20 +25621,10 @@ def __init__( ) union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype: Final[ _Loader[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] ] = _UnionLoader( @@ -26015,20 +25639,10 @@ def __init__( array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype: Final[ _Loader[ Sequence[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] ] @@ -26037,35 +25651,15 @@ def __init__( ) 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[ _Loader[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | Sequence[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] | str @@ -26082,35 +25676,15 @@ def __init__( ) 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[ _Loader[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | Sequence[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] | str @@ -26138,35 +25712,15 @@ def __init__( ) 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[ _Loader[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | Sequence[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] | str @@ -26180,36 +25734,16 @@ def __init__( ) 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[ _Loader[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | None | Sequence[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] | str @@ -26227,36 +25761,16 @@ def __init__( ) 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[ _Loader[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | None | Sequence[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] | str @@ -26268,40 +25782,20 @@ def __init__( ) 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[ _Loader[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | Literal["stderr"] - | Literal["stdout"] | None | Sequence[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] + | stderr + | stdout | str ] ] = _UnionLoader( @@ -26319,40 +25813,20 @@ def __init__( ) 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[ _Loader[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | Literal["stderr"] - | Literal["stdout"] | None | Sequence[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] + | stderr + | stdout | str ] ] = _TypeDSLLoader( @@ -26360,11 +25834,12 @@ def __init__( 2, "v1.1", ) -CommandLineTool_classLoader: Final[_Loader[Literal["CommandLineTool"]]] = _EnumLoader( +CommandLineTool_class: TypeAlias = Literal["CommandLineTool"] +CommandLineTool_classLoader: Final[_Loader[CommandLineTool_class]] = _EnumLoader( ("CommandLineTool",), "CommandLineTool_class" ) uri_CommandLineTool_classLoader_False_True_None_None: Final[ - _Loader[Literal["CommandLineTool"]] + _Loader[CommandLineTool_class] ] = _URILoader(CommandLineTool_classLoader, False, True, None, None) array_of_CommandInputParameterLoader: Final[ _Loader[Sequence[CommandInputParameter]] @@ -26407,17 +25882,19 @@ def __init__( ) ) ) -DockerRequirement_classLoader: Final[_Loader[Literal["DockerRequirement"]]] = ( - _EnumLoader(("DockerRequirement",), "DockerRequirement_class") +DockerRequirement_class: TypeAlias = Literal["DockerRequirement"] +DockerRequirement_classLoader: Final[_Loader[DockerRequirement_class]] = _EnumLoader( + ("DockerRequirement",), "DockerRequirement_class" ) uri_DockerRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["DockerRequirement"]] + _Loader[DockerRequirement_class] ] = _URILoader(DockerRequirement_classLoader, False, True, None, None) -SoftwareRequirement_classLoader: Final[_Loader[Literal["SoftwareRequirement"]]] = ( +SoftwareRequirement_class: TypeAlias = Literal["SoftwareRequirement"] +SoftwareRequirement_classLoader: Final[_Loader[SoftwareRequirement_class]] = ( _EnumLoader(("SoftwareRequirement",), "SoftwareRequirement_class") ) uri_SoftwareRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["SoftwareRequirement"]] + _Loader[SoftwareRequirement_class] ] = _URILoader(SoftwareRequirement_classLoader, False, True, None, None) array_of_SoftwarePackageLoader: Final[_Loader[Sequence[SoftwarePackage]]] = ( _ArrayLoader(SoftwarePackageLoader) @@ -26428,11 +25905,12 @@ def __init__( uri_union_of_None_type_or_array_of_strtype_False_False_None_True: Final[ _Loader[None | Sequence[str]] ] = _URILoader(union_of_None_type_or_array_of_strtype, False, False, None, True) +InitialWorkDirRequirement_class: TypeAlias = Literal["InitialWorkDirRequirement"] InitialWorkDirRequirement_classLoader: Final[ - _Loader[Literal["InitialWorkDirRequirement"]] + _Loader[InitialWorkDirRequirement_class] ] = _EnumLoader(("InitialWorkDirRequirement",), "InitialWorkDirRequirement_class") uri_InitialWorkDirRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["InitialWorkDirRequirement"]] + _Loader[InitialWorkDirRequirement_class] ] = _URILoader(InitialWorkDirRequirement_classLoader, False, True, None, None) union_of_FileLoader_or_DirectoryLoader_or_DirentLoader_or_strtype_or_ExpressionLoader: ( Final[_Loader[Directory | Dirent | File | str]] @@ -26459,11 +25937,12 @@ def __init__( ExpressionLoader, ) ) -EnvVarRequirement_classLoader: Final[_Loader[Literal["EnvVarRequirement"]]] = ( - _EnumLoader(("EnvVarRequirement",), "EnvVarRequirement_class") +EnvVarRequirement_class: TypeAlias = Literal["EnvVarRequirement"] +EnvVarRequirement_classLoader: Final[_Loader[EnvVarRequirement_class]] = _EnumLoader( + ("EnvVarRequirement",), "EnvVarRequirement_class" ) uri_EnvVarRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["EnvVarRequirement"]] + _Loader[EnvVarRequirement_class] ] = _URILoader(EnvVarRequirement_classLoader, False, True, None, None) array_of_EnvironmentDefLoader: Final[_Loader[Sequence[EnvironmentDef]]] = _ArrayLoader( EnvironmentDefLoader @@ -26471,17 +25950,19 @@ def __init__( idmap_envDef_array_of_EnvironmentDefLoader: Final[_Loader[Sequence[EnvironmentDef]]] = ( _IdMapLoader(array_of_EnvironmentDefLoader, "envName", "envValue") ) -ShellCommandRequirement_classLoader: Final[ - _Loader[Literal["ShellCommandRequirement"]] -] = _EnumLoader(("ShellCommandRequirement",), "ShellCommandRequirement_class") +ShellCommandRequirement_class: TypeAlias = Literal["ShellCommandRequirement"] +ShellCommandRequirement_classLoader: Final[_Loader[ShellCommandRequirement_class]] = ( + _EnumLoader(("ShellCommandRequirement",), "ShellCommandRequirement_class") +) uri_ShellCommandRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["ShellCommandRequirement"]] + _Loader[ShellCommandRequirement_class] ] = _URILoader(ShellCommandRequirement_classLoader, False, True, None, None) -ResourceRequirement_classLoader: Final[_Loader[Literal["ResourceRequirement"]]] = ( +ResourceRequirement_class: TypeAlias = Literal["ResourceRequirement"] +ResourceRequirement_classLoader: Final[_Loader[ResourceRequirement_class]] = ( _EnumLoader(("ResourceRequirement",), "ResourceRequirement_class") ) uri_ResourceRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["ResourceRequirement"]] + _Loader[ResourceRequirement_class] ] = _URILoader(ResourceRequirement_classLoader, False, True, None, None) union_of_None_type_or_inttype_or_inttype_or_strtype_or_ExpressionLoader: Final[ _Loader[None | i32 | str] @@ -26506,37 +25987,13 @@ def __init__( ) 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[ _Loader[ - Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] + CWLType | None | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[ - Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | OutputArraySchema - | OutputEnumSchema - | OutputRecordSchema - | str + CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str ] | str ] @@ -26553,37 +26010,13 @@ def __init__( ) 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[ _Loader[ - Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] + CWLType | None | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[ - Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | OutputArraySchema - | OutputEnumSchema - | OutputRecordSchema - | str + CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str ] | str ] @@ -26592,11 +26025,12 @@ def __init__( 2, "v1.1", ) -ExpressionTool_classLoader: Final[_Loader[Literal["ExpressionTool"]]] = _EnumLoader( +ExpressionTool_class: TypeAlias = Literal["ExpressionTool"] +ExpressionTool_classLoader: Final[_Loader[ExpressionTool_class]] = _EnumLoader( ("ExpressionTool",), "ExpressionTool_class" ) uri_ExpressionTool_classLoader_False_True_None_None: Final[ - _Loader[Literal["ExpressionTool"]] + _Loader[ExpressionTool_class] ] = _URILoader(ExpressionTool_classLoader, False, True, None, None) array_of_ExpressionToolOutputParameterLoader: Final[ _Loader[Sequence[ExpressionToolOutputParameter]] @@ -26607,12 +26041,12 @@ def __init__( uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_1_None: Final[ _Loader[None | Sequence[str] | str] ] = _URILoader(union_of_None_type_or_strtype_or_array_of_strtype, False, False, 1, None) -union_of_None_type_or_LinkMergeMethodLoader: Final[ - _Loader[Literal["merge_nested", "merge_flattened"] | None] -] = _UnionLoader( - ( - None_type, - LinkMergeMethodLoader, +union_of_None_type_or_LinkMergeMethodLoader: Final[_Loader[LinkMergeMethod | None]] = ( + _UnionLoader( + ( + None_type, + LinkMergeMethodLoader, + ) ) ) uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_2_None: Final[ @@ -26682,21 +26116,22 @@ def __init__( uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_0_None: Final[ _Loader[None | Sequence[str] | str] ] = _URILoader(union_of_None_type_or_strtype_or_array_of_strtype, False, False, 0, None) -union_of_None_type_or_ScatterMethodLoader: Final[ - _Loader[Literal["dotproduct", "nested_crossproduct", "flat_crossproduct"] | None] -] = _UnionLoader( - ( - None_type, - ScatterMethodLoader, +union_of_None_type_or_ScatterMethodLoader: Final[_Loader[None | ScatterMethod]] = ( + _UnionLoader( + ( + None_type, + ScatterMethodLoader, + ) ) ) uri_union_of_None_type_or_ScatterMethodLoader_False_True_None_None: Final[ - _Loader[Literal["dotproduct", "nested_crossproduct", "flat_crossproduct"] | None] + _Loader[None | ScatterMethod] ] = _URILoader(union_of_None_type_or_ScatterMethodLoader, False, True, None, None) -Workflow_classLoader: Final[_Loader[Literal["Workflow"]]] = _EnumLoader( +Workflow_class: TypeAlias = Literal["Workflow"] +Workflow_classLoader: Final[_Loader[Workflow_class]] = _EnumLoader( ("Workflow",), "Workflow_class" ) -uri_Workflow_classLoader_False_True_None_None: Final[_Loader[Literal["Workflow"]]] = ( +uri_Workflow_classLoader_False_True_None_None: Final[_Loader[Workflow_class]] = ( _URILoader(Workflow_classLoader, False, True, None, None) ) array_of_WorkflowOutputParameterLoader: Final[ @@ -26714,42 +26149,51 @@ def __init__( idmap_steps_union_of_array_of_WorkflowStepLoader: Final[ _Loader[Sequence[WorkflowStep]] ] = _IdMapLoader(union_of_array_of_WorkflowStepLoader, "id", "None") +SubworkflowFeatureRequirement_class: TypeAlias = Literal[ + "SubworkflowFeatureRequirement" +] SubworkflowFeatureRequirement_classLoader: Final[ - _Loader[Literal["SubworkflowFeatureRequirement"]] + _Loader[SubworkflowFeatureRequirement_class] ] = _EnumLoader( ("SubworkflowFeatureRequirement",), "SubworkflowFeatureRequirement_class" ) uri_SubworkflowFeatureRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["SubworkflowFeatureRequirement"]] + _Loader[SubworkflowFeatureRequirement_class] ] = _URILoader(SubworkflowFeatureRequirement_classLoader, False, True, None, None) +ScatterFeatureRequirement_class: TypeAlias = Literal["ScatterFeatureRequirement"] ScatterFeatureRequirement_classLoader: Final[ - _Loader[Literal["ScatterFeatureRequirement"]] + _Loader[ScatterFeatureRequirement_class] ] = _EnumLoader(("ScatterFeatureRequirement",), "ScatterFeatureRequirement_class") uri_ScatterFeatureRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["ScatterFeatureRequirement"]] + _Loader[ScatterFeatureRequirement_class] ] = _URILoader(ScatterFeatureRequirement_classLoader, False, True, None, None) +MultipleInputFeatureRequirement_class: TypeAlias = Literal[ + "MultipleInputFeatureRequirement" +] MultipleInputFeatureRequirement_classLoader: Final[ - _Loader[Literal["MultipleInputFeatureRequirement"]] + _Loader[MultipleInputFeatureRequirement_class] ] = _EnumLoader( ("MultipleInputFeatureRequirement",), "MultipleInputFeatureRequirement_class" ) uri_MultipleInputFeatureRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["MultipleInputFeatureRequirement"]] + _Loader[MultipleInputFeatureRequirement_class] ] = _URILoader(MultipleInputFeatureRequirement_classLoader, False, True, None, None) +StepInputExpressionRequirement_class: TypeAlias = Literal[ + "StepInputExpressionRequirement" +] StepInputExpressionRequirement_classLoader: Final[ - _Loader[Literal["StepInputExpressionRequirement"]] + _Loader[StepInputExpressionRequirement_class] ] = _EnumLoader( ("StepInputExpressionRequirement",), "StepInputExpressionRequirement_class" ) uri_StepInputExpressionRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["StepInputExpressionRequirement"]] + _Loader[StepInputExpressionRequirement_class] ] = _URILoader(StepInputExpressionRequirement_classLoader, False, True, None, None) uri_strtype_False_True_None_None: Final[_Loader[str]] = _URILoader( strtype, False, True, None, None ) -LoadListingEnumLoader: Final[ - _Loader[Literal["no_listing", "shallow_listing", "deep_listing"]] -] = _EnumLoader( +LoadListingEnum: TypeAlias = Literal["no_listing", "shallow_listing", "deep_listing"] +LoadListingEnumLoader: Final[_Loader[LoadListingEnum]] = _EnumLoader( ( "no_listing", "shallow_listing", @@ -26757,9 +26201,9 @@ def __init__( ), "LoadListingEnum", ) -union_of_LoadListingEnumLoader: Final[ - _Loader[Literal["no_listing", "shallow_listing", "deep_listing"]] -] = _UnionLoader((LoadListingEnumLoader,)) +union_of_LoadListingEnumLoader: Final[_Loader[LoadListingEnum]] = _UnionLoader( + (LoadListingEnumLoader,) +) uri_array_of_strtype_False_False_0_None: Final[_Loader[Sequence[str]]] = _URILoader( array_of_strtype, False, False, 0, None ) diff --git a/cwl_utils/parser/cwl_v1_0_utils.py b/cwl_utils/parser/cwl_v1_0_utils.py index df0888d9..45666d80 100644 --- a/cwl_utils/parser/cwl_v1_0_utils.py +++ b/cwl_utils/parser/cwl_v1_0_utils.py @@ -5,7 +5,7 @@ from collections.abc import MutableMapping, MutableSequence, Sequence from io import StringIO from pathlib import Path -from typing import IO, Any, Literal, TypeAlias, TypeVar, cast +from typing import IO, Any, TypeAlias, TypeVar, cast from urllib.parse import urldefrag from schema_salad.exceptions import ValidationException @@ -25,78 +25,26 @@ 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", - ] -) +BasicInputTypeSchemas: TypeAlias = cwl.InputSchema | str | cwl.CWLType InputTypeSchemas: TypeAlias = BasicInputTypeSchemas | Sequence[BasicInputTypeSchemas] BasicCommandInputTypeSchemas: TypeAlias = ( cwl.CommandInputArraySchema | cwl.CommandInputEnumSchema | cwl.CommandInputRecordSchema | str - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] + | cwl.CWLType ) CommandInputTypeSchemas: TypeAlias = ( BasicCommandInputTypeSchemas | Sequence[BasicCommandInputTypeSchemas] ) -BasicOutputTypeSchemas: TypeAlias = ( - cwl.OutputArraySchema - | cwl.OutputEnumSchema - | cwl.OutputRecordSchema - | str - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] -) +BasicOutputTypeSchemas: TypeAlias = cwl.OutputSchema | str | cwl.CWLType OutputTypeSchemas: TypeAlias = BasicOutputTypeSchemas | Sequence[BasicOutputTypeSchemas] BasicCommandOutputTypeSchemas: TypeAlias = ( cwl.CommandOutputArraySchema | cwl.CommandOutputEnumSchema | cwl.CommandOutputRecordSchema | str - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] + | cwl.CWLType ) CommandOutputTypeSchemas: TypeAlias = ( BasicCommandOutputTypeSchemas | Sequence[BasicCommandOutputTypeSchemas] diff --git a/cwl_utils/parser/cwl_v1_1.py b/cwl_utils/parser/cwl_v1_1.py index 4fa86d51..91bd39bc 100644 --- a/cwl_utils/parser/cwl_v1_1.py +++ b/cwl_utils/parser/cwl_v1_1.py @@ -1455,7 +1455,7 @@ def save( def __init__( self, 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, + type_: ArraySchema | EnumSchema | MapSchema | PrimitiveType | RecordSchema | Sequence[ArraySchema | EnumSchema | MapSchema | PrimitiveType | RecordSchema | UnionSchema | str] | UnionSchema | str, doc: None | Sequence[str] | str = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, @@ -1656,7 +1656,7 @@ def save( def __init__( self, - type_: Literal["record"], + type_: Record_name, fields: None | Sequence[RecordField] = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, @@ -1928,7 +1928,7 @@ def save( def __init__( self, symbols: Sequence[str], - type_: Literal["enum"], + type_: Enum_name, name: None | str = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, @@ -2129,8 +2129,8 @@ def save( def __init__( 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, - type_: Literal["array"], + items: ArraySchema | EnumSchema | MapSchema | PrimitiveType | RecordSchema | Sequence[ArraySchema | EnumSchema | MapSchema | PrimitiveType | RecordSchema | UnionSchema | str] | UnionSchema | str, + type_: Array_name, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -2329,8 +2329,8 @@ def save( def __init__( self, - 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, + type_: Map_name, + values: ArraySchema | EnumSchema | MapSchema | PrimitiveType | RecordSchema | Sequence[ArraySchema | EnumSchema | MapSchema | PrimitiveType | RecordSchema | UnionSchema | str] | UnionSchema | str, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -2529,8 +2529,8 @@ def save( def __init__( 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, - type_: Literal["union"], + names: ArraySchema | EnumSchema | MapSchema | PrimitiveType | RecordSchema | Sequence[ArraySchema | EnumSchema | MapSchema | PrimitiveType | RecordSchema | UnionSchema | str] | UnionSchema | str, + type_: Union_name, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -2729,8 +2729,8 @@ def save( def __init__( 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, - type_: Literal["array"], + items: CWLArraySchema | CWLRecordSchema | EnumSchema | PrimitiveType | Sequence[CWLArraySchema | CWLRecordSchema | EnumSchema | PrimitiveType | str] | str, + type_: Array_name, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -2997,7 +2997,7 @@ def save( def __init__( self, 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, + type_: CWLArraySchema | CWLRecordSchema | EnumSchema | PrimitiveType | Sequence[CWLArraySchema | CWLRecordSchema | EnumSchema | PrimitiveType | str] | str, doc: None | Sequence[str] | str = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, @@ -3198,7 +3198,7 @@ def save( def __init__( self, - type_: Literal["record"], + type_: Record_name, fields: None | Sequence[CWLRecordField] = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, @@ -5165,14 +5165,14 @@ def save( 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, + type_: CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | Sequence[CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | 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, + loadListing: LoadListingEnum | None = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -5562,7 +5562,7 @@ def save( def __init__( self, - type_: Literal["record"], + type_: Record_name, fields: None | Sequence[InputRecordField] = None, label: None | str = None, doc: None | Sequence[str] | str = None, @@ -5943,7 +5943,7 @@ def save( def __init__( self, symbols: Sequence[str], - type_: Literal["enum"], + type_: Enum_name, name: None | str = None, label: None | str = None, doc: None | Sequence[str] | str = None, @@ -6322,8 +6322,8 @@ def save( def __init__( 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, - type_: Literal["array"], + items: CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | Sequence[CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | str] | str, + type_: Array_name, label: None | str = None, doc: None | Sequence[str] | str = None, name: None | str = None, @@ -6825,7 +6825,7 @@ def save( def __init__( self, 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, + type_: CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str, doc: None | Sequence[str] | str = None, label: None | str = None, secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = None, @@ -7208,7 +7208,7 @@ def save( def __init__( self, - type_: Literal["record"], + type_: Record_name, fields: None | Sequence[OutputRecordField] = None, label: None | str = None, doc: None | Sequence[str] | str = None, @@ -7589,7 +7589,7 @@ def save( def __init__( self, symbols: Sequence[str], - type_: Literal["enum"], + type_: Enum_name, name: None | str = None, label: None | str = None, doc: None | Sequence[str] | str = None, @@ -7968,8 +7968,8 @@ def save( 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"], + items: CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str, + type_: Array_name, label: None | str = None, doc: None | Sequence[str] | str = None, name: None | str = None, @@ -8725,7 +8725,7 @@ def save( def __init__( self, - loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = None, + loadListing: LoadListingEnum | None = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -9814,7 +9814,7 @@ def save( def __init__( self, loadContents: None | bool = None, - loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = None, + loadListing: LoadListingEnum | None = None, glob: None | Sequence[str] | str = None, outputEval: None | str = None, extension_fields: MutableMapping[str, Any] | None = None, @@ -10485,14 +10485,14 @@ def save( 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, + type_: CWLType | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Sequence[CWLType | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | 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, + loadListing: LoadListingEnum | None = None, inputBinding: CommandLineBinding | None = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, @@ -10950,7 +10950,7 @@ def save( def __init__( self, - type_: Literal["record"], + type_: Record_name, fields: None | Sequence[CommandInputRecordField] = None, label: None | str = None, doc: None | Sequence[str] | str = None, @@ -11398,7 +11398,7 @@ def save( def __init__( self, symbols: Sequence[str], - type_: Literal["enum"], + type_: Enum_name, name: None | str = None, label: None | str = None, doc: None | Sequence[str] | str = None, @@ -11837,8 +11837,8 @@ def save( def __init__( 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, - type_: Literal["array"], + items: CWLType | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Sequence[CWLType | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | str] | str, + type_: Array_name, label: None | str = None, doc: None | Sequence[str] | str = None, name: None | str = None, @@ -12399,7 +12399,7 @@ def save( 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, + type_: CWLType | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Sequence[CWLType | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | str] | str, doc: None | Sequence[str] | str = None, label: None | str = None, secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = None, @@ -12793,7 +12793,7 @@ def save( def __init__( self, - type_: Literal["record"], + type_: Record_name, fields: None | Sequence[CommandOutputRecordField] = None, label: None | str = None, doc: None | Sequence[str] | str = None, @@ -13174,7 +13174,7 @@ def save( def __init__( self, symbols: Sequence[str], - type_: Literal["enum"], + type_: Enum_name, name: None | str = None, label: None | str = None, doc: None | Sequence[str] | str = None, @@ -13553,8 +13553,8 @@ def save( def __init__( 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, - type_: Literal["array"], + items: CWLType | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Sequence[CWLType | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | str] | str, + type_: Array_name, label: None | str = None, doc: None | Sequence[str] | str = None, name: None | str = None, @@ -14285,14 +14285,14 @@ def save( 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, + type_: CWLType | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Sequence[CWLType | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | str] | stdin | 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, + loadListing: LoadListingEnum | None = None, default: CWLObjectType | None = None, inputBinding: CommandLineBinding | None = None, extension_fields: MutableMapping[str, Any] | None = None, @@ -14872,7 +14872,7 @@ def save( 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, + type_: CWLType | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Sequence[CWLType | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | str] | stderr | stdout | str, label: None | str = None, secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = None, streamable: None | bool = None, @@ -15921,7 +15921,7 @@ def __init__( 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, + cwlVersion: CWLVersion | None = None, baseCommand: None | Sequence[str] | str = None, arguments: None | Sequence[CommandLineBinding | str] = None, stdin: None | str = None, @@ -19580,7 +19580,7 @@ def save( 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, + type_: CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str, label: None | str = None, secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = None, streamable: None | bool = None, @@ -20311,14 +20311,14 @@ def save( 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, + type_: CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | Sequence[CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | 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, + loadListing: LoadListingEnum | None = None, default: CWLObjectType | None = None, inputBinding: InputBinding | None = None, extension_fields: MutableMapping[str, Any] | None = None, @@ -20990,7 +20990,7 @@ def __init__( 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, + cwlVersion: CWLVersion | None = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -21620,14 +21620,14 @@ def save( 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, + type_: CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[CWLType | 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, + linkMerge: LinkMergeMethod | None = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -22241,9 +22241,9 @@ def __init__( self, id: str, source: None | Sequence[str] | str = None, - linkMerge: Literal["merge_nested", "merge_flattened"] | None = None, + linkMerge: LinkMergeMethod | None = None, loadContents: None | bool = None, - loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = None, + loadListing: LoadListingEnum | None = None, label: None | str = None, default: CWLObjectType | None = None, valueFrom: None | str = None, @@ -23152,7 +23152,7 @@ def __init__( 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, + scatterMethod: None | ScatterMethod = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -23855,7 +23855,7 @@ def __init__( 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, + cwlVersion: CWLVersion | None = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -25160,7 +25160,7 @@ def __init__( 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, + cwlVersion: CWLVersion | None = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -26178,9 +26178,10 @@ def __init__( None_type: Final[_Loader[None]] = _PrimitiveLoader(type(None)) Any_type: Final[_Loader[Any]] = _AnyLoader() longtype: Final[_Loader[i64]] = _PrimitiveLoader(i64) -PrimitiveTypeLoader: Final[ - _Loader[Literal["null", "boolean", "int", "long", "float", "double", "string"]] -] = _EnumLoader( +PrimitiveType: TypeAlias = Literal[ + "null", "boolean", "int", "long", "float", "double", "string" +] +PrimitiveTypeLoader: Final[_Loader[PrimitiveType]] = _EnumLoader( ( "null", "boolean", @@ -26206,7 +26207,8 @@ def __init__( double: double precision (64-bit) IEEE 754 floating-point number string: Unicode character sequence """ -AnyLoader: Final[_Loader[Literal["Any"]]] = _EnumLoader(("Any",), "Any") +Any_: TypeAlias = Literal["Any"] +Any_Loader: Final[_Loader[Any_]] = _EnumLoader(("Any",), "Any_") """ The **Any** type validates for any non-null value. """ @@ -26218,21 +26220,10 @@ def __init__( ArraySchemaLoader: Final[_Loader[ArraySchema]] = _RecordLoader(ArraySchema, None, None) MapSchemaLoader: Final[_Loader[MapSchema]] = _RecordLoader(MapSchema, None, None) UnionSchemaLoader: Final[_Loader[UnionSchema]] = _RecordLoader(UnionSchema, None, None) -CWLTypeLoader: Final[ - _Loader[ - Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - ] -] = _EnumLoader( +CWLType: TypeAlias = Literal[ + "null", "boolean", "int", "long", "float", "double", "string", "File", "Directory" +] +CWLTypeLoader: Final[_Loader[CWLType]] = _EnumLoader( ( "null", "boolean", @@ -26516,13 +26507,13 @@ def __init__( ] ] ] = 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[_Loader[Literal["v1.1"]]] = _EnumLoader(("v1.1",), "CWLVersion") +CWLVersion: TypeAlias = Literal["v1.1"] +CWLVersionLoader: Final[_Loader[CWLVersion]] = _EnumLoader(("v1.1",), "CWLVersion") """ Current version symbol for CWL documents. """ -LoadListingEnumLoader: Final[ - _Loader[Literal["no_listing", "shallow_listing", "deep_listing"]] -] = _EnumLoader( +LoadListingEnum: TypeAlias = Literal["no_listing", "shallow_listing", "deep_listing"] +LoadListingEnumLoader: Final[_Loader[LoadListingEnum]] = _EnumLoader( ( "no_listing", "shallow_listing", @@ -26538,7 +26529,8 @@ def __init__( 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) +Expression: TypeAlias = Literal["ExpressionPlaceholder"] +ExpressionLoader: Final[_Loader[str]] = _ExpressionLoader(str) InputBindingLoader: Final[_Loader[InputBinding]] = _RecordLoader( InputBinding, None, None ) @@ -26608,7 +26600,8 @@ def __init__( CommandOutputParameterLoader: Final[_Loader[CommandOutputParameter]] = _RecordLoader( CommandOutputParameter, None, None ) -stdinLoader: Final[_Loader[Literal["stdin"]]] = _EnumLoader(("stdin",), "stdin") +stdin: TypeAlias = Literal["stdin"] +stdinLoader: Final[_Loader[stdin]] = _EnumLoader(("stdin",), "stdin") """ Only valid as a `type` for a `CommandLineTool` input with no `inputBinding` set. `stdin` must not be specified at the `CommandLineTool` @@ -26630,7 +26623,8 @@ def __init__( stdin: ${inputs.an_input_name.path} ``` """ -stdoutLoader: Final[_Loader[Literal["stdout"]]] = _EnumLoader(("stdout",), "stdout") +stdout: TypeAlias = Literal["stdout"] +stdoutLoader: Final[_Loader[stdout]] = _EnumLoader(("stdout",), "stdout") """ Only valid as a `type` for a `CommandLineTool` output with no `outputBinding` set. @@ -26674,7 +26668,8 @@ def __init__( stdout: random_stdout_filenameABCDEFG ``` """ -stderrLoader: Final[_Loader[Literal["stderr"]]] = _EnumLoader(("stderr",), "stderr") +stderr: TypeAlias = Literal["stderr"] +stderrLoader: Final[_Loader[stderr]] = _EnumLoader(("stderr",), "stderr") """ Only valid as a `type` for a `CommandLineTool` output with no `outputBinding` set. @@ -26734,14 +26729,13 @@ def __init__( ExpressionToolLoader: Final[_Loader[ExpressionTool]] = _RecordLoader( ExpressionTool, None, None ) -LinkMergeMethodLoader: Final[_Loader[Literal["merge_nested", "merge_flattened"]]] = ( - _EnumLoader( - ( - "merge_nested", - "merge_flattened", - ), - "LinkMergeMethod", - ) +LinkMergeMethod: TypeAlias = Literal["merge_nested", "merge_flattened"] +LinkMergeMethodLoader: Final[_Loader[LinkMergeMethod]] = _EnumLoader( + ( + "merge_nested", + "merge_flattened", + ), + "LinkMergeMethod", ) """ The input link merge method, described in [WorkflowStepInput](#WorkflowStepInput). @@ -26755,9 +26749,10 @@ def __init__( WorkflowStepOutputLoader: Final[_Loader[WorkflowStepOutput]] = _RecordLoader( WorkflowStepOutput, None, None ) -ScatterMethodLoader: Final[ - _Loader[Literal["dotproduct", "nested_crossproduct", "flat_crossproduct"]] -] = _EnumLoader( +ScatterMethod: TypeAlias = Literal[ + "dotproduct", "nested_crossproduct", "flat_crossproduct" +] +ScatterMethodLoader: Final[_Loader[ScatterMethod]] = _EnumLoader( ( "dotproduct", "nested_crossproduct", @@ -26792,8 +26787,8 @@ def __init__( _Loader[ ArraySchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema + | PrimitiveType | RecordSchema | UnionSchema | str @@ -26814,8 +26809,8 @@ def __init__( Sequence[ ArraySchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema + | PrimitiveType | RecordSchema | UnionSchema | str @@ -26828,14 +26823,14 @@ def __init__( _Loader[ ArraySchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema + | PrimitiveType | RecordSchema | Sequence[ ArraySchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema + | PrimitiveType | RecordSchema | UnionSchema | str @@ -26859,14 +26854,14 @@ def __init__( _Loader[ ArraySchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema + | PrimitiveType | RecordSchema | Sequence[ ArraySchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema + | PrimitiveType | RecordSchema | UnionSchema | str @@ -26893,10 +26888,9 @@ def __init__( idmap_fields_union_of_None_type_or_array_of_RecordFieldLoader: Final[ _Loader[None | Sequence[RecordField]] ] = _IdMapLoader(union_of_None_type_or_array_of_RecordFieldLoader, "name", "type") -Record_nameLoader: Final[_Loader[Literal["record"]]] = _EnumLoader( - ("record",), "Record_name" -) -typedsl_Record_nameLoader_2: Final[_Loader[Literal["record"]]] = _TypeDSLLoader( +Record_name: TypeAlias = Literal["record"] +Record_nameLoader: Final[_Loader[Record_name]] = _EnumLoader(("record",), "Record_name") +typedsl_Record_nameLoader_2: Final[_Loader[Record_name]] = _TypeDSLLoader( Record_nameLoader, 2, "v1.1" ) union_of_None_type_or_strtype: Final[_Loader[None | str]] = _UnionLoader( @@ -26911,22 +26905,23 @@ def __init__( uri_array_of_strtype_True_False_None_None: Final[_Loader[Sequence[str]]] = _URILoader( array_of_strtype, True, False, None, None ) -Enum_nameLoader: Final[_Loader[Literal["enum"]]] = _EnumLoader(("enum",), "Enum_name") -typedsl_Enum_nameLoader_2: Final[_Loader[Literal["enum"]]] = _TypeDSLLoader( +Enum_name: TypeAlias = Literal["enum"] +Enum_nameLoader: Final[_Loader[Enum_name]] = _EnumLoader(("enum",), "Enum_name") +typedsl_Enum_nameLoader_2: Final[_Loader[Enum_name]] = _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[ _Loader[ ArraySchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema + | PrimitiveType | RecordSchema | Sequence[ ArraySchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema + | PrimitiveType | RecordSchema | UnionSchema | str @@ -26941,30 +26936,23 @@ def __init__( 2, None, ) -Array_nameLoader: Final[_Loader[Literal["array"]]] = _EnumLoader( - ("array",), "Array_name" -) -typedsl_Array_nameLoader_2: Final[_Loader[Literal["array"]]] = _TypeDSLLoader( +Array_name: TypeAlias = Literal["array"] +Array_nameLoader: Final[_Loader[Array_name]] = _EnumLoader(("array",), "Array_name") +typedsl_Array_nameLoader_2: Final[_Loader[Array_name]] = _TypeDSLLoader( Array_nameLoader, 2, "v1.1" ) -Map_nameLoader: Final[_Loader[Literal["map"]]] = _EnumLoader(("map",), "Map_name") -typedsl_Map_nameLoader_2: Final[_Loader[Literal["map"]]] = _TypeDSLLoader( +Map_name: TypeAlias = Literal["map"] +Map_nameLoader: Final[_Loader[Map_name]] = _EnumLoader(("map",), "Map_name") +typedsl_Map_nameLoader_2: Final[_Loader[Map_name]] = _TypeDSLLoader( Map_nameLoader, 2, "v1.1" ) -Union_nameLoader: Final[_Loader[Literal["union"]]] = _EnumLoader( - ("union",), "Union_name" -) -typedsl_Union_nameLoader_2: Final[_Loader[Literal["union"]]] = _TypeDSLLoader( +Union_name: TypeAlias = Literal["union"] +Union_nameLoader: Final[_Loader[Union_name]] = _EnumLoader(("union",), "Union_name") +typedsl_Union_nameLoader_2: Final[_Loader[Union_name]] = _TypeDSLLoader( Union_nameLoader, 2, "v1.1" ) union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype: Final[ - _Loader[ - CWLArraySchema - | CWLRecordSchema - | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] - | str - ] + _Loader[CWLArraySchema | CWLRecordSchema | EnumSchema | PrimitiveType | str] ] = _UnionLoader( ( PrimitiveTypeLoader, @@ -26976,13 +26964,7 @@ def __init__( ) array_of_union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype: Final[ _Loader[ - Sequence[ - CWLArraySchema - | CWLRecordSchema - | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] - | str - ] + Sequence[CWLArraySchema | CWLRecordSchema | EnumSchema | PrimitiveType | str] ] ] = _ArrayLoader( union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype @@ -26992,14 +26974,8 @@ def __init__( CWLArraySchema | CWLRecordSchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] - | Sequence[ - CWLArraySchema - | CWLRecordSchema - | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] - | str - ] + | PrimitiveType + | Sequence[CWLArraySchema | CWLRecordSchema | EnumSchema | PrimitiveType | str] | str ] ] = _UnionLoader( @@ -27017,14 +26993,8 @@ def __init__( CWLArraySchema | CWLRecordSchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] - | Sequence[ - CWLArraySchema - | CWLRecordSchema - | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] - | str - ] + | PrimitiveType + | Sequence[CWLArraySchema | CWLRecordSchema | EnumSchema | PrimitiveType | str] | str ] ] = _URILoader( @@ -27039,14 +27009,8 @@ def __init__( CWLArraySchema | CWLRecordSchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] - | Sequence[ - CWLArraySchema - | CWLRecordSchema - | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] - | str - ] + | PrimitiveType + | Sequence[CWLArraySchema | CWLRecordSchema | EnumSchema | PrimitiveType | str] | str ] ] = _TypeDSLLoader( @@ -27068,8 +27032,9 @@ def __init__( idmap_fields_union_of_None_type_or_array_of_CWLRecordFieldLoader: Final[ _Loader[None | Sequence[CWLRecordField]] ] = _IdMapLoader(union_of_None_type_or_array_of_CWLRecordFieldLoader, "name", "type") -File_classLoader: Final[_Loader[Literal["File"]]] = _EnumLoader(("File",), "File_class") -uri_File_classLoader_False_True_None_None: Final[_Loader[Literal["File"]]] = _URILoader( +File_class: TypeAlias = Literal["File"] +File_classLoader: Final[_Loader[File_class]] = _EnumLoader(("File",), "File_class") +uri_File_classLoader_False_True_None_None: Final[_Loader[File_class]] = _URILoader( File_classLoader, False, True, None, None ) uri_union_of_None_type_or_strtype_False_False_None_None: Final[_Loader[None | str]] = ( @@ -27112,10 +27077,11 @@ def __init__( uri_union_of_None_type_or_strtype_True_False_None_True: Final[_Loader[None | str]] = ( _URILoader(union_of_None_type_or_strtype, True, False, None, True) ) -Directory_classLoader: Final[_Loader[Literal["Directory"]]] = _EnumLoader( +Directory_class: TypeAlias = Literal["Directory"] +Directory_classLoader: Final[_Loader[Directory_class]] = _EnumLoader( ("Directory",), "Directory_class" ) -uri_Directory_classLoader_False_True_None_None: Final[_Loader[Literal["Directory"]]] = ( +uri_Directory_classLoader_False_True_None_None: Final[_Loader[Directory_class]] = ( _URILoader(Directory_classLoader, False, True, None, None) ) union_of_None_type_or_booltype: Final[_Loader[None | bool]] = _UnionLoader( @@ -27124,12 +27090,12 @@ def __init__( booltype, ) ) -union_of_None_type_or_LoadListingEnumLoader: Final[ - _Loader[Literal["no_listing", "shallow_listing", "deep_listing"] | None] -] = _UnionLoader( - ( - None_type, - LoadListingEnumLoader, +union_of_None_type_or_LoadListingEnumLoader: Final[_Loader[LoadListingEnum | None]] = ( + _UnionLoader( + ( + None_type, + LoadListingEnumLoader, + ) ) ) array_of_SecondaryFileSchemaLoader: Final[_Loader[Sequence[SecondaryFileSchema]]] = ( @@ -27188,23 +27154,7 @@ def __init__( union_of_None_type_or_strtype_or_ExpressionLoader, True, False, None, True ) union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype: Final[ - _Loader[ - InputArraySchema - | InputEnumSchema - | InputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | str - ] + _Loader[CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | str] ] = _UnionLoader( ( CWLTypeLoader, @@ -27216,59 +27166,19 @@ def __init__( ) array_of_union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype: Final[ _Loader[ - Sequence[ - InputArraySchema - | InputEnumSchema - | InputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | str - ] + Sequence[CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | str] ] ] = _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: Final[ _Loader[ - InputArraySchema + CWLType + | 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 + CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | str ] | str ] @@ -27284,36 +27194,12 @@ def __init__( ) 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[ _Loader[ - InputArraySchema + CWLType + | 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 + CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | str ] | str ] @@ -27338,36 +27224,12 @@ def __init__( ] = _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: Final[ _Loader[ - InputArraySchema + CWLType + | 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 + CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | str ] | str ] @@ -27379,23 +27241,7 @@ def __init__( None, ) union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype: Final[ - _Loader[ - Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | OutputArraySchema - | OutputEnumSchema - | OutputRecordSchema - | str - ] + _Loader[CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] ] = _UnionLoader( ( CWLTypeLoader, @@ -27408,21 +27254,7 @@ def __init__( array_of_union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype: Final[ _Loader[ Sequence[ - Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | OutputArraySchema - | OutputEnumSchema - | OutputRecordSchema - | str + CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str ] ] ] = _ArrayLoader( @@ -27430,36 +27262,12 @@ def __init__( ) 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[ _Loader[ - Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] + CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[ - Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | OutputArraySchema - | OutputEnumSchema - | OutputRecordSchema - | str + CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str ] | str ] @@ -27475,36 +27283,12 @@ def __init__( ) 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[ _Loader[ - Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] + CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[ - Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | OutputArraySchema - | OutputEnumSchema - | OutputRecordSchema - | str + CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str ] | str ] @@ -27529,36 +27313,12 @@ def __init__( ] = _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: Final[ _Loader[ - Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] + CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[ - Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | OutputArraySchema - | OutputEnumSchema - | OutputRecordSchema - | str + CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str ] | str ] @@ -27835,7 +27595,7 @@ def __init__( "class", "None", ) -union_of_None_type_or_CWLVersionLoader: Final[_Loader[Literal["v1.1"] | None]] = ( +union_of_None_type_or_CWLVersionLoader: Final[_Loader[CWLVersion | None]] = ( _UnionLoader( ( None_type, @@ -27844,13 +27604,14 @@ def __init__( ) ) uri_union_of_None_type_or_CWLVersionLoader_False_True_None_None: Final[ - _Loader[Literal["v1.1"] | None] + _Loader[CWLVersion | None] ] = _URILoader(union_of_None_type_or_CWLVersionLoader, False, True, None, None) +InlineJavascriptRequirement_class: TypeAlias = Literal["InlineJavascriptRequirement"] InlineJavascriptRequirement_classLoader: Final[ - _Loader[Literal["InlineJavascriptRequirement"]] + _Loader[InlineJavascriptRequirement_class] ] = _EnumLoader(("InlineJavascriptRequirement",), "InlineJavascriptRequirement_class") uri_InlineJavascriptRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["InlineJavascriptRequirement"]] + _Loader[InlineJavascriptRequirement_class] ] = _URILoader(InlineJavascriptRequirement_classLoader, False, True, None, None) union_of_None_type_or_array_of_strtype: Final[_Loader[None | Sequence[str]]] = ( _UnionLoader( @@ -27860,11 +27621,12 @@ def __init__( ) ) ) -SchemaDefRequirement_classLoader: Final[_Loader[Literal["SchemaDefRequirement"]]] = ( +SchemaDefRequirement_class: TypeAlias = Literal["SchemaDefRequirement"] +SchemaDefRequirement_classLoader: Final[_Loader[SchemaDefRequirement_class]] = ( _EnumLoader(("SchemaDefRequirement",), "SchemaDefRequirement_class") ) uri_SchemaDefRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["SchemaDefRequirement"]] + _Loader[SchemaDefRequirement_class] ] = _URILoader(SchemaDefRequirement_classLoader, False, True, None, None) union_of_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader: Final[ _Loader[CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema] @@ -27899,11 +27661,12 @@ def __init__( ExpressionLoader, ) ) -LoadListingRequirement_classLoader: Final[ - _Loader[Literal["LoadListingRequirement"]] -] = _EnumLoader(("LoadListingRequirement",), "LoadListingRequirement_class") +LoadListingRequirement_class: TypeAlias = Literal["LoadListingRequirement"] +LoadListingRequirement_classLoader: Final[_Loader[LoadListingRequirement_class]] = ( + _EnumLoader(("LoadListingRequirement",), "LoadListingRequirement_class") +) uri_LoadListingRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["LoadListingRequirement"]] + _Loader[LoadListingRequirement_class] ] = _URILoader(LoadListingRequirement_classLoader, False, True, None, None) union_of_None_type_or_inttype_or_ExpressionLoader: Final[_Loader[None | i32 | str]] = ( _UnionLoader( @@ -27940,20 +27703,10 @@ def __init__( ) union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype: Final[ _Loader[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] ] = _UnionLoader( @@ -27968,20 +27721,10 @@ def __init__( array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype: Final[ _Loader[ Sequence[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] ] @@ -27990,35 +27733,15 @@ def __init__( ) 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[ _Loader[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | Sequence[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] | str @@ -28035,35 +27758,15 @@ def __init__( ) 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[ _Loader[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | Sequence[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] | str @@ -28091,35 +27794,15 @@ def __init__( ) 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[ _Loader[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | Sequence[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] | str @@ -28133,20 +27816,10 @@ def __init__( ) union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype: Final[ _Loader[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] ] = _UnionLoader( @@ -28161,20 +27834,10 @@ def __init__( array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype: Final[ _Loader[ Sequence[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] ] @@ -28183,35 +27846,15 @@ def __init__( ) 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[ _Loader[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | Sequence[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] | str @@ -28228,35 +27871,15 @@ def __init__( ) 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[ _Loader[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | Sequence[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] | str @@ -28292,35 +27915,15 @@ def __init__( ) 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[ _Loader[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | Sequence[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] | str @@ -28334,38 +27937,18 @@ def __init__( ) 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[ _Loader[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | Literal["stdin"] | Sequence[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] + | stdin | str ] ] = _UnionLoader( @@ -28381,38 +27964,18 @@ def __init__( ) 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[ _Loader[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | Literal["stdin"] | Sequence[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] + | stdin | str ] ] = _TypeDSLLoader( @@ -28422,39 +27985,19 @@ def __init__( ) 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[ _Loader[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | Literal["stderr"] - | Literal["stdout"] | Sequence[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] + | stderr + | stdout | str ] ] = _UnionLoader( @@ -28471,39 +28014,19 @@ def __init__( ) 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[ _Loader[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | Literal["stderr"] - | Literal["stdout"] | Sequence[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] + | stderr + | stdout | str ] ] = _TypeDSLLoader( @@ -28511,11 +28034,12 @@ def __init__( 2, "v1.1", ) -CommandLineTool_classLoader: Final[_Loader[Literal["CommandLineTool"]]] = _EnumLoader( +CommandLineTool_class: TypeAlias = Literal["CommandLineTool"] +CommandLineTool_classLoader: Final[_Loader[CommandLineTool_class]] = _EnumLoader( ("CommandLineTool",), "CommandLineTool_class" ) uri_CommandLineTool_classLoader_False_True_None_None: Final[ - _Loader[Literal["CommandLineTool"]] + _Loader[CommandLineTool_class] ] = _URILoader(CommandLineTool_classLoader, False, True, None, None) array_of_CommandInputParameterLoader: Final[ _Loader[Sequence[CommandInputParameter]] @@ -28558,17 +28082,19 @@ def __init__( ) ) ) -DockerRequirement_classLoader: Final[_Loader[Literal["DockerRequirement"]]] = ( - _EnumLoader(("DockerRequirement",), "DockerRequirement_class") +DockerRequirement_class: TypeAlias = Literal["DockerRequirement"] +DockerRequirement_classLoader: Final[_Loader[DockerRequirement_class]] = _EnumLoader( + ("DockerRequirement",), "DockerRequirement_class" ) uri_DockerRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["DockerRequirement"]] + _Loader[DockerRequirement_class] ] = _URILoader(DockerRequirement_classLoader, False, True, None, None) -SoftwareRequirement_classLoader: Final[_Loader[Literal["SoftwareRequirement"]]] = ( +SoftwareRequirement_class: TypeAlias = Literal["SoftwareRequirement"] +SoftwareRequirement_classLoader: Final[_Loader[SoftwareRequirement_class]] = ( _EnumLoader(("SoftwareRequirement",), "SoftwareRequirement_class") ) uri_SoftwareRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["SoftwareRequirement"]] + _Loader[SoftwareRequirement_class] ] = _URILoader(SoftwareRequirement_classLoader, False, True, None, None) array_of_SoftwarePackageLoader: Final[_Loader[Sequence[SoftwarePackage]]] = ( _ArrayLoader(SoftwarePackageLoader) @@ -28579,11 +28105,12 @@ def __init__( uri_union_of_None_type_or_array_of_strtype_False_False_None_True: Final[ _Loader[None | Sequence[str]] ] = _URILoader(union_of_None_type_or_array_of_strtype, False, False, None, True) +InitialWorkDirRequirement_class: TypeAlias = Literal["InitialWorkDirRequirement"] InitialWorkDirRequirement_classLoader: Final[ - _Loader[Literal["InitialWorkDirRequirement"]] + _Loader[InitialWorkDirRequirement_class] ] = _EnumLoader(("InitialWorkDirRequirement",), "InitialWorkDirRequirement_class") uri_InitialWorkDirRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["InitialWorkDirRequirement"]] + _Loader[InitialWorkDirRequirement_class] ] = _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: Final[ _Loader[Directory | Dirent | File | None | Sequence[Directory | File] | str] @@ -28615,11 +28142,12 @@ def __init__( ExpressionLoader, ) ) -EnvVarRequirement_classLoader: Final[_Loader[Literal["EnvVarRequirement"]]] = ( - _EnumLoader(("EnvVarRequirement",), "EnvVarRequirement_class") +EnvVarRequirement_class: TypeAlias = Literal["EnvVarRequirement"] +EnvVarRequirement_classLoader: Final[_Loader[EnvVarRequirement_class]] = _EnumLoader( + ("EnvVarRequirement",), "EnvVarRequirement_class" ) uri_EnvVarRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["EnvVarRequirement"]] + _Loader[EnvVarRequirement_class] ] = _URILoader(EnvVarRequirement_classLoader, False, True, None, None) array_of_EnvironmentDefLoader: Final[_Loader[Sequence[EnvironmentDef]]] = _ArrayLoader( EnvironmentDefLoader @@ -28627,17 +28155,19 @@ def __init__( idmap_envDef_array_of_EnvironmentDefLoader: Final[_Loader[Sequence[EnvironmentDef]]] = ( _IdMapLoader(array_of_EnvironmentDefLoader, "envName", "envValue") ) -ShellCommandRequirement_classLoader: Final[ - _Loader[Literal["ShellCommandRequirement"]] -] = _EnumLoader(("ShellCommandRequirement",), "ShellCommandRequirement_class") +ShellCommandRequirement_class: TypeAlias = Literal["ShellCommandRequirement"] +ShellCommandRequirement_classLoader: Final[_Loader[ShellCommandRequirement_class]] = ( + _EnumLoader(("ShellCommandRequirement",), "ShellCommandRequirement_class") +) uri_ShellCommandRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["ShellCommandRequirement"]] + _Loader[ShellCommandRequirement_class] ] = _URILoader(ShellCommandRequirement_classLoader, False, True, None, None) -ResourceRequirement_classLoader: Final[_Loader[Literal["ResourceRequirement"]]] = ( +ResourceRequirement_class: TypeAlias = Literal["ResourceRequirement"] +ResourceRequirement_classLoader: Final[_Loader[ResourceRequirement_class]] = ( _EnumLoader(("ResourceRequirement",), "ResourceRequirement_class") ) uri_ResourceRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["ResourceRequirement"]] + _Loader[ResourceRequirement_class] ] = _URILoader(ResourceRequirement_classLoader, False, True, None, None) union_of_None_type_or_inttype_or_inttype_or_ExpressionLoader: Final[ _Loader[None | i32 | str] @@ -28649,10 +28179,11 @@ def __init__( ExpressionLoader, ) ) -WorkReuse_classLoader: Final[_Loader[Literal["WorkReuse"]]] = _EnumLoader( +WorkReuse_class: TypeAlias = Literal["WorkReuse"] +WorkReuse_classLoader: Final[_Loader[WorkReuse_class]] = _EnumLoader( ("WorkReuse",), "WorkReuse_class" ) -uri_WorkReuse_classLoader_False_True_None_None: Final[_Loader[Literal["WorkReuse"]]] = ( +uri_WorkReuse_classLoader_False_True_None_None: Final[_Loader[WorkReuse_class]] = ( _URILoader(WorkReuse_classLoader, False, True, None, None) ) union_of_booltype_or_ExpressionLoader: Final[_Loader[bool | str]] = _UnionLoader( @@ -28661,23 +28192,26 @@ def __init__( ExpressionLoader, ) ) -NetworkAccess_classLoader: Final[_Loader[Literal["NetworkAccess"]]] = _EnumLoader( +NetworkAccess_class: TypeAlias = Literal["NetworkAccess"] +NetworkAccess_classLoader: Final[_Loader[NetworkAccess_class]] = _EnumLoader( ("NetworkAccess",), "NetworkAccess_class" ) uri_NetworkAccess_classLoader_False_True_None_None: Final[ - _Loader[Literal["NetworkAccess"]] + _Loader[NetworkAccess_class] ] = _URILoader(NetworkAccess_classLoader, False, True, None, None) -InplaceUpdateRequirement_classLoader: Final[ - _Loader[Literal["InplaceUpdateRequirement"]] -] = _EnumLoader(("InplaceUpdateRequirement",), "InplaceUpdateRequirement_class") +InplaceUpdateRequirement_class: TypeAlias = Literal["InplaceUpdateRequirement"] +InplaceUpdateRequirement_classLoader: Final[_Loader[InplaceUpdateRequirement_class]] = ( + _EnumLoader(("InplaceUpdateRequirement",), "InplaceUpdateRequirement_class") +) uri_InplaceUpdateRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["InplaceUpdateRequirement"]] + _Loader[InplaceUpdateRequirement_class] ] = _URILoader(InplaceUpdateRequirement_classLoader, False, True, None, None) -ToolTimeLimit_classLoader: Final[_Loader[Literal["ToolTimeLimit"]]] = _EnumLoader( +ToolTimeLimit_class: TypeAlias = Literal["ToolTimeLimit"] +ToolTimeLimit_classLoader: Final[_Loader[ToolTimeLimit_class]] = _EnumLoader( ("ToolTimeLimit",), "ToolTimeLimit_class" ) uri_ToolTimeLimit_classLoader_False_True_None_None: Final[ - _Loader[Literal["ToolTimeLimit"]] + _Loader[ToolTimeLimit_class] ] = _URILoader(ToolTimeLimit_classLoader, False, True, None, None) union_of_inttype_or_inttype_or_ExpressionLoader: Final[_Loader[i32 | str]] = ( _UnionLoader( @@ -28696,11 +28230,12 @@ def __init__( ) ) ) -ExpressionTool_classLoader: Final[_Loader[Literal["ExpressionTool"]]] = _EnumLoader( +ExpressionTool_class: TypeAlias = Literal["ExpressionTool"] +ExpressionTool_classLoader: Final[_Loader[ExpressionTool_class]] = _EnumLoader( ("ExpressionTool",), "ExpressionTool_class" ) uri_ExpressionTool_classLoader_False_True_None_None: Final[ - _Loader[Literal["ExpressionTool"]] + _Loader[ExpressionTool_class] ] = _URILoader(ExpressionTool_classLoader, False, True, None, None) array_of_WorkflowInputParameterLoader: Final[ _Loader[Sequence[WorkflowInputParameter]] @@ -28717,12 +28252,12 @@ def __init__( uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_1_None: Final[ _Loader[None | Sequence[str] | str] ] = _URILoader(union_of_None_type_or_strtype_or_array_of_strtype, False, False, 1, None) -union_of_None_type_or_LinkMergeMethodLoader: Final[ - _Loader[Literal["merge_nested", "merge_flattened"] | None] -] = _UnionLoader( - ( - None_type, - LinkMergeMethodLoader, +union_of_None_type_or_LinkMergeMethodLoader: Final[_Loader[LinkMergeMethod | None]] = ( + _UnionLoader( + ( + None_type, + LinkMergeMethodLoader, + ) ) ) uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_2_None: Final[ @@ -28792,21 +28327,22 @@ def __init__( uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_0_None: Final[ _Loader[None | Sequence[str] | str] ] = _URILoader(union_of_None_type_or_strtype_or_array_of_strtype, False, False, 0, None) -union_of_None_type_or_ScatterMethodLoader: Final[ - _Loader[Literal["dotproduct", "nested_crossproduct", "flat_crossproduct"] | None] -] = _UnionLoader( - ( - None_type, - ScatterMethodLoader, +union_of_None_type_or_ScatterMethodLoader: Final[_Loader[None | ScatterMethod]] = ( + _UnionLoader( + ( + None_type, + ScatterMethodLoader, + ) ) ) uri_union_of_None_type_or_ScatterMethodLoader_False_True_None_None: Final[ - _Loader[Literal["dotproduct", "nested_crossproduct", "flat_crossproduct"] | None] + _Loader[None | ScatterMethod] ] = _URILoader(union_of_None_type_or_ScatterMethodLoader, False, True, None, None) -Workflow_classLoader: Final[_Loader[Literal["Workflow"]]] = _EnumLoader( +Workflow_class: TypeAlias = Literal["Workflow"] +Workflow_classLoader: Final[_Loader[Workflow_class]] = _EnumLoader( ("Workflow",), "Workflow_class" ) -uri_Workflow_classLoader_False_True_None_None: Final[_Loader[Literal["Workflow"]]] = ( +uri_Workflow_classLoader_False_True_None_None: Final[_Loader[Workflow_class]] = ( _URILoader(Workflow_classLoader, False, True, None, None) ) array_of_WorkflowOutputParameterLoader: Final[ @@ -28824,35 +28360,45 @@ def __init__( idmap_steps_union_of_array_of_WorkflowStepLoader: Final[ _Loader[Sequence[WorkflowStep]] ] = _IdMapLoader(union_of_array_of_WorkflowStepLoader, "id", "None") +SubworkflowFeatureRequirement_class: TypeAlias = Literal[ + "SubworkflowFeatureRequirement" +] SubworkflowFeatureRequirement_classLoader: Final[ - _Loader[Literal["SubworkflowFeatureRequirement"]] + _Loader[SubworkflowFeatureRequirement_class] ] = _EnumLoader( ("SubworkflowFeatureRequirement",), "SubworkflowFeatureRequirement_class" ) uri_SubworkflowFeatureRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["SubworkflowFeatureRequirement"]] + _Loader[SubworkflowFeatureRequirement_class] ] = _URILoader(SubworkflowFeatureRequirement_classLoader, False, True, None, None) +ScatterFeatureRequirement_class: TypeAlias = Literal["ScatterFeatureRequirement"] ScatterFeatureRequirement_classLoader: Final[ - _Loader[Literal["ScatterFeatureRequirement"]] + _Loader[ScatterFeatureRequirement_class] ] = _EnumLoader(("ScatterFeatureRequirement",), "ScatterFeatureRequirement_class") uri_ScatterFeatureRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["ScatterFeatureRequirement"]] + _Loader[ScatterFeatureRequirement_class] ] = _URILoader(ScatterFeatureRequirement_classLoader, False, True, None, None) +MultipleInputFeatureRequirement_class: TypeAlias = Literal[ + "MultipleInputFeatureRequirement" +] MultipleInputFeatureRequirement_classLoader: Final[ - _Loader[Literal["MultipleInputFeatureRequirement"]] + _Loader[MultipleInputFeatureRequirement_class] ] = _EnumLoader( ("MultipleInputFeatureRequirement",), "MultipleInputFeatureRequirement_class" ) uri_MultipleInputFeatureRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["MultipleInputFeatureRequirement"]] + _Loader[MultipleInputFeatureRequirement_class] ] = _URILoader(MultipleInputFeatureRequirement_classLoader, False, True, None, None) +StepInputExpressionRequirement_class: TypeAlias = Literal[ + "StepInputExpressionRequirement" +] StepInputExpressionRequirement_classLoader: Final[ - _Loader[Literal["StepInputExpressionRequirement"]] + _Loader[StepInputExpressionRequirement_class] ] = _EnumLoader( ("StepInputExpressionRequirement",), "StepInputExpressionRequirement_class" ) uri_StepInputExpressionRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["StepInputExpressionRequirement"]] + _Loader[StepInputExpressionRequirement_class] ] = _URILoader(StepInputExpressionRequirement_classLoader, False, True, None, None) uri_strtype_False_True_None_None: Final[_Loader[str]] = _URILoader( strtype, False, True, None, None diff --git a/cwl_utils/parser/cwl_v1_1_utils.py b/cwl_utils/parser/cwl_v1_1_utils.py index 5c528fbc..ddea0fae 100644 --- a/cwl_utils/parser/cwl_v1_1_utils.py +++ b/cwl_utils/parser/cwl_v1_1_utils.py @@ -5,7 +5,7 @@ from collections.abc import MutableMapping, MutableSequence, Sequence from io import StringIO from pathlib import Path -from typing import IO, Any, Literal, TypeAlias, TypeVar, cast +from typing import IO, Any, TypeAlias, TypeVar, cast from urllib.parse import urldefrag from schema_salad.exceptions import ValidationException @@ -25,90 +25,35 @@ 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", - ] -) +BasicInputTypeSchemas: TypeAlias = cwl.InputSchema | str | cwl.CWLType InputTypeSchemas: TypeAlias = ( - BasicInputTypeSchemas | Literal["stdin"] | Sequence[BasicInputTypeSchemas] + BasicInputTypeSchemas | cwl.stdin | Sequence[BasicInputTypeSchemas] ) BasicCommandInputTypeSchemas: TypeAlias = ( cwl.CommandInputArraySchema | cwl.CommandInputEnumSchema | cwl.CommandInputRecordSchema | str - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] + | cwl.CWLType ) 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", - ] + BasicCommandInputTypeSchemas | cwl.stdin | Sequence[BasicCommandInputTypeSchemas] ) +BasicOutputTypeSchemas: TypeAlias = cwl.OutputSchema | str | cwl.CWLType OutputTypeSchemas: TypeAlias = ( - BasicOutputTypeSchemas - | Literal["stderr", "stdout"] - | Sequence[BasicOutputTypeSchemas] + BasicOutputTypeSchemas | cwl.stderr | cwl.stdout | Sequence[BasicOutputTypeSchemas] ) BasicCommandOutputTypeSchemas: TypeAlias = ( cwl.CommandOutputArraySchema | cwl.CommandOutputEnumSchema | cwl.CommandOutputRecordSchema | str - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] + | cwl.CWLType ) CommandOutputTypeSchemas: TypeAlias = ( BasicCommandOutputTypeSchemas - | Literal["stderr", "stdout"] + | cwl.stdout + | cwl.stderr | Sequence[BasicCommandOutputTypeSchemas] ) AnyTypeSchema = TypeVar( diff --git a/cwl_utils/parser/cwl_v1_2.py b/cwl_utils/parser/cwl_v1_2.py index a138ccfa..61b6b602 100644 --- a/cwl_utils/parser/cwl_v1_2.py +++ b/cwl_utils/parser/cwl_v1_2.py @@ -1455,7 +1455,7 @@ def save( def __init__( self, 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, + type_: ArraySchema | EnumSchema | MapSchema | PrimitiveType | RecordSchema | Sequence[ArraySchema | EnumSchema | MapSchema | PrimitiveType | RecordSchema | UnionSchema | str] | UnionSchema | str, doc: None | Sequence[str] | str = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, @@ -1656,7 +1656,7 @@ def save( def __init__( self, - type_: Literal["record"], + type_: Record_name, fields: None | Sequence[RecordField] = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, @@ -1928,7 +1928,7 @@ def save( def __init__( self, symbols: Sequence[str], - type_: Literal["enum"], + type_: Enum_name, name: None | str = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, @@ -2129,8 +2129,8 @@ def save( def __init__( 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, - type_: Literal["array"], + items: ArraySchema | EnumSchema | MapSchema | PrimitiveType | RecordSchema | Sequence[ArraySchema | EnumSchema | MapSchema | PrimitiveType | RecordSchema | UnionSchema | str] | UnionSchema | str, + type_: Array_name, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -2329,8 +2329,8 @@ def save( def __init__( self, - 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, + type_: Map_name, + values: ArraySchema | EnumSchema | MapSchema | PrimitiveType | RecordSchema | Sequence[ArraySchema | EnumSchema | MapSchema | PrimitiveType | RecordSchema | UnionSchema | str] | UnionSchema | str, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -2529,8 +2529,8 @@ def save( def __init__( 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, - type_: Literal["union"], + names: ArraySchema | EnumSchema | MapSchema | PrimitiveType | RecordSchema | Sequence[ArraySchema | EnumSchema | MapSchema | PrimitiveType | RecordSchema | UnionSchema | str] | UnionSchema | str, + type_: Union_name, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -2729,8 +2729,8 @@ def save( def __init__( 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, - type_: Literal["array"], + items: CWLArraySchema | CWLRecordSchema | EnumSchema | PrimitiveType | Sequence[CWLArraySchema | CWLRecordSchema | EnumSchema | PrimitiveType | str] | str, + type_: Array_name, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -2997,7 +2997,7 @@ def save( def __init__( self, 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, + type_: CWLArraySchema | CWLRecordSchema | EnumSchema | PrimitiveType | Sequence[CWLArraySchema | CWLRecordSchema | EnumSchema | PrimitiveType | str] | str, doc: None | Sequence[str] | str = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, @@ -3198,7 +3198,7 @@ def save( def __init__( self, - type_: Literal["record"], + type_: Record_name, fields: None | Sequence[CWLRecordField] = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, @@ -5165,14 +5165,14 @@ def save( 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, + type_: CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | Sequence[CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | 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, + loadListing: LoadListingEnum | None = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -5562,7 +5562,7 @@ def save( def __init__( self, - type_: Literal["record"], + type_: Record_name, fields: None | Sequence[InputRecordField] = None, label: None | str = None, doc: None | Sequence[str] | str = None, @@ -5943,7 +5943,7 @@ def save( def __init__( self, symbols: Sequence[str], - type_: Literal["enum"], + type_: Enum_name, name: None | str = None, label: None | str = None, doc: None | Sequence[str] | str = None, @@ -6322,8 +6322,8 @@ def save( def __init__( 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, - type_: Literal["array"], + items: CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | Sequence[CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | str] | str, + type_: Array_name, label: None | str = None, doc: None | Sequence[str] | str = None, name: None | str = None, @@ -6825,7 +6825,7 @@ def save( def __init__( self, 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, + type_: CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str, doc: None | Sequence[str] | str = None, label: None | str = None, secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = None, @@ -7208,7 +7208,7 @@ def save( def __init__( self, - type_: Literal["record"], + type_: Record_name, fields: None | Sequence[OutputRecordField] = None, label: None | str = None, doc: None | Sequence[str] | str = None, @@ -7589,7 +7589,7 @@ def save( def __init__( self, symbols: Sequence[str], - type_: Literal["enum"], + type_: Enum_name, name: None | str = None, label: None | str = None, doc: None | Sequence[str] | str = None, @@ -7968,8 +7968,8 @@ def save( 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"], + items: CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str, + type_: Array_name, label: None | str = None, doc: None | Sequence[str] | str = None, name: None | str = None, @@ -8747,7 +8747,7 @@ def save( def __init__( self, - loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = None, + loadListing: LoadListingEnum | None = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -9836,7 +9836,7 @@ def save( def __init__( self, loadContents: None | bool = None, - loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = None, + loadListing: LoadListingEnum | None = None, glob: None | Sequence[str] | str = None, outputEval: None | str = None, extension_fields: MutableMapping[str, Any] | None = None, @@ -10507,14 +10507,14 @@ def save( 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, + type_: CWLType | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Sequence[CWLType | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | 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, + loadListing: LoadListingEnum | None = None, inputBinding: CommandLineBinding | None = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, @@ -10972,7 +10972,7 @@ def save( def __init__( self, - type_: Literal["record"], + type_: Record_name, fields: None | Sequence[CommandInputRecordField] = None, label: None | str = None, doc: None | Sequence[str] | str = None, @@ -11420,7 +11420,7 @@ def save( def __init__( self, symbols: Sequence[str], - type_: Literal["enum"], + type_: Enum_name, name: None | str = None, label: None | str = None, doc: None | Sequence[str] | str = None, @@ -11859,8 +11859,8 @@ def save( def __init__( 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, - type_: Literal["array"], + items: CWLType | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Sequence[CWLType | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | str] | str, + type_: Array_name, label: None | str = None, doc: None | Sequence[str] | str = None, name: None | str = None, @@ -12421,7 +12421,7 @@ def save( 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, + type_: CWLType | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Sequence[CWLType | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | str] | str, doc: None | Sequence[str] | str = None, label: None | str = None, secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = None, @@ -12815,7 +12815,7 @@ def save( def __init__( self, - type_: Literal["record"], + type_: Record_name, fields: None | Sequence[CommandOutputRecordField] = None, label: None | str = None, doc: None | Sequence[str] | str = None, @@ -13196,7 +13196,7 @@ def save( def __init__( self, symbols: Sequence[str], - type_: Literal["enum"], + type_: Enum_name, name: None | str = None, label: None | str = None, doc: None | Sequence[str] | str = None, @@ -13575,8 +13575,8 @@ def save( def __init__( 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, - type_: Literal["array"], + items: CWLType | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Sequence[CWLType | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | str] | str, + type_: Array_name, label: None | str = None, doc: None | Sequence[str] | str = None, name: None | str = None, @@ -14307,14 +14307,14 @@ def save( 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, + type_: CWLType | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | Sequence[CWLType | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema | str] | stdin | 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, + loadListing: LoadListingEnum | None = None, default: CWLObjectType | None = None, inputBinding: CommandLineBinding | None = None, extension_fields: MutableMapping[str, Any] | None = None, @@ -14894,7 +14894,7 @@ def save( 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, + type_: CWLType | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | Sequence[CWLType | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema | str] | stderr | stdout | str, label: None | str = None, secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = None, streamable: None | bool = None, @@ -15996,7 +15996,7 @@ def __init__( 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, + cwlVersion: CWLVersion | None = None, intent: None | Sequence[str] = None, baseCommand: None | Sequence[str] | str = None, arguments: None | Sequence[CommandLineBinding | str] = None, @@ -19668,7 +19668,7 @@ def save( 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, + type_: CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str, label: None | str = None, secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = None, streamable: None | bool = None, @@ -20399,14 +20399,14 @@ def save( 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, + type_: CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | Sequence[CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | 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, + loadListing: LoadListingEnum | None = None, default: CWLObjectType | None = None, inputBinding: InputBinding | None = None, extension_fields: MutableMapping[str, Any] | None = None, @@ -21131,7 +21131,7 @@ def __init__( 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, + cwlVersion: CWLVersion | None = None, intent: None | Sequence[str] = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, @@ -21821,15 +21821,15 @@ def save( 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, + type_: CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[CWLType | 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, + linkMerge: LinkMergeMethod | None = None, + pickValue: None | PickValueMethod = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -22564,10 +22564,10 @@ 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, + linkMerge: LinkMergeMethod | None = None, + pickValue: None | PickValueMethod = None, loadContents: None | bool = None, - loadListing: Literal["no_listing", "shallow_listing", "deep_listing"] | None = None, + loadListing: LoadListingEnum | None = None, label: None | str = None, default: CWLObjectType | None = None, valueFrom: None | str = None, @@ -23557,7 +23557,7 @@ def __init__( hints: None | Sequence[Any] = None, when: None | str = None, scatter: None | Sequence[str] | str = None, - scatterMethod: Literal["dotproduct", "nested_crossproduct", "flat_crossproduct"] | None = None, + scatterMethod: None | ScatterMethod = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -24321,7 +24321,7 @@ def __init__( 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, + cwlVersion: CWLVersion | None = None, intent: None | Sequence[str] = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, @@ -25492,14 +25492,14 @@ def save( 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, + type_: CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | Sequence[CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | 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, + loadListing: LoadListingEnum | None = None, default: CWLObjectType | None = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, @@ -26020,7 +26020,7 @@ def save( 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, + type_: CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] | str, label: None | str = None, secondaryFiles: None | SecondaryFileSchema | Sequence[SecondaryFileSchema] = None, streamable: None | bool = None, @@ -26673,7 +26673,7 @@ def __init__( 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, + cwlVersion: CWLVersion | None = None, intent: None | Sequence[str] = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, @@ -27552,7 +27552,7 @@ def __init__( 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, + cwlVersion: CWLVersion | None = None, intent: None | Sequence[str] = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, @@ -28563,9 +28563,9 @@ def __init__( self, default: Any | None = None, id: None | str = None, - linkMerge: Literal["merge_nested", "merge_flattened"] | None = None, + linkMerge: LinkMergeMethod | None = None, loopSource: None | Sequence[str] | str = None, - pickValue: Literal["first_non_null", "the_only_non_null", "all_non_null"] | None = None, + pickValue: None | PickValueMethod = None, valueFrom: None | str = None, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, @@ -28875,7 +28875,7 @@ def __init__( self, loop: Sequence[LoopInput], loopWhen: str, - outputMethod: Literal["last", "all"], + outputMethod: LoopOutputModes, extension_fields: MutableMapping[str, Any] | None = None, loadingOptions: LoadingOptions | None = None, ) -> None: @@ -29344,9 +29344,10 @@ def __init__( None_type: Final[_Loader[None]] = _PrimitiveLoader(type(None)) Any_type: Final[_Loader[Any]] = _AnyLoader() longtype: Final[_Loader[i64]] = _PrimitiveLoader(i64) -PrimitiveTypeLoader: Final[ - _Loader[Literal["null", "boolean", "int", "long", "float", "double", "string"]] -] = _EnumLoader( +PrimitiveType: TypeAlias = Literal[ + "null", "boolean", "int", "long", "float", "double", "string" +] +PrimitiveTypeLoader: Final[_Loader[PrimitiveType]] = _EnumLoader( ( "null", "boolean", @@ -29372,7 +29373,8 @@ def __init__( double: double precision (64-bit) IEEE 754 floating-point number string: Unicode character sequence """ -AnyLoader: Final[_Loader[Literal["Any"]]] = _EnumLoader(("Any",), "Any") +Any_: TypeAlias = Literal["Any"] +Any_Loader: Final[_Loader[Any_]] = _EnumLoader(("Any",), "Any_") """ The **Any** type validates for any non-null value. """ @@ -29384,21 +29386,10 @@ def __init__( ArraySchemaLoader: Final[_Loader[ArraySchema]] = _RecordLoader(ArraySchema, None, None) MapSchemaLoader: Final[_Loader[MapSchema]] = _RecordLoader(MapSchema, None, None) UnionSchemaLoader: Final[_Loader[UnionSchema]] = _RecordLoader(UnionSchema, None, None) -CWLTypeLoader: Final[ - _Loader[ - Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - ] -] = _EnumLoader( +CWLType: TypeAlias = Literal[ + "null", "boolean", "int", "long", "float", "double", "string", "File", "Directory" +] +CWLTypeLoader: Final[_Loader[CWLType]] = _EnumLoader( ( "null", "boolean", @@ -29689,13 +29680,13 @@ def __init__( ] ] ] = 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[_Loader[Literal["v1.2"]]] = _EnumLoader(("v1.2",), "CWLVersion") +CWLVersion: TypeAlias = Literal["v1.2"] +CWLVersionLoader: Final[_Loader[CWLVersion]] = _EnumLoader(("v1.2",), "CWLVersion") """ Current version symbol for CWL documents. """ -LoadListingEnumLoader: Final[ - _Loader[Literal["no_listing", "shallow_listing", "deep_listing"]] -] = _EnumLoader( +LoadListingEnum: TypeAlias = Literal["no_listing", "shallow_listing", "deep_listing"] +LoadListingEnumLoader: Final[_Loader[LoadListingEnum]] = _EnumLoader( ( "no_listing", "shallow_listing", @@ -29711,7 +29702,8 @@ def __init__( 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) +Expression: TypeAlias = Literal["ExpressionPlaceholder"] +ExpressionLoader: Final[_Loader[str]] = _ExpressionLoader(str) InputBindingLoader: Final[_Loader[InputBinding]] = _RecordLoader( InputBinding, None, None ) @@ -29781,7 +29773,8 @@ def __init__( CommandOutputParameterLoader: Final[_Loader[CommandOutputParameter]] = _RecordLoader( CommandOutputParameter, None, None ) -stdinLoader: Final[_Loader[Literal["stdin"]]] = _EnumLoader(("stdin",), "stdin") +stdin: TypeAlias = Literal["stdin"] +stdinLoader: Final[_Loader[stdin]] = _EnumLoader(("stdin",), "stdin") """ Only valid as a `type` for a `CommandLineTool` input with no `inputBinding` set. `stdin` must not be specified at the `CommandLineTool` @@ -29803,7 +29796,8 @@ def __init__( stdin: $(inputs.an_input_name.path) ``` """ -stdoutLoader: Final[_Loader[Literal["stdout"]]] = _EnumLoader(("stdout",), "stdout") +stdout: TypeAlias = Literal["stdout"] +stdoutLoader: Final[_Loader[stdout]] = _EnumLoader(("stdout",), "stdout") """ Only valid as a `type` for a `CommandLineTool` output with no `outputBinding` set. @@ -29851,7 +29845,8 @@ def __init__( (e.g. `echo a && echo b`) `stdout` must include the output of every command. """ -stderrLoader: Final[_Loader[Literal["stderr"]]] = _EnumLoader(("stderr",), "stderr") +stderr: TypeAlias = Literal["stderr"] +stderrLoader: Final[_Loader[stderr]] = _EnumLoader(("stderr",), "stderr") """ Only valid as a `type` for a `CommandLineTool` output with no `outputBinding` set. @@ -29911,21 +29906,21 @@ def __init__( ExpressionToolLoader: Final[_Loader[ExpressionTool]] = _RecordLoader( ExpressionTool, None, None ) -LinkMergeMethodLoader: Final[_Loader[Literal["merge_nested", "merge_flattened"]]] = ( - _EnumLoader( - ( - "merge_nested", - "merge_flattened", - ), - "LinkMergeMethod", - ) +LinkMergeMethod: TypeAlias = Literal["merge_nested", "merge_flattened"] +LinkMergeMethodLoader: Final[_Loader[LinkMergeMethod]] = _EnumLoader( + ( + "merge_nested", + "merge_flattened", + ), + "LinkMergeMethod", ) """ The input link merge method, described in [WorkflowStepInput](#WorkflowStepInput). """ -PickValueMethodLoader: Final[ - _Loader[Literal["first_non_null", "the_only_non_null", "all_non_null"]] -] = _EnumLoader( +PickValueMethod: TypeAlias = Literal[ + "first_non_null", "the_only_non_null", "all_non_null" +] +PickValueMethodLoader: Final[_Loader[PickValueMethod]] = _EnumLoader( ( "first_non_null", "the_only_non_null", @@ -29945,9 +29940,10 @@ def __init__( WorkflowStepOutputLoader: Final[_Loader[WorkflowStepOutput]] = _RecordLoader( WorkflowStepOutput, None, None ) -ScatterMethodLoader: Final[ - _Loader[Literal["dotproduct", "nested_crossproduct", "flat_crossproduct"]] -] = _EnumLoader( +ScatterMethod: TypeAlias = Literal[ + "dotproduct", "nested_crossproduct", "flat_crossproduct" +] +ScatterMethodLoader: Final[_Loader[ScatterMethod]] = _EnumLoader( ( "dotproduct", "nested_crossproduct", @@ -29990,8 +29986,8 @@ def __init__( _Loader[ ArraySchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema + | PrimitiveType | RecordSchema | UnionSchema | str @@ -30012,8 +30008,8 @@ def __init__( Sequence[ ArraySchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema + | PrimitiveType | RecordSchema | UnionSchema | str @@ -30026,14 +30022,14 @@ def __init__( _Loader[ ArraySchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema + | PrimitiveType | RecordSchema | Sequence[ ArraySchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema + | PrimitiveType | RecordSchema | UnionSchema | str @@ -30057,14 +30053,14 @@ def __init__( _Loader[ ArraySchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema + | PrimitiveType | RecordSchema | Sequence[ ArraySchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema + | PrimitiveType | RecordSchema | UnionSchema | str @@ -30091,10 +30087,9 @@ def __init__( idmap_fields_union_of_None_type_or_array_of_RecordFieldLoader: Final[ _Loader[None | Sequence[RecordField]] ] = _IdMapLoader(union_of_None_type_or_array_of_RecordFieldLoader, "name", "type") -Record_nameLoader: Final[_Loader[Literal["record"]]] = _EnumLoader( - ("record",), "Record_name" -) -typedsl_Record_nameLoader_2: Final[_Loader[Literal["record"]]] = _TypeDSLLoader( +Record_name: TypeAlias = Literal["record"] +Record_nameLoader: Final[_Loader[Record_name]] = _EnumLoader(("record",), "Record_name") +typedsl_Record_nameLoader_2: Final[_Loader[Record_name]] = _TypeDSLLoader( Record_nameLoader, 2, "v1.1" ) union_of_None_type_or_strtype: Final[_Loader[None | str]] = _UnionLoader( @@ -30109,22 +30104,23 @@ def __init__( uri_array_of_strtype_True_False_None_None: Final[_Loader[Sequence[str]]] = _URILoader( array_of_strtype, True, False, None, None ) -Enum_nameLoader: Final[_Loader[Literal["enum"]]] = _EnumLoader(("enum",), "Enum_name") -typedsl_Enum_nameLoader_2: Final[_Loader[Literal["enum"]]] = _TypeDSLLoader( +Enum_name: TypeAlias = Literal["enum"] +Enum_nameLoader: Final[_Loader[Enum_name]] = _EnumLoader(("enum",), "Enum_name") +typedsl_Enum_nameLoader_2: Final[_Loader[Enum_name]] = _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[ _Loader[ ArraySchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema + | PrimitiveType | RecordSchema | Sequence[ ArraySchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] | MapSchema + | PrimitiveType | RecordSchema | UnionSchema | str @@ -30139,30 +30135,23 @@ def __init__( 2, None, ) -Array_nameLoader: Final[_Loader[Literal["array"]]] = _EnumLoader( - ("array",), "Array_name" -) -typedsl_Array_nameLoader_2: Final[_Loader[Literal["array"]]] = _TypeDSLLoader( +Array_name: TypeAlias = Literal["array"] +Array_nameLoader: Final[_Loader[Array_name]] = _EnumLoader(("array",), "Array_name") +typedsl_Array_nameLoader_2: Final[_Loader[Array_name]] = _TypeDSLLoader( Array_nameLoader, 2, "v1.1" ) -Map_nameLoader: Final[_Loader[Literal["map"]]] = _EnumLoader(("map",), "Map_name") -typedsl_Map_nameLoader_2: Final[_Loader[Literal["map"]]] = _TypeDSLLoader( +Map_name: TypeAlias = Literal["map"] +Map_nameLoader: Final[_Loader[Map_name]] = _EnumLoader(("map",), "Map_name") +typedsl_Map_nameLoader_2: Final[_Loader[Map_name]] = _TypeDSLLoader( Map_nameLoader, 2, "v1.1" ) -Union_nameLoader: Final[_Loader[Literal["union"]]] = _EnumLoader( - ("union",), "Union_name" -) -typedsl_Union_nameLoader_2: Final[_Loader[Literal["union"]]] = _TypeDSLLoader( +Union_name: TypeAlias = Literal["union"] +Union_nameLoader: Final[_Loader[Union_name]] = _EnumLoader(("union",), "Union_name") +typedsl_Union_nameLoader_2: Final[_Loader[Union_name]] = _TypeDSLLoader( Union_nameLoader, 2, "v1.1" ) union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype: Final[ - _Loader[ - CWLArraySchema - | CWLRecordSchema - | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] - | str - ] + _Loader[CWLArraySchema | CWLRecordSchema | EnumSchema | PrimitiveType | str] ] = _UnionLoader( ( PrimitiveTypeLoader, @@ -30174,13 +30163,7 @@ def __init__( ) array_of_union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype: Final[ _Loader[ - Sequence[ - CWLArraySchema - | CWLRecordSchema - | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] - | str - ] + Sequence[CWLArraySchema | CWLRecordSchema | EnumSchema | PrimitiveType | str] ] ] = _ArrayLoader( union_of_PrimitiveTypeLoader_or_CWLRecordSchemaLoader_or_EnumSchemaLoader_or_CWLArraySchemaLoader_or_strtype @@ -30190,14 +30173,8 @@ def __init__( CWLArraySchema | CWLRecordSchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] - | Sequence[ - CWLArraySchema - | CWLRecordSchema - | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] - | str - ] + | PrimitiveType + | Sequence[CWLArraySchema | CWLRecordSchema | EnumSchema | PrimitiveType | str] | str ] ] = _UnionLoader( @@ -30215,14 +30192,8 @@ def __init__( CWLArraySchema | CWLRecordSchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] - | Sequence[ - CWLArraySchema - | CWLRecordSchema - | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] - | str - ] + | PrimitiveType + | Sequence[CWLArraySchema | CWLRecordSchema | EnumSchema | PrimitiveType | str] | str ] ] = _URILoader( @@ -30237,14 +30208,8 @@ def __init__( CWLArraySchema | CWLRecordSchema | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] - | Sequence[ - CWLArraySchema - | CWLRecordSchema - | EnumSchema - | Literal["null", "boolean", "int", "long", "float", "double", "string"] - | str - ] + | PrimitiveType + | Sequence[CWLArraySchema | CWLRecordSchema | EnumSchema | PrimitiveType | str] | str ] ] = _TypeDSLLoader( @@ -30266,8 +30231,9 @@ def __init__( idmap_fields_union_of_None_type_or_array_of_CWLRecordFieldLoader: Final[ _Loader[None | Sequence[CWLRecordField]] ] = _IdMapLoader(union_of_None_type_or_array_of_CWLRecordFieldLoader, "name", "type") -File_classLoader: Final[_Loader[Literal["File"]]] = _EnumLoader(("File",), "File_class") -uri_File_classLoader_False_True_None_None: Final[_Loader[Literal["File"]]] = _URILoader( +File_class: TypeAlias = Literal["File"] +File_classLoader: Final[_Loader[File_class]] = _EnumLoader(("File",), "File_class") +uri_File_classLoader_False_True_None_None: Final[_Loader[File_class]] = _URILoader( File_classLoader, False, True, None, None ) uri_union_of_None_type_or_strtype_False_False_None_None: Final[_Loader[None | str]] = ( @@ -30310,10 +30276,11 @@ def __init__( uri_union_of_None_type_or_strtype_True_False_None_True: Final[_Loader[None | str]] = ( _URILoader(union_of_None_type_or_strtype, True, False, None, True) ) -Directory_classLoader: Final[_Loader[Literal["Directory"]]] = _EnumLoader( +Directory_class: TypeAlias = Literal["Directory"] +Directory_classLoader: Final[_Loader[Directory_class]] = _EnumLoader( ("Directory",), "Directory_class" ) -uri_Directory_classLoader_False_True_None_None: Final[_Loader[Literal["Directory"]]] = ( +uri_Directory_classLoader_False_True_None_None: Final[_Loader[Directory_class]] = ( _URILoader(Directory_classLoader, False, True, None, None) ) union_of_None_type_or_booltype: Final[_Loader[None | bool]] = _UnionLoader( @@ -30322,12 +30289,12 @@ def __init__( booltype, ) ) -union_of_None_type_or_LoadListingEnumLoader: Final[ - _Loader[Literal["no_listing", "shallow_listing", "deep_listing"] | None] -] = _UnionLoader( - ( - None_type, - LoadListingEnumLoader, +union_of_None_type_or_LoadListingEnumLoader: Final[_Loader[LoadListingEnum | None]] = ( + _UnionLoader( + ( + None_type, + LoadListingEnumLoader, + ) ) ) array_of_SecondaryFileSchemaLoader: Final[_Loader[Sequence[SecondaryFileSchema]]] = ( @@ -30386,23 +30353,7 @@ def __init__( union_of_None_type_or_strtype_or_ExpressionLoader, True, False, None, True ) union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype: Final[ - _Loader[ - InputArraySchema - | InputEnumSchema - | InputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | str - ] + _Loader[CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | str] ] = _UnionLoader( ( CWLTypeLoader, @@ -30414,59 +30365,19 @@ def __init__( ) array_of_union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype: Final[ _Loader[ - Sequence[ - InputArraySchema - | InputEnumSchema - | InputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | str - ] + Sequence[CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | str] ] ] = _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: Final[ _Loader[ - InputArraySchema + CWLType + | 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 + CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | str ] | str ] @@ -30482,36 +30393,12 @@ def __init__( ) 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[ _Loader[ - InputArraySchema + CWLType + | 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 + CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | str ] | str ] @@ -30536,36 +30423,12 @@ def __init__( ] = _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: Final[ _Loader[ - InputArraySchema + CWLType + | 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 + CWLType | InputArraySchema | InputEnumSchema | InputRecordSchema | str ] | str ] @@ -30577,23 +30440,7 @@ def __init__( None, ) union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype: Final[ - _Loader[ - Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | OutputArraySchema - | OutputEnumSchema - | OutputRecordSchema - | str - ] + _Loader[CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str] ] = _UnionLoader( ( CWLTypeLoader, @@ -30606,21 +30453,7 @@ def __init__( array_of_union_of_CWLTypeLoader_or_OutputRecordSchemaLoader_or_OutputEnumSchemaLoader_or_OutputArraySchemaLoader_or_strtype: Final[ _Loader[ Sequence[ - Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | OutputArraySchema - | OutputEnumSchema - | OutputRecordSchema - | str + CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str ] ] ] = _ArrayLoader( @@ -30628,36 +30461,12 @@ def __init__( ) 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[ _Loader[ - Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] + CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[ - Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | OutputArraySchema - | OutputEnumSchema - | OutputRecordSchema - | str + CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str ] | str ] @@ -30673,36 +30482,12 @@ def __init__( ) 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[ _Loader[ - Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] + CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[ - Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | OutputArraySchema - | OutputEnumSchema - | OutputRecordSchema - | str + CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str ] | str ] @@ -30727,36 +30512,12 @@ def __init__( ] = _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: Final[ _Loader[ - Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] + CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | Sequence[ - Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | OutputArraySchema - | OutputEnumSchema - | OutputRecordSchema - | str + CWLType | OutputArraySchema | OutputEnumSchema | OutputRecordSchema | str ] | str ] @@ -31057,7 +30818,7 @@ def __init__( "class", "None", ) -union_of_None_type_or_CWLVersionLoader: Final[_Loader[Literal["v1.2"] | None]] = ( +union_of_None_type_or_CWLVersionLoader: Final[_Loader[CWLVersion | None]] = ( _UnionLoader( ( None_type, @@ -31066,7 +30827,7 @@ def __init__( ) ) uri_union_of_None_type_or_CWLVersionLoader_False_True_None_None: Final[ - _Loader[Literal["v1.2"] | None] + _Loader[CWLVersion | None] ] = _URILoader(union_of_None_type_or_CWLVersionLoader, False, True, None, None) union_of_None_type_or_array_of_strtype: Final[_Loader[None | Sequence[str]]] = ( _UnionLoader( @@ -31079,17 +30840,19 @@ def __init__( uri_union_of_None_type_or_array_of_strtype_True_False_None_None: Final[ _Loader[None | Sequence[str]] ] = _URILoader(union_of_None_type_or_array_of_strtype, True, False, None, None) +InlineJavascriptRequirement_class: TypeAlias = Literal["InlineJavascriptRequirement"] InlineJavascriptRequirement_classLoader: Final[ - _Loader[Literal["InlineJavascriptRequirement"]] + _Loader[InlineJavascriptRequirement_class] ] = _EnumLoader(("InlineJavascriptRequirement",), "InlineJavascriptRequirement_class") uri_InlineJavascriptRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["InlineJavascriptRequirement"]] + _Loader[InlineJavascriptRequirement_class] ] = _URILoader(InlineJavascriptRequirement_classLoader, False, True, None, None) -SchemaDefRequirement_classLoader: Final[_Loader[Literal["SchemaDefRequirement"]]] = ( +SchemaDefRequirement_class: TypeAlias = Literal["SchemaDefRequirement"] +SchemaDefRequirement_classLoader: Final[_Loader[SchemaDefRequirement_class]] = ( _EnumLoader(("SchemaDefRequirement",), "SchemaDefRequirement_class") ) uri_SchemaDefRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["SchemaDefRequirement"]] + _Loader[SchemaDefRequirement_class] ] = _URILoader(SchemaDefRequirement_classLoader, False, True, None, None) union_of_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader: Final[ _Loader[CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema] @@ -31124,11 +30887,12 @@ def __init__( ExpressionLoader, ) ) -LoadListingRequirement_classLoader: Final[ - _Loader[Literal["LoadListingRequirement"]] -] = _EnumLoader(("LoadListingRequirement",), "LoadListingRequirement_class") +LoadListingRequirement_class: TypeAlias = Literal["LoadListingRequirement"] +LoadListingRequirement_classLoader: Final[_Loader[LoadListingRequirement_class]] = ( + _EnumLoader(("LoadListingRequirement",), "LoadListingRequirement_class") +) uri_LoadListingRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["LoadListingRequirement"]] + _Loader[LoadListingRequirement_class] ] = _URILoader(LoadListingRequirement_classLoader, False, True, None, None) union_of_None_type_or_inttype_or_ExpressionLoader: Final[_Loader[None | i32 | str]] = ( _UnionLoader( @@ -31165,20 +30929,10 @@ def __init__( ) union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype: Final[ _Loader[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] ] = _UnionLoader( @@ -31193,20 +30947,10 @@ def __init__( array_of_union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype: Final[ _Loader[ Sequence[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] ] @@ -31215,35 +30959,15 @@ def __init__( ) 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[ _Loader[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | Sequence[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] | str @@ -31260,35 +30984,15 @@ def __init__( ) 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[ _Loader[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | Sequence[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] | str @@ -31316,35 +31020,15 @@ def __init__( ) 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[ _Loader[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | Sequence[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] | str @@ -31358,20 +31042,10 @@ def __init__( ) union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype: Final[ _Loader[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] ] = _UnionLoader( @@ -31386,20 +31060,10 @@ def __init__( array_of_union_of_CWLTypeLoader_or_CommandOutputRecordSchemaLoader_or_CommandOutputEnumSchemaLoader_or_CommandOutputArraySchemaLoader_or_strtype: Final[ _Loader[ Sequence[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] ] @@ -31408,35 +31072,15 @@ def __init__( ) 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[ _Loader[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | Sequence[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] | str @@ -31453,35 +31097,15 @@ def __init__( ) 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[ _Loader[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | Sequence[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] | str @@ -31517,35 +31141,15 @@ def __init__( ) 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[ _Loader[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | Sequence[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] | str @@ -31559,38 +31163,18 @@ def __init__( ) 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[ _Loader[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | Literal["stdin"] | Sequence[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] + | stdin | str ] ] = _UnionLoader( @@ -31606,38 +31190,18 @@ def __init__( ) 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[ _Loader[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | Literal["stdin"] | Sequence[ - CommandInputArraySchema + CWLType + | CommandInputArraySchema | CommandInputEnumSchema | CommandInputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] + | stdin | str ] ] = _TypeDSLLoader( @@ -31647,39 +31211,19 @@ def __init__( ) 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[ _Loader[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | Literal["stderr"] - | Literal["stdout"] | Sequence[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] + | stderr + | stdout | str ] ] = _UnionLoader( @@ -31696,39 +31240,19 @@ def __init__( ) 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[ _Loader[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] - | Literal["stderr"] - | Literal["stdout"] | Sequence[ - CommandOutputArraySchema + CWLType + | CommandOutputArraySchema | CommandOutputEnumSchema | CommandOutputRecordSchema - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] | str ] + | stderr + | stdout | str ] ] = _TypeDSLLoader( @@ -31736,11 +31260,12 @@ def __init__( 2, "v1.1", ) -CommandLineTool_classLoader: Final[_Loader[Literal["CommandLineTool"]]] = _EnumLoader( +CommandLineTool_class: TypeAlias = Literal["CommandLineTool"] +CommandLineTool_classLoader: Final[_Loader[CommandLineTool_class]] = _EnumLoader( ("CommandLineTool",), "CommandLineTool_class" ) uri_CommandLineTool_classLoader_False_True_None_None: Final[ - _Loader[Literal["CommandLineTool"]] + _Loader[CommandLineTool_class] ] = _URILoader(CommandLineTool_classLoader, False, True, None, None) array_of_CommandInputParameterLoader: Final[ _Loader[Sequence[CommandInputParameter]] @@ -31783,17 +31308,19 @@ def __init__( ) ) ) -DockerRequirement_classLoader: Final[_Loader[Literal["DockerRequirement"]]] = ( - _EnumLoader(("DockerRequirement",), "DockerRequirement_class") +DockerRequirement_class: TypeAlias = Literal["DockerRequirement"] +DockerRequirement_classLoader: Final[_Loader[DockerRequirement_class]] = _EnumLoader( + ("DockerRequirement",), "DockerRequirement_class" ) uri_DockerRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["DockerRequirement"]] + _Loader[DockerRequirement_class] ] = _URILoader(DockerRequirement_classLoader, False, True, None, None) -SoftwareRequirement_classLoader: Final[_Loader[Literal["SoftwareRequirement"]]] = ( +SoftwareRequirement_class: TypeAlias = Literal["SoftwareRequirement"] +SoftwareRequirement_classLoader: Final[_Loader[SoftwareRequirement_class]] = ( _EnumLoader(("SoftwareRequirement",), "SoftwareRequirement_class") ) uri_SoftwareRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["SoftwareRequirement"]] + _Loader[SoftwareRequirement_class] ] = _URILoader(SoftwareRequirement_classLoader, False, True, None, None) array_of_SoftwarePackageLoader: Final[_Loader[Sequence[SoftwarePackage]]] = ( _ArrayLoader(SoftwarePackageLoader) @@ -31804,11 +31331,12 @@ def __init__( uri_union_of_None_type_or_array_of_strtype_False_False_None_True: Final[ _Loader[None | Sequence[str]] ] = _URILoader(union_of_None_type_or_array_of_strtype, False, False, None, True) +InitialWorkDirRequirement_class: TypeAlias = Literal["InitialWorkDirRequirement"] InitialWorkDirRequirement_classLoader: Final[ - _Loader[Literal["InitialWorkDirRequirement"]] + _Loader[InitialWorkDirRequirement_class] ] = _EnumLoader(("InitialWorkDirRequirement",), "InitialWorkDirRequirement_class") uri_InitialWorkDirRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["InitialWorkDirRequirement"]] + _Loader[InitialWorkDirRequirement_class] ] = _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: Final[ _Loader[Directory | Dirent | File | None | Sequence[Directory | File] | str] @@ -31840,11 +31368,12 @@ def __init__( array_of_union_of_None_type_or_DirentLoader_or_ExpressionLoader_or_FileLoader_or_DirectoryLoader_or_array_of_union_of_FileLoader_or_DirectoryLoader, ) ) -EnvVarRequirement_classLoader: Final[_Loader[Literal["EnvVarRequirement"]]] = ( - _EnumLoader(("EnvVarRequirement",), "EnvVarRequirement_class") +EnvVarRequirement_class: TypeAlias = Literal["EnvVarRequirement"] +EnvVarRequirement_classLoader: Final[_Loader[EnvVarRequirement_class]] = _EnumLoader( + ("EnvVarRequirement",), "EnvVarRequirement_class" ) uri_EnvVarRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["EnvVarRequirement"]] + _Loader[EnvVarRequirement_class] ] = _URILoader(EnvVarRequirement_classLoader, False, True, None, None) array_of_EnvironmentDefLoader: Final[_Loader[Sequence[EnvironmentDef]]] = _ArrayLoader( EnvironmentDefLoader @@ -31852,17 +31381,19 @@ def __init__( idmap_envDef_array_of_EnvironmentDefLoader: Final[_Loader[Sequence[EnvironmentDef]]] = ( _IdMapLoader(array_of_EnvironmentDefLoader, "envName", "envValue") ) -ShellCommandRequirement_classLoader: Final[ - _Loader[Literal["ShellCommandRequirement"]] -] = _EnumLoader(("ShellCommandRequirement",), "ShellCommandRequirement_class") +ShellCommandRequirement_class: TypeAlias = Literal["ShellCommandRequirement"] +ShellCommandRequirement_classLoader: Final[_Loader[ShellCommandRequirement_class]] = ( + _EnumLoader(("ShellCommandRequirement",), "ShellCommandRequirement_class") +) uri_ShellCommandRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["ShellCommandRequirement"]] + _Loader[ShellCommandRequirement_class] ] = _URILoader(ShellCommandRequirement_classLoader, False, True, None, None) -ResourceRequirement_classLoader: Final[_Loader[Literal["ResourceRequirement"]]] = ( +ResourceRequirement_class: TypeAlias = Literal["ResourceRequirement"] +ResourceRequirement_classLoader: Final[_Loader[ResourceRequirement_class]] = ( _EnumLoader(("ResourceRequirement",), "ResourceRequirement_class") ) uri_ResourceRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["ResourceRequirement"]] + _Loader[ResourceRequirement_class] ] = _URILoader(ResourceRequirement_classLoader, False, True, None, None) union_of_None_type_or_inttype_or_inttype_or_floattype_or_ExpressionLoader: Final[ _Loader[None | float | i32 | str] @@ -31875,10 +31406,11 @@ def __init__( ExpressionLoader, ) ) -WorkReuse_classLoader: Final[_Loader[Literal["WorkReuse"]]] = _EnumLoader( +WorkReuse_class: TypeAlias = Literal["WorkReuse"] +WorkReuse_classLoader: Final[_Loader[WorkReuse_class]] = _EnumLoader( ("WorkReuse",), "WorkReuse_class" ) -uri_WorkReuse_classLoader_False_True_None_None: Final[_Loader[Literal["WorkReuse"]]] = ( +uri_WorkReuse_classLoader_False_True_None_None: Final[_Loader[WorkReuse_class]] = ( _URILoader(WorkReuse_classLoader, False, True, None, None) ) union_of_booltype_or_ExpressionLoader: Final[_Loader[bool | str]] = _UnionLoader( @@ -31887,23 +31419,26 @@ def __init__( ExpressionLoader, ) ) -NetworkAccess_classLoader: Final[_Loader[Literal["NetworkAccess"]]] = _EnumLoader( +NetworkAccess_class: TypeAlias = Literal["NetworkAccess"] +NetworkAccess_classLoader: Final[_Loader[NetworkAccess_class]] = _EnumLoader( ("NetworkAccess",), "NetworkAccess_class" ) uri_NetworkAccess_classLoader_False_True_None_None: Final[ - _Loader[Literal["NetworkAccess"]] + _Loader[NetworkAccess_class] ] = _URILoader(NetworkAccess_classLoader, False, True, None, None) -InplaceUpdateRequirement_classLoader: Final[ - _Loader[Literal["InplaceUpdateRequirement"]] -] = _EnumLoader(("InplaceUpdateRequirement",), "InplaceUpdateRequirement_class") +InplaceUpdateRequirement_class: TypeAlias = Literal["InplaceUpdateRequirement"] +InplaceUpdateRequirement_classLoader: Final[_Loader[InplaceUpdateRequirement_class]] = ( + _EnumLoader(("InplaceUpdateRequirement",), "InplaceUpdateRequirement_class") +) uri_InplaceUpdateRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["InplaceUpdateRequirement"]] + _Loader[InplaceUpdateRequirement_class] ] = _URILoader(InplaceUpdateRequirement_classLoader, False, True, None, None) -ToolTimeLimit_classLoader: Final[_Loader[Literal["ToolTimeLimit"]]] = _EnumLoader( +ToolTimeLimit_class: TypeAlias = Literal["ToolTimeLimit"] +ToolTimeLimit_classLoader: Final[_Loader[ToolTimeLimit_class]] = _EnumLoader( ("ToolTimeLimit",), "ToolTimeLimit_class" ) uri_ToolTimeLimit_classLoader_False_True_None_None: Final[ - _Loader[Literal["ToolTimeLimit"]] + _Loader[ToolTimeLimit_class] ] = _URILoader(ToolTimeLimit_classLoader, False, True, None, None) union_of_inttype_or_inttype_or_ExpressionLoader: Final[_Loader[i32 | str]] = ( _UnionLoader( @@ -31922,11 +31457,12 @@ def __init__( ) ) ) -ExpressionTool_classLoader: Final[_Loader[Literal["ExpressionTool"]]] = _EnumLoader( +ExpressionTool_class: TypeAlias = Literal["ExpressionTool"] +ExpressionTool_classLoader: Final[_Loader[ExpressionTool_class]] = _EnumLoader( ("ExpressionTool",), "ExpressionTool_class" ) uri_ExpressionTool_classLoader_False_True_None_None: Final[ - _Loader[Literal["ExpressionTool"]] + _Loader[ExpressionTool_class] ] = _URILoader(ExpressionTool_classLoader, False, True, None, None) array_of_WorkflowInputParameterLoader: Final[ _Loader[Sequence[WorkflowInputParameter]] @@ -31943,20 +31479,20 @@ def __init__( uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_1_None: Final[ _Loader[None | Sequence[str] | str] ] = _URILoader(union_of_None_type_or_strtype_or_array_of_strtype, False, False, 1, None) -union_of_None_type_or_LinkMergeMethodLoader: Final[ - _Loader[Literal["merge_nested", "merge_flattened"] | None] -] = _UnionLoader( - ( - None_type, - LinkMergeMethodLoader, +union_of_None_type_or_LinkMergeMethodLoader: Final[_Loader[LinkMergeMethod | None]] = ( + _UnionLoader( + ( + None_type, + LinkMergeMethodLoader, + ) ) ) -union_of_None_type_or_PickValueMethodLoader: Final[ - _Loader[Literal["first_non_null", "the_only_non_null", "all_non_null"] | None] -] = _UnionLoader( - ( - None_type, - PickValueMethodLoader, +union_of_None_type_or_PickValueMethodLoader: Final[_Loader[None | PickValueMethod]] = ( + _UnionLoader( + ( + None_type, + PickValueMethodLoader, + ) ) ) uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_2_None: Final[ @@ -32031,21 +31567,22 @@ def __init__( uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_0_None: Final[ _Loader[None | Sequence[str] | str] ] = _URILoader(union_of_None_type_or_strtype_or_array_of_strtype, False, False, 0, None) -union_of_None_type_or_ScatterMethodLoader: Final[ - _Loader[Literal["dotproduct", "nested_crossproduct", "flat_crossproduct"] | None] -] = _UnionLoader( - ( - None_type, - ScatterMethodLoader, +union_of_None_type_or_ScatterMethodLoader: Final[_Loader[None | ScatterMethod]] = ( + _UnionLoader( + ( + None_type, + ScatterMethodLoader, + ) ) ) uri_union_of_None_type_or_ScatterMethodLoader_False_True_None_None: Final[ - _Loader[Literal["dotproduct", "nested_crossproduct", "flat_crossproduct"] | None] + _Loader[None | ScatterMethod] ] = _URILoader(union_of_None_type_or_ScatterMethodLoader, False, True, None, None) -Workflow_classLoader: Final[_Loader[Literal["Workflow"]]] = _EnumLoader( +Workflow_class: TypeAlias = Literal["Workflow"] +Workflow_classLoader: Final[_Loader[Workflow_class]] = _EnumLoader( ("Workflow",), "Workflow_class" ) -uri_Workflow_classLoader_False_True_None_None: Final[_Loader[Literal["Workflow"]]] = ( +uri_Workflow_classLoader_False_True_None_None: Final[_Loader[Workflow_class]] = ( _URILoader(Workflow_classLoader, False, True, None, None) ) array_of_WorkflowOutputParameterLoader: Final[ @@ -32063,40 +31600,51 @@ def __init__( idmap_steps_union_of_array_of_WorkflowStepLoader: Final[ _Loader[Sequence[WorkflowStep]] ] = _IdMapLoader(union_of_array_of_WorkflowStepLoader, "id", "None") +SubworkflowFeatureRequirement_class: TypeAlias = Literal[ + "SubworkflowFeatureRequirement" +] SubworkflowFeatureRequirement_classLoader: Final[ - _Loader[Literal["SubworkflowFeatureRequirement"]] + _Loader[SubworkflowFeatureRequirement_class] ] = _EnumLoader( ("SubworkflowFeatureRequirement",), "SubworkflowFeatureRequirement_class" ) uri_SubworkflowFeatureRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["SubworkflowFeatureRequirement"]] + _Loader[SubworkflowFeatureRequirement_class] ] = _URILoader(SubworkflowFeatureRequirement_classLoader, False, True, None, None) +ScatterFeatureRequirement_class: TypeAlias = Literal["ScatterFeatureRequirement"] ScatterFeatureRequirement_classLoader: Final[ - _Loader[Literal["ScatterFeatureRequirement"]] + _Loader[ScatterFeatureRequirement_class] ] = _EnumLoader(("ScatterFeatureRequirement",), "ScatterFeatureRequirement_class") uri_ScatterFeatureRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["ScatterFeatureRequirement"]] + _Loader[ScatterFeatureRequirement_class] ] = _URILoader(ScatterFeatureRequirement_classLoader, False, True, None, None) +MultipleInputFeatureRequirement_class: TypeAlias = Literal[ + "MultipleInputFeatureRequirement" +] MultipleInputFeatureRequirement_classLoader: Final[ - _Loader[Literal["MultipleInputFeatureRequirement"]] + _Loader[MultipleInputFeatureRequirement_class] ] = _EnumLoader( ("MultipleInputFeatureRequirement",), "MultipleInputFeatureRequirement_class" ) uri_MultipleInputFeatureRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["MultipleInputFeatureRequirement"]] + _Loader[MultipleInputFeatureRequirement_class] ] = _URILoader(MultipleInputFeatureRequirement_classLoader, False, True, None, None) +StepInputExpressionRequirement_class: TypeAlias = Literal[ + "StepInputExpressionRequirement" +] StepInputExpressionRequirement_classLoader: Final[ - _Loader[Literal["StepInputExpressionRequirement"]] + _Loader[StepInputExpressionRequirement_class] ] = _EnumLoader( ("StepInputExpressionRequirement",), "StepInputExpressionRequirement_class" ) uri_StepInputExpressionRequirement_classLoader_False_True_None_None: Final[ - _Loader[Literal["StepInputExpressionRequirement"]] + _Loader[StepInputExpressionRequirement_class] ] = _URILoader(StepInputExpressionRequirement_classLoader, False, True, None, None) -Operation_classLoader: Final[_Loader[Literal["Operation"]]] = _EnumLoader( +Operation_class: TypeAlias = Literal["Operation"] +Operation_classLoader: Final[_Loader[Operation_class]] = _EnumLoader( ("Operation",), "Operation_class" ) -uri_Operation_classLoader_False_True_None_None: Final[_Loader[Literal["Operation"]]] = ( +uri_Operation_classLoader_False_True_None_None: Final[_Loader[Operation_class]] = ( _URILoader(Operation_classLoader, False, True, None, None) ) array_of_OperationInputParameterLoader: Final[ @@ -32143,7 +31691,8 @@ def __init__( idmap_loop_array_of_LoopInputLoader: Final[_Loader[Sequence[LoopInput]]] = _IdMapLoader( array_of_LoopInputLoader, "id", "loopSource" ) -LoopOutputModesLoader: Final[_Loader[Literal["last", "all"]]] = _EnumLoader( +LoopOutputModes: TypeAlias = Literal["last", "all"] +LoopOutputModesLoader: Final[_Loader[LoopOutputModes]] = _EnumLoader( ( "last", "all", diff --git a/cwl_utils/parser/cwl_v1_2_utils.py b/cwl_utils/parser/cwl_v1_2_utils.py index b68791b5..7c70d414 100644 --- a/cwl_utils/parser/cwl_v1_2_utils.py +++ b/cwl_utils/parser/cwl_v1_2_utils.py @@ -5,7 +5,7 @@ from collections.abc import Mapping, MutableMapping, MutableSequence, Sequence from io import StringIO from pathlib import Path -from typing import IO, Any, Literal, TypeAlias, TypeVar, cast +from typing import IO, Any, TypeAlias, TypeVar, cast from urllib.parse import urldefrag from schema_salad.exceptions import ValidationException @@ -25,90 +25,35 @@ 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", - ] -) +BasicInputTypeSchemas: TypeAlias = cwl.InputSchema | str | cwl.CWLType InputTypeSchemas: TypeAlias = ( - BasicInputTypeSchemas | Literal["stdin"] | Sequence[BasicInputTypeSchemas] + BasicInputTypeSchemas | cwl.stdin | Sequence[BasicInputTypeSchemas] ) BasicCommandInputTypeSchemas: TypeAlias = ( cwl.CommandInputArraySchema | cwl.CommandInputEnumSchema | cwl.CommandInputRecordSchema | str - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] + | cwl.CWLType ) 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", - ] + BasicCommandInputTypeSchemas | cwl.stdin | Sequence[BasicCommandInputTypeSchemas] ) +BasicOutputTypeSchemas: TypeAlias = cwl.OutputSchema | str | cwl.CWLType OutputTypeSchemas: TypeAlias = ( - BasicOutputTypeSchemas - | Literal["stderr", "stdout"] - | Sequence[BasicOutputTypeSchemas] + BasicOutputTypeSchemas | cwl.stderr | cwl.stdout | Sequence[BasicOutputTypeSchemas] ) BasicCommandOutputTypeSchemas: TypeAlias = ( cwl.CommandOutputArraySchema | cwl.CommandOutputEnumSchema | cwl.CommandOutputRecordSchema | str - | Literal[ - "null", - "boolean", - "int", - "long", - "float", - "double", - "string", - "File", - "Directory", - ] + | cwl.CWLType ) CommandOutputTypeSchemas: TypeAlias = ( BasicCommandOutputTypeSchemas - | Literal["stderr", "stdout"] + | cwl.stderr + | cwl.stdout | Sequence[BasicCommandOutputTypeSchemas] ) AnyTypeSchema = TypeVar( diff --git a/cwl_utils/parser/utils.py b/cwl_utils/parser/utils.py index 69b93a37..009e411a 100644 --- a/cwl_utils/parser/utils.py +++ b/cwl_utils/parser/utils.py @@ -37,6 +37,7 @@ OutputArraySchema, InputArraySchema, ) +from ..types import is_sequence _logger = logging.getLogger("cwl_utils") @@ -189,7 +190,7 @@ def static_checker(workflow: Workflow) -> None: """Check if all source and sink types of a workflow are compatible before run time.""" step_inputs: Final[MutableSequence[WorkflowStepInput]] = [] step_outputs = [] - type_dict = {} + type_dict: dict[str, InputTypeSchemas | OutputTypeSchemas | None] = {} param_to_step: Final[MutableMapping[str, WorkflowStep]] = {} for step in workflow.steps: if step.in_ is not None: @@ -347,12 +348,10 @@ def static_checker(workflow: Workflow) -> None: exception_msgs.append(msg) for sink in step_inputs: + sink_type = type_dict[sink.id] if ( - "null" != type_dict[sink.id] - and not ( - isinstance(type_dict[sink.id], MutableSequence) - and "null" in type_dict[sink.id] - ) + "null" != sink_type + and not (is_sequence(sink_type) and "null" in sink_type) and getattr(sink, "source", None) is None and getattr(sink, "default", None) is None and getattr(sink, "valueFrom", None) is None diff --git a/cwl_utils/utils.py b/cwl_utils/utils.py index acc876b7..5abd72b4 100644 --- a/cwl_utils/utils.py +++ b/cwl_utils/utils.py @@ -387,16 +387,7 @@ def sanitise_schema_field( schema_field_item["type"] = InputArraySchemaV1_2( 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, - ], + str | cwl_v1_2.InputSchema | Sequence[str | cwl_v1_2.InputSchema], rest.get("items", ""), ), ) From 9fd4031881931da29362df0f9a5cd9733f07db04 Mon Sep 17 00:00:00 2001 From: GlassOfWhiskey Date: Sun, 5 Apr 2026 23:47:57 +0200 Subject: [PATCH 21/22] Simplify union types --- cwl_utils/cwl_v1_0_expression_refactor.py | 8 +------ cwl_utils/cwl_v1_1_expression_refactor.py | 8 +------ cwl_utils/cwl_v1_2_expression_refactor.py | 10 +-------- cwl_utils/parser/__init__.py | 11 ++++++++-- cwl_utils/parser/cwl_v1_0_utils.py | 25 ++++------------------ cwl_utils/parser/cwl_v1_1_utils.py | 25 ++++------------------ cwl_utils/parser/cwl_v1_2_utils.py | 25 ++++------------------ cwl_utils/parser/utils.py | 26 +++-------------------- 8 files changed, 27 insertions(+), 111 deletions(-) diff --git a/cwl_utils/cwl_v1_0_expression_refactor.py b/cwl_utils/cwl_v1_0_expression_refactor.py index 4b1eeaf4..8ec09e14 100755 --- a/cwl_utils/cwl_v1_0_expression_refactor.py +++ b/cwl_utils/cwl_v1_0_expression_refactor.py @@ -301,13 +301,7 @@ def plain_output_type_to_clt_output_type( def parameter_to_plain_input_paramater( - parameter: ( - cwl.InputParameter - | cwl.CommandInputParameter - | cwl.CommandOutputParameter - | cwl.ExpressionToolOutputParameter - | cwl.WorkflowOutputParameter - ), + parameter: cwl.InputParameter | cwl.OutputParameter, ) -> cwl.InputParameter: return cwl.InputParameter.fromDoc( parameter.save(), parameter.loadingOptions.baseuri, parameter.loadingOptions diff --git a/cwl_utils/cwl_v1_1_expression_refactor.py b/cwl_utils/cwl_v1_1_expression_refactor.py index 0e077ab9..a3a25326 100755 --- a/cwl_utils/cwl_v1_1_expression_refactor.py +++ b/cwl_utils/cwl_v1_1_expression_refactor.py @@ -295,13 +295,7 @@ def plain_output_type_to_clt_output_type( def parameter_to_workflow_input_paramater( - parameter: ( - cwl.WorkflowInputParameter - | cwl.CommandInputParameter - | cwl.CommandOutputParameter - | cwl.ExpressionToolOutputParameter - | cwl.WorkflowOutputParameter - ), + parameter: cwl.InputParameter | cwl.OutputParameter, ) -> cwl.WorkflowInputParameter: return cwl.WorkflowInputParameter.fromDoc( parameter.save(), parameter.loadingOptions.baseuri, parameter.loadingOptions diff --git a/cwl_utils/cwl_v1_2_expression_refactor.py b/cwl_utils/cwl_v1_2_expression_refactor.py index f4a5a195..634705b4 100755 --- a/cwl_utils/cwl_v1_2_expression_refactor.py +++ b/cwl_utils/cwl_v1_2_expression_refactor.py @@ -335,15 +335,7 @@ def plain_output_type_to_clt_output_type( def parameter_to_workflow_input_paramater( - parameter: ( - cwl.WorkflowInputParameter - | cwl.CommandInputParameter - | cwl.CommandOutputParameter - | cwl.ExpressionToolOutputParameter - | cwl.WorkflowOutputParameter - | cwl.OperationOutputParameter - | cwl.OperationInputParameter - ), + parameter: cwl.InputParameter | cwl.OutputParameter, ) -> cwl.WorkflowInputParameter: return cwl.WorkflowInputParameter.fromDoc( parameter.save(), parameter.loadingOptions.baseuri, parameter.loadingOptions diff --git a/cwl_utils/parser/__init__.py b/cwl_utils/parser/__init__.py index a26797a7..a89db222 100644 --- a/cwl_utils/parser/__init__.py +++ b/cwl_utils/parser/__init__.py @@ -25,7 +25,10 @@ class NoType(ABC): Saveable: TypeAlias = cwl_v1_0.Saveable | cwl_v1_1.Saveable | cwl_v1_2.Saveable """Type union for a CWL v1.x Saveable object.""" InputParameter: TypeAlias = ( - cwl_v1_0.InputParameter | cwl_v1_1.InputParameter | cwl_v1_2.InputParameter + cwl_v1_0.InputParameter + | cwl_v1_0.CommandInputParameter + | cwl_v1_1.InputParameter + | cwl_v1_2.InputParameter ) """Type union for a CWL v1.x InputEnumSchema object.""" InputRecordField: TypeAlias = ( @@ -37,7 +40,11 @@ class NoType(ABC): ) """Type union for a CWL v1.x InputSchema object.""" OutputParameter: TypeAlias = ( - cwl_v1_0.OutputParameter | cwl_v1_1.OutputParameter | cwl_v1_2.OutputParameter + cwl_v1_0.CommandOutputParameter + | cwl_v1_0.ExpressionToolOutputParameter + | cwl_v1_0.WorkflowOutputParameter + | cwl_v1_1.OutputParameter + | cwl_v1_2.OutputParameter ) """Type union for a CWL v1.x OutputParameter object.""" OutputArraySchema: TypeAlias = ( diff --git a/cwl_utils/parser/cwl_v1_0_utils.py b/cwl_utils/parser/cwl_v1_0_utils.py index 45666d80..f46352fb 100644 --- a/cwl_utils/parser/cwl_v1_0_utils.py +++ b/cwl_utils/parser/cwl_v1_0_utils.py @@ -601,34 +601,17 @@ def param_for_source_id( parent: cwl.Workflow | None = None, scatter_context: list[tuple[int, str] | None] | None = None, ) -> ( - 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 + cwl_utils.parser.InputParameter + | cwl_utils.parser.OutputParameter | 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 + cwl_utils.parser.InputParameter | cwl_utils.parser.OutputParameter ] ): """Find the process input parameter that matches one of the given sourcenames.""" if isinstance(sourcenames, str): sourcenames = [sourcenames] 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 + cwl_utils.parser.InputParameter | cwl_utils.parser.OutputParameter ] = [] for sourcename in sourcenames: if not isinstance(process, cwl.Workflow): diff --git a/cwl_utils/parser/cwl_v1_1_utils.py b/cwl_utils/parser/cwl_v1_1_utils.py index ddea0fae..82550f65 100644 --- a/cwl_utils/parser/cwl_v1_1_utils.py +++ b/cwl_utils/parser/cwl_v1_1_utils.py @@ -623,34 +623,17 @@ def param_for_source_id( parent: cwl.Workflow | None = None, scatter_context: list[tuple[int, str] | None] | None = None, ) -> ( - 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 + cwl_utils.parser.InputParameter + | cwl_utils.parser.OutputParameter | 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 + cwl_utils.parser.InputParameter | cwl_utils.parser.OutputParameter ] ): """Find the process input parameter that matches one of the given sourcenames.""" if isinstance(sourcenames, str): sourcenames = [sourcenames] 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 + cwl_utils.parser.InputParameter | cwl_utils.parser.OutputParameter ] = [] for sourcename in sourcenames: if not isinstance(process, cwl.Workflow): diff --git a/cwl_utils/parser/cwl_v1_2_utils.py b/cwl_utils/parser/cwl_v1_2_utils.py index 7c70d414..6cd54b93 100644 --- a/cwl_utils/parser/cwl_v1_2_utils.py +++ b/cwl_utils/parser/cwl_v1_2_utils.py @@ -721,34 +721,17 @@ def param_for_source_id( parent: cwl.Workflow | None = None, scatter_context: list[tuple[int, str] | None] | None = None, ) -> ( - 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 + cwl_utils.parser.InputParameter + | cwl_utils.parser.OutputParameter | 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 + cwl_utils.parser.InputParameter | cwl_utils.parser.OutputParameter ] ): """Find the process input parameter that matches one of the given sourcenames.""" if isinstance(sourcenames, str): sourcenames = [sourcenames] 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 + cwl_utils.parser.InputParameter | cwl_utils.parser.OutputParameter ] = [] for sourcename in sourcenames: if not isinstance(process, cwl.Workflow): diff --git a/cwl_utils/parser/utils.py b/cwl_utils/parser/utils.py index 009e411a..0261dfbe 100644 --- a/cwl_utils/parser/utils.py +++ b/cwl_utils/parser/utils.py @@ -27,15 +27,10 @@ cwl_v1_2, cwl_v1_2_utils, load_document_by_uri, - CommandInputParameter, - CommandOutputParameter, - ExpressionToolOutputParameter, - OperationInputParameter, - OperationOutputParameter, - WorkflowInputParameter, - WorkflowOutputParameter, OutputArraySchema, InputArraySchema, + OutputParameter, + InputParameter, ) from ..types import is_sequence @@ -530,22 +525,7 @@ def param_for_source_id( parent: Workflow | None = None, scatter_context: list[tuple[int, str] | None] | None = None, ) -> ( - CommandInputParameter - | CommandOutputParameter - | ExpressionToolOutputParameter - | OperationInputParameter - | OperationOutputParameter - | WorkflowInputParameter - | WorkflowOutputParameter - | MutableSequence[ - CommandInputParameter - | CommandOutputParameter - | ExpressionToolOutputParameter - | OperationInputParameter - | OperationOutputParameter - | WorkflowInputParameter - | WorkflowOutputParameter - ] + InputParameter | OutputParameter | MutableSequence[InputParameter | OutputParameter] ): match process.cwlVersion: case "v1.0": From dbe81b88ce6a8d61a1f020e147d328ff759129a1 Mon Sep 17 00:00:00 2001 From: GlassOfWhiskey Date: Tue, 7 Apr 2026 14:35:24 +0200 Subject: [PATCH 22/22] Moved out version-independent functions --- cwl_utils/parser/__init__.py | 20 ++- cwl_utils/parser/cwl_v1_0_utils.py | 128 ++------------ cwl_utils/parser/cwl_v1_1_utils.py | 128 ++------------ cwl_utils/parser/cwl_v1_2_utils.py | 129 ++------------- cwl_utils/parser/utils.py | 257 ++++++++++++++++++++++++++--- 5 files changed, 288 insertions(+), 374 deletions(-) diff --git a/cwl_utils/parser/__init__.py b/cwl_utils/parser/__init__.py index a89db222..dff3cdb3 100644 --- a/cwl_utils/parser/__init__.py +++ b/cwl_utils/parser/__init__.py @@ -25,16 +25,13 @@ class NoType(ABC): Saveable: TypeAlias = cwl_v1_0.Saveable | cwl_v1_1.Saveable | cwl_v1_2.Saveable """Type union for a CWL v1.x Saveable object.""" InputParameter: TypeAlias = ( - cwl_v1_0.InputParameter - | cwl_v1_0.CommandInputParameter - | cwl_v1_1.InputParameter - | cwl_v1_2.InputParameter + cwl_v1_0.InputParameter | cwl_v1_1.InputParameter | cwl_v1_2.InputParameter ) """Type union for a CWL v1.x InputEnumSchema object.""" InputRecordField: TypeAlias = ( cwl_v1_0.InputRecordField | cwl_v1_1.InputRecordField | cwl_v1_2.InputRecordField ) -"""Type union for a CWL v1.x InputRecordSchema object.""" +"""Type union for a CWL v1.x InputRecordField object.""" InputSchema: TypeAlias = ( cwl_v1_0.InputSchema | cwl_v1_1.InputSchema | cwl_v1_2.InputSchema ) @@ -166,6 +163,17 @@ class NoType(ABC): | cwl_v1_2.CommandOutputRecordField ) """Type union for a CWL v1.x CommandOutputRecordField object.""" +CommandOutputRecordSchema: TypeAlias = ( + cwl_v1_0.CommandOutputRecordSchema + | cwl_v1_1.CommandOutputRecordSchema + | cwl_v1_2.CommandOutputRecordSchema +) +CommandOutputRecordSchemaTypes = ( + cwl_v1_0.CommandOutputRecordSchema, + cwl_v1_1.CommandOutputRecordSchema, + cwl_v1_2.CommandOutputRecordSchema, +) +"""Type Union for a CWL v1.x CommandOutputRecordSchema object.""" ExpressionTool: TypeAlias = ( cwl_v1_0.ExpressionTool | cwl_v1_1.ExpressionTool | cwl_v1_2.ExpressionTool ) @@ -242,7 +250,7 @@ class NoType(ABC): cwl_v1_1.InputRecordSchema, cwl_v1_2.InputRecordSchema, ) -"""Type Union for a CWL v1.x RecordSchema object.""" +"""Type Union for a CWL v1.x InputRecordSchema object.""" File: TypeAlias = cwl_v1_0.File | cwl_v1_1.File | cwl_v1_2.File """Type Union for a CWL v1.x File object.""" diff --git a/cwl_utils/parser/cwl_v1_0_utils.py b/cwl_utils/parser/cwl_v1_0_utils.py index f46352fb..ec33287e 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, Sequence +from collections.abc import MutableMapping, MutableSequence, Sequence, Mapping from io import StringIO from pathlib import Path -from typing import IO, Any, TypeAlias, TypeVar, cast +from typing import IO, Any, TypeAlias, TypeVar from urllib.parse import urldefrag from schema_salad.exceptions import ValidationException @@ -100,39 +100,6 @@ def in_output_type_schema_to_output_type_schema( 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 -) -> bool: - """ - Compare two records, ensuring they have compatible fields. - - This handles normalizing record names, which will be relative to workflow - step, so that they can be compared. - """ - srcfields = {cwl.shortname(field.name): field.type_ for field in (src.fields or {})} - sinkfields = { - cwl.shortname(field.name): field.type_ for field in (sink.fields or {}) - } - for key in sinkfields.keys(): - if ( - not can_assign_src_to_sink( - srcfields.get(key, "null"), sinkfields.get(key, "null"), strict - ) - and sinkfields.get(key) is not None - ): - _logger.info( - "Record comparison failure for %s and %s\n" - "Did not match fields for %s: %s and %s", - cast(cwl.InputRecordSchema | cwl.CommandOutputRecordSchema, src).name, - cast(cwl.InputRecordSchema | cwl.CommandOutputRecordSchema, sink).name, - key, - srcfields.get(key), - sinkfields.get(key), - ) - return False - return True - - def _compare_type(type1: Any, type2: Any) -> bool: match (type1, type1): case cwl.ArraySchema() as t1, cwl.ArraySchema() as t2: @@ -219,45 +186,15 @@ def _inputfile_load( ) -def can_assign_src_to_sink(src: Any, sink: Any, strict: bool = False) -> bool: - """ - Check for identical type specifications, ignoring extra keys like inputBinding. - - src: admissible source types - sink: admissible sink types - - In non-strict comparison, at least one source type must match one sink type, - except for 'null'. - In strict comparison, all source types must match at least one sink type. - """ - if "Any" in (src, sink): - return True - if isinstance(src, cwl.ArraySchema) and isinstance(sink, cwl.ArraySchema): - return can_assign_src_to_sink(src.items, sink.items, strict) - if isinstance(src, cwl.RecordSchema) and isinstance(sink, cwl.RecordSchema): - return _compare_records(src, sink, strict) - if isinstance(src, MutableSequence): - if strict: - for this_src in src: - if not can_assign_src_to_sink(this_src, sink): - return False - return True - for this_src in src: - if this_src != "null" and can_assign_src_to_sink(this_src, sink): - return True - return False - if isinstance(sink, MutableSequence): - for this_sink in sink: - if can_assign_src_to_sink(src, this_sink): - return True - return False - return bool(src == sink) - - def check_all_types( - src_dict: dict[str, Any], + src_dict: Mapping[str, cwl.InputParameter | cwl.WorkflowStepOutput], sinks: Sequence[cwl.WorkflowStepInput | cwl.WorkflowOutputParameter], - type_dict: dict[str, Any], + type_dict: Mapping[ + str, + cwl_utils.parser.utils.InputTypeSchemas + | cwl_utils.parser.utils.OutputTypeSchemas + | None, + ], ) -> dict[str, list[SrcSink]]: """Given a list of sinks, check if their types match with the types of their sources.""" validation: dict[str, list[SrcSink]] = {"warning": [], "exception": []} @@ -288,45 +225,17 @@ def check_all_types( srcs_of_sink = [src_dict[parm_id]] linkMerge = None for src in srcs_of_sink: - check_result = check_types( - type_dict[cast(str, src.id)], + check_result = cwl_utils.parser.utils.check_types( + type_dict[src.id], type_dict[sink.id], linkMerge, - getattr(sink, "valueFrom", None), + sink.valueFrom if isinstance(sink, cwl.WorkflowStepInput) else None, ) if check_result in ("warning", "exception"): validation[check_result].append(SrcSink(src, sink, linkMerge, None)) return validation -def check_types( - srctype: Any, - sinktype: Any, - linkMerge: str | None, - valueFrom: str | None = None, -) -> str: - """ - Check if the source and sink types are correct. - - Acceptable types are "pass", "warning", or "exception". - """ - if valueFrom is not None: - return "pass" - if linkMerge is None: - if can_assign_src_to_sink(srctype, sinktype, strict=True): - return "pass" - if can_assign_src_to_sink(srctype, sinktype, strict=False): - return "warning" - return "exception" - if linkMerge == "merge_nested": - return check_types( - cwl.ArraySchema(items=srctype, type_="array"), sinktype, None, None - ) - if linkMerge == "merge_flattened": - return check_types(merge_flatten_type(srctype), sinktype, None, None) - raise ValidationException(f"Invalid value {linkMerge} for linkMerge field.") - - def content_limit_respected_read_bytes(f: IO[bytes]) -> bytes: """ Read file content up to 64 kB as a byte array. @@ -430,15 +339,6 @@ def load_inputfile_by_yaml( return result -def merge_flatten_type(src: Any) -> Any: - """Return the merge flattened type of the source type.""" - if isinstance(src, MutableSequence): - return [merge_flatten_type(t) for t in src] - if isinstance(src, cwl.ArraySchema): - return src - return cwl.ArraySchema(type_="array", items=src) - - def to_input_array(type_: InputTypeSchemas) -> cwl.InputArraySchema: return cwl.InputArraySchema(type_="array", items=type_) @@ -542,7 +442,7 @@ def type_for_source( type_="array", ) elif linkMerge == "merge_flattened": - new_type = merge_flatten_type(new_type) + new_type = cwl_utils.parser.utils.merge_flatten_type(new_type) return new_type new_types: MutableSequence[InputTypeSchemas | OutputTypeSchemas] = [] for p, sc in zip(params, scatter_context): @@ -586,7 +486,7 @@ def type_for_source( type_="array", ) elif linkMerge == "merge_flattened": - final_type = merge_flatten_type(final_type) + final_type = cwl_utils.parser.utils.merge_flatten_type(final_type) elif isinstance(sourcenames, list) and len(sourcenames) > 1: return cwl.OutputArraySchema( items=final_type, diff --git a/cwl_utils/parser/cwl_v1_1_utils.py b/cwl_utils/parser/cwl_v1_1_utils.py index 82550f65..c64bb9ec 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, Sequence +from collections.abc import MutableMapping, MutableSequence, Sequence, Mapping from io import StringIO from pathlib import Path -from typing import IO, Any, TypeAlias, TypeVar, cast +from typing import IO, Any, TypeAlias, TypeVar from urllib.parse import urldefrag from schema_salad.exceptions import ValidationException @@ -107,39 +107,6 @@ def in_output_type_schema_to_output_type_schema( 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 -) -> bool: - """ - Compare two records, ensuring they have compatible fields. - - This handles normalizing record names, which will be relative to workflow - step, so that they can be compared. - """ - srcfields = {cwl.shortname(field.name): field.type_ for field in (src.fields or {})} - sinkfields = { - cwl.shortname(field.name): field.type_ for field in (sink.fields or {}) - } - for key in sinkfields.keys(): - if ( - not can_assign_src_to_sink( - srcfields.get(key, "null"), sinkfields.get(key, "null"), strict - ) - and sinkfields.get(key) is not None - ): - _logger.info( - "Record comparison failure for %s and %s\n" - "Did not match fields for %s: %s and %s", - cast(cwl.InputRecordSchema | cwl.CommandOutputRecordSchema, src).name, - cast(cwl.InputRecordSchema | cwl.CommandOutputRecordSchema, sink).name, - key, - srcfields.get(key), - sinkfields.get(key), - ) - return False - return True - - def _compare_type(type1: Any, type2: Any) -> bool: match (type1, type1): case cwl.ArraySchema() as t1, cwl.ArraySchema() as t2: @@ -226,45 +193,15 @@ def _inputfile_load( ) -def can_assign_src_to_sink(src: Any, sink: Any, strict: bool = False) -> bool: - """ - Check for identical type specifications, ignoring extra keys like inputBinding. - - src: admissible source types - sink: admissible sink types - - In non-strict comparison, at least one source type must match one sink type, - except for 'null'. - In strict comparison, all source types must match at least one sink type. - """ - if "Any" in (src, sink): - return True - if isinstance(src, cwl.ArraySchema) and isinstance(sink, cwl.ArraySchema): - return can_assign_src_to_sink(src.items, sink.items, strict) - if isinstance(src, cwl.RecordSchema) and isinstance(sink, cwl.RecordSchema): - return _compare_records(src, sink, strict) - if isinstance(src, MutableSequence): - if strict: - for this_src in src: - if not can_assign_src_to_sink(this_src, sink): - return False - return True - for this_src in src: - if this_src != "null" and can_assign_src_to_sink(this_src, sink): - return True - return False - if isinstance(sink, MutableSequence): - for this_sink in sink: - if can_assign_src_to_sink(src, this_sink): - return True - return False - return bool(src == sink) - - def check_all_types( - src_dict: dict[str, Any], + src_dict: Mapping[str, cwl.WorkflowInputParameter | cwl.WorkflowStepOutput], sinks: Sequence[cwl.WorkflowStepInput | cwl.WorkflowOutputParameter], - type_dict: dict[str, Any], + type_dict: Mapping[ + str, + cwl_utils.parser.utils.InputTypeSchemas + | cwl_utils.parser.utils.OutputTypeSchemas + | None, + ], ) -> dict[str, list[SrcSink]]: """Given a list of sinks, check if their types match with the types of their sources.""" validation: dict[str, list[SrcSink]] = {"warning": [], "exception": []} @@ -295,45 +232,17 @@ def check_all_types( srcs_of_sink = [src_dict[parm_id]] linkMerge = None for src in srcs_of_sink: - check_result = check_types( - type_dict[cast(str, src.id)], + check_result = cwl_utils.parser.utils.check_types( + type_dict[src.id], type_dict[sink.id], linkMerge, - getattr(sink, "valueFrom", None), + sink.valueFrom if isinstance(sink, cwl.WorkflowStepInput) else None, ) if check_result in ("warning", "exception"): validation[check_result].append(SrcSink(src, sink, linkMerge, None)) return validation -def check_types( - srctype: Any, - sinktype: Any, - linkMerge: str | None, - valueFrom: str | None = None, -) -> str: - """ - Check if the source and sink types are correct. - - Acceptable types are "pass", "warning", or "exception". - """ - if valueFrom is not None: - return "pass" - if linkMerge is None: - if can_assign_src_to_sink(srctype, sinktype, strict=True): - return "pass" - if can_assign_src_to_sink(srctype, sinktype, strict=False): - return "warning" - return "exception" - if linkMerge == "merge_nested": - return check_types( - cwl.ArraySchema(items=srctype, type_="array"), sinktype, None, None - ) - if linkMerge == "merge_flattened": - return check_types(merge_flatten_type(srctype), sinktype, None, None) - raise ValidationException(f"Invalid value {linkMerge} for linkMerge field.") - - def content_limit_respected_read_bytes(f: IO[bytes]) -> bytes: """ Read file content up to 64 kB as a byte array. @@ -452,15 +361,6 @@ def load_inputfile_by_yaml( return result -def merge_flatten_type(src: Any) -> Any: - """Return the merge flattened type of the source type.""" - if isinstance(src, MutableSequence): - return [merge_flatten_type(t) for t in src] - if isinstance(src, cwl.ArraySchema): - return src - return cwl.ArraySchema(type_="array", items=src) - - def to_input_array(type_: InputTypeSchemas) -> cwl.InputArraySchema: return cwl.InputArraySchema(type_="array", items=type_) @@ -564,7 +464,7 @@ def type_for_source( type_="array", ) elif linkMerge == "merge_flattened": - new_type = merge_flatten_type(new_type) + new_type = cwl_utils.parser.utils.merge_flatten_type(new_type) return new_type new_types: MutableSequence[InputTypeSchemas | OutputTypeSchemas] = [] for p, sc in zip(params, scatter_context): @@ -608,7 +508,7 @@ def type_for_source( type_="array", ) elif linkMerge == "merge_flattened": - final_type = merge_flatten_type(final_type) + final_type = cwl_utils.parser.utils.merge_flatten_type(final_type) elif isinstance(sourcenames, list) and len(sourcenames) > 1: return cwl.OutputArraySchema( items=final_type, diff --git a/cwl_utils/parser/cwl_v1_2_utils.py b/cwl_utils/parser/cwl_v1_2_utils.py index 6cd54b93..7d973ef4 100644 --- a/cwl_utils/parser/cwl_v1_2_utils.py +++ b/cwl_utils/parser/cwl_v1_2_utils.py @@ -107,39 +107,6 @@ def in_output_type_schema_to_output_type_schema( 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 -) -> bool: - """ - Compare two records, ensuring they have compatible fields. - - This handles normalizing record names, which will be relative to workflow - step, so that they can be compared. - """ - srcfields = {cwl.shortname(field.name): field.type_ for field in (src.fields or {})} - sinkfields = { - cwl.shortname(field.name): field.type_ for field in (sink.fields or {}) - } - for key in sinkfields.keys(): - if ( - not can_assign_src_to_sink( - srcfields.get(key, "null"), sinkfields.get(key, "null"), strict - ) - and sinkfields.get(key) is not None - ): - _logger.info( - "Record comparison failure for %s and %s\n" - "Did not match fields for %s: %s and %s", - cast(cwl.InputRecordSchema | cwl.CommandOutputRecordSchema, src).name, - cast(cwl.InputRecordSchema | cwl.CommandOutputRecordSchema, sink).name, - key, - srcfields.get(key), - sinkfields.get(key), - ) - return False - return True - - def _compare_type(type1: Any, type2: Any) -> bool: match (type1, type1): case cwl.ArraySchema() as t1, cwl.ArraySchema() as t2: @@ -245,46 +212,16 @@ def _inputfile_load( ) -def can_assign_src_to_sink(src: Any, sink: Any, strict: bool = False) -> bool: - """ - Check for identical type specifications, ignoring extra keys like inputBinding. - - src: admissible source types - sink: admissible sink types - - In non-strict comparison, at least one source type must match one sink type, - except for 'null'. - In strict comparison, all source types must match at least one sink type. - """ - if "Any" in (src, sink): - return True - if isinstance(src, cwl.ArraySchema) and isinstance(sink, cwl.ArraySchema): - return can_assign_src_to_sink(src.items, sink.items, strict) - if isinstance(src, cwl.RecordSchema) and isinstance(sink, cwl.RecordSchema): - return _compare_records(src, sink, strict) - if isinstance(src, MutableSequence): - if strict: - for this_src in src: - if not can_assign_src_to_sink(this_src, sink): - return False - return True - for this_src in src: - if this_src != "null" and can_assign_src_to_sink(this_src, sink): - return True - return False - if isinstance(sink, MutableSequence): - for this_sink in sink: - if can_assign_src_to_sink(src, this_sink): - return True - return False - return bool(src == sink) - - def check_all_types( - src_dict: dict[str, Any], + src_dict: Mapping[str, cwl.WorkflowInputParameter | cwl.WorkflowStepOutput], sinks: Sequence[cwl.WorkflowStepInput | cwl.WorkflowOutputParameter], param_to_step: Mapping[str, cwl.WorkflowStep], - type_dict: dict[str, Any], + type_dict: MutableMapping[ + str, + cwl_utils.parser.utils.InputTypeSchemas + | cwl_utils.parser.utils.OutputTypeSchemas + | None, + ], ) -> dict[str, list[SrcSink]]: """Given a list of sinks, check if their types match with the types of their sources.""" validation: dict[str, list[SrcSink]] = {"warning": [], "exception": []} @@ -372,11 +309,11 @@ def check_all_types( items=src_typ, type_="array" ) for src in srcs_of_sink: - check_result = check_types( - type_dict[cast(str, src.id)], + check_result = cwl_utils.parser.utils.check_types( + type_dict[src.id], sink_type, linkMerge, - getattr(sink, "valueFrom", None), + sink.valueFrom if isinstance(sink, cwl.WorkflowStepInput) else None, ) if check_result in ("warning", "exception"): validation[check_result].append( @@ -385,39 +322,6 @@ def check_all_types( return validation -def check_types( - srctype: Any, - sinktype: Any, - linkMerge: str | None, - valueFrom: str | None = None, -) -> str: - """ - Check if the source and sink types are correct. - - Acceptable types are "pass", "warning", or "exception". - """ - if valueFrom is not None: - return "pass" - match linkMerge: - case None: - if can_assign_src_to_sink(srctype, sinktype, strict=True): - return "pass" - if can_assign_src_to_sink(srctype, sinktype, strict=False): - return "warning" - return "exception" - case "merge_nested": - return check_types( - cwl.ArraySchema(items=srctype, type_="array"), - sinktype, - None, - None, - ) - case "merge_flattened": - return check_types(merge_flatten_type(srctype), sinktype, None, None) - case _: - raise ValidationException(f"Invalid value {linkMerge} for linkMerge field.") - - def content_limit_respected_read_bytes(f: IO[bytes]) -> bytes: """ Read file content up to 64 kB as a byte array. @@ -541,15 +445,6 @@ def load_inputfile_by_yaml( return result -def merge_flatten_type(src: Any) -> Any: - """Return the merge flattened type of the source type.""" - if isinstance(src, MutableSequence): - return [merge_flatten_type(t) for t in src] - if isinstance(src, cwl.ArraySchema): - return src - return cwl.ArraySchema(type_="array", items=src) - - def to_input_array(type_: InputTypeSchemas) -> cwl.InputArraySchema: return cwl.InputArraySchema(type_="array", items=type_) @@ -654,7 +549,7 @@ def type_for_source( type_="array", ) elif linkMerge == "merge_flattened": - new_type = merge_flatten_type(new_type) + new_type = cwl_utils.parser.utils.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"): @@ -702,7 +597,7 @@ def type_for_source( type_="array", ) elif linkMerge == "merge_flattened": - final_type = merge_flatten_type(final_type) + final_type = cwl_utils.parser.utils.merge_flatten_type(final_type) elif isinstance(sourcenames, list) and len(sourcenames) > 1: final_type = cwl.OutputArraySchema( items=final_type, diff --git a/cwl_utils/parser/utils.py b/cwl_utils/parser/utils.py index 0261dfbe..aa4eadf3 100644 --- a/cwl_utils/parser/utils.py +++ b/cwl_utils/parser/utils.py @@ -2,10 +2,18 @@ import copy import logging -from collections.abc import MutableMapping, MutableSequence +from collections.abc import MutableMapping, MutableSequence, Sequence from pathlib import Path -from types import ModuleType -from typing import Any, Final, Optional, cast, Literal, TypeAlias, overload +from typing import ( + Any, + Final, + Optional, + cast, + Literal, + TypeAlias, + overload, + Mapping, +) from urllib.parse import unquote_plus, urlparse from schema_salad.exceptions import ValidationException @@ -31,6 +39,12 @@ InputArraySchema, OutputParameter, InputParameter, + ArraySchema, + InputRecordSchema, + CommandOutputRecordSchema, + OutputRecordSchema, + InputRecordField, + OutputRecordField, ) from ..types import is_sequence @@ -65,6 +79,133 @@ ) +SrcSink: TypeAlias = ( + cwl_v1_0_utils.SrcSink | cwl_v1_1_utils.SrcSink | cwl_v1_2_utils.SrcSink +) + + +def _compare_records( + src: InputRecordSchema | OutputRecordSchema, + sink: InputRecordSchema | OutputRecordSchema, + strict: bool = False, +) -> bool: + """ + Compare two records, ensuring they have compatible fields. + + This handles normalizing record names, which will be relative to workflow + step, so that they can be compared. + """ + srcfields = { + cwl_v1_2.shortname(field.name): cast( + InputTypeSchemas | OutputTypeSchemas | None, field.type_ + ) + for field in cast( + Sequence[InputRecordField | OutputRecordField], src.fields or [] + ) + } + sinkfields = { + cwl_v1_2.shortname(field.name): cast( + InputTypeSchemas | OutputTypeSchemas | None, field.type_ + ) + for field in cast( + Sequence[InputRecordField | OutputRecordField], sink.fields or [] + ) + } + for key in sinkfields.keys(): + if ( + not can_assign_src_to_sink( + srcfields.get(key, "null"), sinkfields.get(key, "null"), strict + ) + and sinkfields.get(key) is not None + ): + _logger.info( + "Record comparison failure for %s and %s\n" + "Did not match fields for %s: %s and %s", + cast(InputRecordSchema | CommandOutputRecordSchema, src).name, + cast(InputRecordSchema | CommandOutputRecordSchema, sink).name, + key, + srcfields.get(key), + sinkfields.get(key), + ) + return False + return True + + +def can_assign_src_to_sink( + src: InputTypeSchemas | OutputTypeSchemas | None, + sink: InputTypeSchemas | OutputTypeSchemas | None, + strict: bool = False, +) -> bool: + """ + Check for identical type specifications, ignoring extra keys like inputBinding. + + src: admissible source types + sink: admissible sink types + + In non-strict comparison, at least one source type must match one sink type, + except for 'null'. + In strict comparison, all source types must match at least one sink type. + """ + if "Any" in (src, sink): + return True + if isinstance(src, InputArraySchema | OutputArraySchema) and isinstance( + sink, InputArraySchema | OutputArraySchema + ): + return can_assign_src_to_sink( + cast(InputTypeSchemas | OutputTypeSchemas | None, src.items), + cast(InputTypeSchemas | OutputTypeSchemas | None, sink.items), + strict, + ) + if isinstance(src, InputRecordSchema | OutputRecordSchema) and isinstance( + sink, InputRecordSchema | OutputRecordSchema + ): + return _compare_records(src, sink, strict) + if isinstance(src, MutableSequence): + if strict: + for this_src in src: + if not can_assign_src_to_sink(this_src, sink): + return False + return True + for this_src in src: + if this_src != "null" and can_assign_src_to_sink(this_src, sink): + return True + return False + if isinstance(sink, MutableSequence): + for this_sink in sink: + if can_assign_src_to_sink(src, this_sink): + return True + return False + return bool(src == sink) + + +def check_types( + srctype: InputTypeSchemas | OutputTypeSchemas | None, + sinktype: InputTypeSchemas | OutputTypeSchemas | None, + linkMerge: str | None, + valueFrom: str | None = None, +) -> str: + """ + Check if the source and sink types are correct. + + Acceptable types are "pass", "warning", or "exception". + """ + if valueFrom is not None: + return "pass" + if linkMerge is None: + if can_assign_src_to_sink(srctype, sinktype, strict=True): + return "pass" + if can_assign_src_to_sink(srctype, sinktype, strict=False): + return "warning" + return "exception" + if linkMerge == "merge_nested": + return check_types( + cwl_v1_2.ArraySchema(items=srctype, type_="array"), sinktype, None, None + ) + if linkMerge == "merge_flattened": + return check_types(merge_flatten_type(srctype), sinktype, None, None) + raise ValidationException(f"Invalid value {linkMerge} for linkMerge field.") + + def convert_stdstreams_to_files(process: Process) -> None: """Convert stdin, stdout and stderr type shortcuts to files.""" match process: @@ -76,6 +217,21 @@ def convert_stdstreams_to_files(process: Process) -> None: cwl_v1_2_utils.convert_stdstreams_to_files(process) +def dump_type( + type_: InputTypeSchemas | OutputTypeSchemas | None, + cwlVersion: Literal["v1.0", "v1.1", "v1.2"], +) -> str: + match cwlVersion: + case "v1.0": + return json_dumps(cwl_v1_0.save(type_)) + case "v1.1": + return json_dumps(cwl_v1_1.save(type_)) + case "v1.2": + return json_dumps(cwl_v1_2.save(type_)) + case _: + raise Exception(f"Unsupported CWL version {cwlVersion}") + + def load_inputfile_by_uri( version: str, path: str | Path, @@ -181,6 +337,15 @@ def load_step( return cast(Process, copy.deepcopy(step.run)) +def merge_flatten_type(src: Any) -> Any: + """Return the merge flattened type of the source type.""" + if isinstance(src, MutableSequence): + return [merge_flatten_type(t) for t in src] + if isinstance(src, ArraySchema): + return src + return cwl_v1_2.ArraySchema(type_="array", items=src) + + def static_checker(workflow: Workflow) -> None: """Check if all source and sink types of a workflow are compatible before run time.""" step_inputs: Final[MutableSequence[WorkflowStepInput]] = [] @@ -235,40 +400,70 @@ def static_checker(workflow: Workflow) -> None: **{param.id: param.type_ for param in workflow.outputs}, } - parser: ModuleType - step_inputs_val: dict[str, Any] - workflow_outputs_val: dict[str, Any] + step_inputs_val: Mapping[str, Sequence[SrcSink]] + workflow_outputs_val: Mapping[str, Sequence[SrcSink]] match workflow.cwlVersion: case "v1.0": - parser = cwl_v1_0 step_inputs_val = cwl_v1_0_utils.check_all_types( - src_dict, + cast( + Mapping[str, cwl_v1_0.InputParameter | cwl_v1_0.WorkflowStepOutput], + 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 + cast( + Mapping[str, cwl_v1_0.InputParameter | cwl_v1_0.WorkflowStepOutput], + src_dict, + ), + workflow.outputs, + type_dict, ) case "v1.1": - parser = cwl_v1_1 step_inputs_val = cwl_v1_1_utils.check_all_types( - src_dict, + cast( + Mapping[ + str, + cwl_v1_1.WorkflowInputParameter | cwl_v1_1.WorkflowStepOutput, + ], + 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 + cast( + Mapping[ + str, + cwl_v1_1.WorkflowInputParameter | cwl_v1_1.WorkflowStepOutput, + ], + src_dict, + ), + workflow.outputs, + type_dict, ) case "v1.2": - parser = cwl_v1_2 step_inputs_val = cwl_v1_2_utils.check_all_types( - src_dict, + cast( + Mapping[ + str, + cwl_v1_2.WorkflowInputParameter | cwl_v1_2.WorkflowStepOutput, + ], + 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, + cast( + Mapping[ + str, + cwl_v1_2.WorkflowInputParameter | cwl_v1_2.WorkflowStepOutput, + ], + src_dict, + ), workflow.outputs, cast(MutableMapping[str, cwl_v1_2.WorkflowStep], param_to_step), type_dict, @@ -285,20 +480,21 @@ def static_checker(workflow: Workflow) -> None: src = warning.src sink = warning.sink linkMerge = warning.linkMerge + msg = ( SourceLine(src, "type").makeError( "Source '%s' of type %s may be incompatible" % ( - parser.shortname(src.id), - json_dumps(parser.save(type_dict[src.id])), + shortname(src.id, workflow.cwlVersion), + dump_type(type_dict[src.id], workflow.cwlVersion), ) ) + "\n" + SourceLine(sink, "type").makeError( " with sink '%s' of type %s" % ( - parser.shortname(sink.id), - json_dumps(parser.save(type_dict[sink.id])), + shortname(sink.id, workflow.cwlVersion), + dump_type(type_dict[sink.id], workflow.cwlVersion), ) ) ) @@ -322,14 +518,17 @@ def static_checker(workflow: Workflow) -> None: msg = ( SourceLine(src, "type").makeError( "Source '%s' of type %s is incompatible" - % (parser.shortname(src.id), json_dumps(parser.save(type_dict[src.id]))) + % ( + shortname(src.id, workflow.cwlVersion), + dump_type(type_dict[src.id], workflow.cwlVersion), + ) ) + "\n" + SourceLine(sink, "type").makeError( " with sink '%s' of type %s" % ( - parser.shortname(sink.id), - json_dumps(parser.save(type_dict[sink.id])), + shortname(sink.id, workflow.cwlVersion), + dump_type(type_dict[sink.id], workflow.cwlVersion), ) ) ) @@ -353,7 +552,7 @@ def static_checker(workflow: Workflow) -> None: ): msg = SourceLine(sink).makeError( "Required parameter '%s' does not have source, default, or valueFrom expression" - % parser.shortname(sink.id) + % shortname(sink.id, workflow.cwlVersion), ) exception_msgs.append(msg) @@ -555,3 +754,15 @@ def param_for_source_id( raise ValidationException( f"Version error. Did not recognise {process.cwlVersion} as a CWL version" ) + + +def shortname(name: str, cwlVersion: Literal["v1.0", "v1.1", "v1.2"]) -> str: + match cwlVersion: + case "v1.0": + return cwl_v1_0.shortname(name) + case "v1.1": + return cwl_v1_1.shortname(name) + case "v1.2": + return cwl_v1_2.shortname(name) + case _: + raise Exception(f"Unsupported CWL version {cwlVersion}")