diff --git a/.flake8 b/.flake8 index 9149f7e2f..f21839109 100644 --- a/.flake8 +++ b/.flake8 @@ -2,7 +2,7 @@ ignore = E203,W503 max-line-length = 100 select = B,C,E,F,W,T4 -exclude = cwltool/schemas +exclude = cwltool/schemas,cwltool/fast_parser.py extend-ignore = E501,B905 # when Python 3.10 is the minimum version, re-enable check B905 for zip + strict extend-select = B9 diff --git a/Makefile b/Makefile index 125951e1c..8d4f75829 100644 --- a/Makefile +++ b/Makefile @@ -89,18 +89,18 @@ clean: FORCE # Linting and code style related targets ## sort_import : sorting imports using isort: https://github.com/timothycrosley/isort -sort_imports: $(PYSOURCES) mypy-stubs +sort_imports: $(filter-out cwltool/fast_parser.py,$(PYSOURCES)) mypy-stubs isort $^ -remove_unused_imports: $(PYSOURCES) +remove_unused_imports: $(filter-out cwltool/fast_parser.py,$(PYSOURCES)) autoflake --in-place --remove-all-unused-imports $^ pep257: pydocstyle ## pydocstyle : check Python docstring style -pydocstyle: $(PYSOURCES) +pydocstyle:$(filter-out cwltool/fast_parser.py,$(PYSOURCES)) pydocstyle --add-ignore=D100,D101,D102,D103 $^ || true -pydocstyle_report.txt: $(PYSOURCES) +pydocstyle_report.txt: $(filter-out cwltool/fast_parser.py,$(PYSOURCES)) pydocstyle setup.py $^ > $@ 2>&1 || true ## diff_pydocstyle_report : check Python docstring style for changed files only @@ -118,10 +118,10 @@ codespell-fix: ## format : check/fix all code indentation and formatting (runs black) format: - black --exclude cwltool/schemas setup.py cwltool.py cwltool tests mypy-stubs + black --exclude cwltool/fast_parser.py cwltool/schemas setup.py cwltool.py cwltool tests mypy-stubs format-check: - black --diff --check --exclude cwltool/schemas setup.py cwltool.py cwltool tests mypy-stubs + black --diff --check --exclude cwltool/fast_parser.py cwltool/schemas setup.py cwltool.py cwltool tests mypy-stubs ## pylint : run static code analysis on Python code pylint: $(PYSOURCES) @@ -159,11 +159,11 @@ diff-cover.html: coverage.xml diff-cover --compare-branch=main $^ --html-report $@ ## test : run the cwltool test suite -test: $(PYSOURCES) +test: $(filter-out cwltool/fast_parser.py,$(PYSOURCES)) python3 -m pytest ${PYTEST_EXTRA} ## testcov : run the cwltool test suite and collect coverage -testcov: $(PYSOURCES) +testcov: $(filter-out cwltool/fast_parser.py,$(PYSOURCES)) python3 -m pytest --cov --cov-config=.coveragerc --cov-report= ${PYTEST_EXTRA} sloccount.sc: $(PYSOURCES) Makefile @@ -178,10 +178,10 @@ list-author-emails: @git log --format='%aN,%aE' | sort -u | grep -v 'root' mypy3: mypy -mypy: $(PYSOURCES) +mypy: $(filter-out cwltool/fast_parser.py,$(PYSOURCES)) MYPYPATH=$$MYPYPATH:mypy-stubs mypy $^ -mypyc: $(PYSOURCES) +mypyc: $(filter-out cwltool/fast_parser.py,$(PYSOURCES)) MYPYPATH=mypy-stubs CWLTOOL_USE_MYPYC=1 pip install --verbose -e . \ && pytest -vv ${PYTEST_EXTRA} @@ -189,10 +189,20 @@ shellcheck: FORCE shellcheck build-cwltool-docker.sh cwl-docker.sh release-test.sh conformance-test.sh \ cwltool-in-docker.sh -pyupgrade: $(PYSOURCES) +pyupgrade: $(filter-out cwltool/fast_parser.py,$(PYSOURCES)) pyupgrade --exit-zero-even-if-changed --py310-plus $^ auto-walrus $^ +cwltool/fast_parser.py: FORCE + schema-salad-tool --codegen python \ + --codegen-parser-info "org.w3id.cwl.v1_2" \ + --codegen-parent "https://w3id.org/cwl/salad=schema_salad.metaschema" \ + --codegen-parent "https://w3id.org/cwl/cwl=cwl_utils.parser.cwl_v1_2" \ + https://github.com/common-workflow-language/cwl-v1.2/raw/codegen/extensions.yml \ + > $@ + +regen_fast_parser: cwltool/fast_parser.py + release-test: FORCE git diff-index --quiet HEAD -- || ( echo You have uncommitted changes, please commit them and try again; false ) ./release-test.sh @@ -207,7 +217,7 @@ release: twine upload testenv2/src/${MODULE}/dist/* && \ git tag ${VERSION} && git push --tags -flake8: $(PYSOURCES) +flake8: $(filter-out cwltool/fast_parser.py,$(PYSOURCES)) flake8 $^ FORCE: diff --git a/cwltool/context.py b/cwltool/context.py index f10623ec5..4e0714986 100644 --- a/cwltool/context.py +++ b/cwltool/context.py @@ -21,7 +21,7 @@ if TYPE_CHECKING: from _typeshed import SupportsWrite - from cwl_utils.parser.cwl_v1_2 import LoadingOptions + from schema_salad.runtime import LoadingOptions from .builder import Builder from .cwlprov.provenance_profile import ProvenanceProfile diff --git a/cwltool/fast_parser.py b/cwltool/fast_parser.py new file mode 100644 index 000000000..c8efbbcef --- /dev/null +++ b/cwltool/fast_parser.py @@ -0,0 +1,5168 @@ +# +# This file was autogenerated using schema-salad-tool --codegen=python +# 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 os +import sys +import uuid as _uuid__ +from collections.abc import Collection +from typing import ClassVar + +from schema_salad.runtime import ( + Saveable, + file_uri, + parse_errors, + prefix_url, + save, + save_relative_uri, +) + +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + +import schema_salad.metaschema +import cwl_utils.parser.cwl_v1_2 + +import copy +from collections.abc import MutableSequence, Sequence, MutableMapping +from io import StringIO +from itertools import chain +from typing import Any, Final, cast, Generic +from urllib.parse import urldefrag, urlsplit, urlunsplit + +from ruamel.yaml.comments import CommentedMap + +from schema_salad.exceptions import ValidationException, SchemaSaladException +from schema_salad.runtime import ( + LoadingOptions, + convert_typing, + extract_type, + SaveableType, +) +from schema_salad.sourceline import SourceLine, add_lc_filename +from schema_salad.utils import yaml_no_ts # requires schema-salad v8.2+ + +_vocab: Final[dict[str, str]] = {} +_rvocab: Final[dict[str, str]] = {} + + +class _Loader: + def load( + self, + doc: Any, + baseuri: str, + loadingOptions: LoadingOptions, + docRoot: str | None = None, + lc: Any | None = None, + ) -> Any | None: + pass + + +class _AnyLoader(_Loader): + def load( + self, + doc: Any, + baseuri: str, + loadingOptions: LoadingOptions, + docRoot: str | None = None, + lc: Any | None = None, + ) -> Any: + if doc is not None: + return doc + raise ValidationException("Expected non-null") + + +class _PrimitiveLoader(_Loader): + def __init__(self, tp: type | tuple[type[str], type[str]]) -> None: + self.tp: Final = tp + + def load( + self, + doc: Any, + baseuri: str, + loadingOptions: LoadingOptions, + 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__}") + return doc + + def __repr__(self) -> str: + return str(self.tp) + + +class _ArrayLoader(_Loader): + def __init__(self, items: _Loader) -> None: + self.items: Final = items + + def load( + self, + doc: Any, + baseuri: str, + loadingOptions: LoadingOptions, + 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)))}, " + f"but valid type for this field is an array." + ) + r: Final[list[Any]] = [] + errors: Final[list[SchemaSaladException]] = [] + fields: Final[list[str]] = [] + for i in range(0, len(doc)): + try: + lf = _load_field( + doc[i], _UnionLoader([self, self.items]), baseuri, loadingOptions, lc=lc + ) + flatten = loadingOptions.container != "@list" + if flatten and isinstance(lf, MutableSequence): + r.extend(lf) + else: + r.append(lf) + + if isinstance(doc[i], CommentedMap): + if doc[i].get("id") is not None: + if doc[i].get("id") in fields: + errors.append( + ValidationException( + f"Duplicate field {doc[i].get('id')!r}", + SourceLine(doc[i], "id", str), + [], + ) + ) + else: + fields.append(doc[i].get("id")) + + except ValidationException as e: + e = ValidationException( + "array item is invalid because", SourceLine(doc, i, str), [e] + ) + errors.append(e) + if errors: + raise ValidationException("", None, errors) + return r + + def __repr__(self) -> str: + return f"array<{self.items}>" + + +class _MapLoader(_Loader): + def __init__( + self, + values: _Loader, + name: str | None = None, + container: str | None = None, + no_link_check: bool | None = None, + ) -> None: + self.values: Final = values + self.name: Final = name + self.container: Final = container + self.no_link_check: Final = no_link_check + + def load( + self, + doc: Any, + baseuri: str, + loadingOptions: LoadingOptions, + 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: + loadingOptions = LoadingOptions( + copyfrom=loadingOptions, container=self.container, no_link_check=self.no_link_check + ) + r: Final[dict[str, Any]] = {} + errors: Final[list[SchemaSaladException]] = [] + for k, v in doc.items(): + try: + lf = _load_field(v, self.values, baseuri, loadingOptions, lc) + r[k] = lf + except ValidationException as e: + errors.append(e.with_sourceline(SourceLine(doc, k, str))) + if errors: + raise ValidationException("", None, errors) + return r + + def __repr__(self) -> str: + return self.name if self.name is not None else f"map" + + +class _EnumLoader(_Loader): + def __init__(self, symbols: Sequence[str], name: str) -> None: + self.symbols: Final = symbols + self.name: Final = name + + def load( + self, + doc: Any, + baseuri: str, + loadingOptions: LoadingOptions, + docRoot: str | None = None, + lc: Any | None = None, + ) -> str: + if doc in self.symbols: + return cast(str, 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: + self.inner: Final = inner + + def load( + self, + doc: Any, + baseuri: str, + loadingOptions: LoadingOptions, + docRoot: str | None = None, + lc: Any | None = None, + ) -> Any: + r: Final[list[dict[str, Any]]] = [] + 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 + ) + + if len(dict_copy): + raise ValidationException( + "Unallowed values in secondaryFiles specification entry: {}".format( + dict_copy + ) + ) + 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( + f"Missing pattern in secondaryFiles specification entry: {decl}" + ) + 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) + + 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, Generic[SaveableType]): + def __init__( + self, + classtype: type[SaveableType], + container: str | None = None, + no_link_check: bool | None = None, + ) -> None: + self.classtype: Final = classtype + self.container: Final = container + self.no_link_check: Final = no_link_check + + def load( + self, + doc: Any, + baseuri: str, + loadingOptions: LoadingOptions, + docRoot: str | None = None, + lc: Any | None = None, + ) -> SaveableType: + if not isinstance(doc, MutableMapping): + raise ValidationException( + f"Value is a {convert_typing(extract_type(type(doc)))}, " + f"but valid type for this field is an object." + ) + if self.container is not None or self.no_link_check is not None: + loadingOptions = LoadingOptions( + copyfrom=loadingOptions, container=self.container, no_link_check=self.no_link_check + ) + return self.classtype.fromDoc(doc, baseuri, loadingOptions, docRoot=docRoot) + + def __repr__(self) -> str: + return str(self.classtype.__name__) + + +class _ExpressionLoader(_Loader): + def __init__(self, items: type[str]) -> None: + self.items: Final = items + + def load( + self, + doc: Any, + baseuri: str, + loadingOptions: LoadingOptions, + 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." + ) + else: + return doc + + +class _UnionLoader(_Loader): + def __init__(self, alternates: Sequence[_Loader], name: str | None = None) -> None: + self.alternates = alternates + self.name: Final = name + + def add_loaders(self, loaders: Sequence[_Loader]) -> None: + self.alternates = tuple(loader for loader in chain(self.alternates, loaders)) + + def load( + self, + doc: Any, + baseuri: str, + loadingOptions: LoadingOptions, + docRoot: str | None = None, + lc: Any | None = None, + ) -> Any: + errors: Final = [] + + if lc is None: + lc = [] + + for t in self.alternates: + try: + return t.load(doc, baseuri, loadingOptions, docRoot=docRoot, lc=lc) + except ValidationException as e: + if isinstance(t, _ArrayLoader) and len(self.alternates) > 1: + continue + if isinstance(doc, (CommentedMap, dict)): + if "class" in doc: + if str(doc.get("class")) == str(t): + errors.append( + ValidationException( + f"Object `{baseuri.split('/')[-1]}` is not valid because:", + SourceLine(doc, next(iter(doc)), str), + [e], + ) + ) + else: + if "array" in str(t): + continue + else: + if "id" in doc: + id = baseuri.split("/")[-1] + "#" + str(doc.get("id")) + if "id" in lc: + errors.append( + ValidationException( + f"checking object `{id}` using `{t}`", + SourceLine(lc, "id", str), + [e], + ) + ) + else: + errors.append( + ValidationException( + f"checking object `{id}` using `{t}`", + SourceLine(lc, doc.get("id"), str), + [e], + ) + ) + else: + if not isinstance( + t, (_PrimitiveLoader) + ): # avoids 'tried was {x}' errors + errors.append( + ValidationException(f"tried `{t}` but", None, [e]) + ) + else: + # avoids "tried but x" and instead returns the values for parsing + errors.append(ValidationException("", None, [e])) + + if isinstance(doc, (CommentedMap, dict)) and "class" in doc: + if str(doc.get("class")) not in str(self.alternates): + errors.append( + ValidationException( + "Field `class` contains undefined reference to " + + "`" + + "/".join(baseuri.split("/")[0:-1]) + + "/" + + str(doc.get("class")) + + "`", + SourceLine(doc, "class", str), + [], + ) + ) + raise ValidationException("", None, errors, "*") + + 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): + def __init__( + self, + inner: _Loader, + scoped_id: bool, + vocab_term: bool, + scoped_ref: int | None, + no_link_check: bool | None, + ) -> None: + self.inner: Final = inner + self.scoped_id: Final = scoped_id + self.vocab_term: Final = vocab_term + self.scoped_ref: Final = scoped_ref + self.no_link_check: Final = no_link_check + + def load( + self, + doc: Any, + baseuri: str, + loadingOptions: LoadingOptions, + 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 + ) + 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 = [] + try: + if not loadingOptions.fetcher.check_exists(doc): + errors.append( + ValidationException(f"contains undefined reference to `{doc}`") + ) + except ValidationException: + pass + if len(errors) > 0: + raise ValidationException("", None, errors) + return self.inner.load(doc, baseuri, loadingOptions, lc=lc) + + +class _TypeDSLLoader(_Loader): + 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 + + def resolve( + self, + doc: str, + baseuri: str, + loadingOptions: LoadingOptions, + ) -> list[dict[str, Any] | str] | dict[str, Any] | str: + doc_ = doc + optional = False + if doc_.endswith("?"): + optional = True + doc_ = doc_[0:-1] + + if doc_.endswith("[]"): + salad_versions: Final = [int(v) for v in self.salad_version[1:].split(".")] + items: list[dict[str, Any] | str] | dict[str, Any] | str = "" + rest: Final = doc_[0:-2] + if salad_versions < [1, 3]: + if rest.endswith("[]"): + # To show the error message with the original type + return doc + else: + items = _expand_url( + rest, + baseuri, + loadingOptions, + False, + True, + self.refScope, + ) + else: + items = self.resolve(rest, baseuri, loadingOptions) + if isinstance(items, str): + items = _expand_url( + items, + baseuri, + loadingOptions, + False, + True, + self.refScope, + ) + expanded: dict[str, Any] | str = {"type": "array", "items": items} + else: + expanded = _expand_url( + doc_, + baseuri, + loadingOptions, + False, + True, + self.refScope, + ) + + if optional: + return ["null", expanded] + else: + return expanded + + def load( + self, + doc: Any, + baseuri: str, + loadingOptions: LoadingOptions, + docRoot: str | None = None, + lc: Any | None = None, + ) -> Any: + if isinstance(doc, MutableSequence): + r: Final[list[Any]] = [] + for d in doc: + if isinstance(d, str): + resolved = self.resolve(d, baseuri, loadingOptions) + if isinstance(resolved, MutableSequence): + for i in resolved: + if i not in r: + r.append(i) + else: + if resolved not in r: + r.append(resolved) + else: + r.append(d) + doc = r + elif isinstance(doc, str): + doc = self.resolve(doc, baseuri, loadingOptions) + + return self.inner.load(doc, baseuri, loadingOptions, lc=lc) + + +class _IdMapLoader(_Loader): + def __init__(self, inner: _Loader, mapSubject: str, mapPredicate: str | None) -> None: + self.inner: Final = inner + self.mapSubject: Final = mapSubject + self.mapPredicate: Final = mapPredicate + + def load( + self, + doc: Any, + baseuri: str, + loadingOptions: LoadingOptions, + docRoot: str | None = None, + lc: Any | None = None, + ) -> Any: + if isinstance(doc, MutableMapping): + r: Final[list[Any]] = [] + for k in doc.keys(): + val = doc[k] + if isinstance(val, CommentedMap): + v = copy.copy(val) + v.lc.data = val.lc.data + v.lc.filename = val.lc.filename + v[self.mapSubject] = k + r.append(v) + elif isinstance(val, MutableMapping): + v2 = copy.copy(val) + v2[self.mapSubject] = k + r.append(v2) + else: + if self.mapPredicate: + v3 = {self.mapPredicate: val} + v3[self.mapSubject] = k + r.append(v3) + else: + raise ValidationException("No mapPredicate") + doc = r + return self.inner.load(doc, baseuri, loadingOptions, lc=lc) + + +def _document_load( + loader: _Loader, + doc: str | MutableMapping[str, Any] | MutableSequence[Any], + baseuri: str, + loadingOptions: LoadingOptions, + addl_metadata_fields: MutableSequence[str] | None = None, +) -> tuple[Any, LoadingOptions]: + if isinstance(doc, str): + return _document_load_by_url( + loader, + loadingOptions.fetcher.urljoin(baseuri, doc), + loadingOptions, + addl_metadata_fields=addl_metadata_fields, + ) + + if isinstance(doc, MutableMapping): + addl_metadata: Final = {} + if addl_metadata_fields is not None: + for mf in addl_metadata_fields: + if mf in doc: + addl_metadata[mf] = doc[mf] + + docuri: Final = baseuri + if "$base" in doc: + baseuri = doc["$base"] + + loadingOptions = LoadingOptions( + copyfrom=loadingOptions, + namespaces=doc.get("$namespaces", None), + schemas=doc.get("$schemas", None), + baseuri=doc.get("$base", None), + addl_metadata=addl_metadata, + ) + + doc2: Final = copy.copy(doc) + if "$namespaces" in doc2: + doc2.pop("$namespaces") + if "$schemas" in doc2: + doc2.pop("$schemas") + if "$base" in doc2: + doc2.pop("$base") + + if "$graph" in doc2: + loadingOptions.idx[baseuri] = ( + loader.load(doc2["$graph"], baseuri, loadingOptions), + loadingOptions, + ) + else: + loadingOptions.idx[baseuri] = ( + loader.load(doc2, baseuri, loadingOptions, docRoot=baseuri), + loadingOptions, + ) + + if docuri != baseuri: + loadingOptions.idx[docuri] = loadingOptions.idx[baseuri] + + return loadingOptions.idx[baseuri] + + if isinstance(doc, MutableSequence): + loadingOptions.idx[baseuri] = ( + loader.load(doc, baseuri, loadingOptions), + loadingOptions, + ) + return loadingOptions.idx[baseuri] + + raise ValidationException( + "Expected URI string, MutableMapping or MutableSequence, got %s" % type(doc) + ) + + +def _document_load_by_url( + loader: _Loader, + url: str, + loadingOptions: LoadingOptions, + addl_metadata_fields: MutableSequence[str] | None = None, +) -> tuple[Any, LoadingOptions]: + if url in loadingOptions.idx: + return loadingOptions.idx[url] + + doc_url, frg = urldefrag(url) + + text: Final = loadingOptions.fetcher.fetch_text(doc_url) + textIO: Final = StringIO(text) + textIO.name = str(doc_url) + yaml: Final = yaml_no_ts() + result: Final = yaml.load(textIO) + add_lc_filename(result, doc_url) + + loadingOptions = LoadingOptions(copyfrom=loadingOptions, fileuri=doc_url) + + _document_load( + loader, + result, + doc_url, + loadingOptions, + addl_metadata_fields=addl_metadata_fields, + ) + + return loadingOptions.idx[url] + + +def _expand_url( + url: str, + base_url: str, + loadingOptions: LoadingOptions, + scoped_id: bool = False, + vocab_term: bool = False, + scoped_ref: int | None = None, +) -> str: + if url in ("@id", "@type"): + return url + + vocab = _vocab | loadingOptions.vocab + if vocab_term and url in vocab: + return url + + if bool(vocab) and ":" in url: + prefix: Final = url.split(":")[0] + if prefix in vocab: + url = vocab[prefix] + url[len(prefix) + 1 :] + + split1: Final = urlsplit(url) + + if ( + (bool(split1.scheme) and split1.scheme in loadingOptions.fetcher.supported_schemes()) + or url.startswith("$(") + or url.startswith("${") + ): + pass + elif scoped_id and not bool(split1.fragment): + splitbase1: Final = urlsplit(base_url) + frg: str + if bool(splitbase1.fragment): + frg = splitbase1.fragment + "/" + split1.path + else: + frg = split1.path + pt: Final = splitbase1.path if splitbase1.path != "" else "/" + url = urlunsplit((splitbase1.scheme, splitbase1.netloc, pt, splitbase1.query, frg)) + elif scoped_ref is not None and not bool(split1.fragment): + splitbase2: Final = urlsplit(base_url) + sp = splitbase2.fragment.split("/") + n = scoped_ref + while n > 0 and len(sp) > 0: + sp.pop() + n -= 1 + sp.append(url) + url = urlunsplit( + ( + splitbase2.scheme, + splitbase2.netloc, + splitbase2.path, + splitbase2.query, + "/".join(sp), + ) + ) + else: + url = loadingOptions.fetcher.urljoin(base_url, url) + + if vocab_term: + split2: Final = urlsplit(url) + if bool(split2.scheme): + if url in (rvocab := _rvocab | loadingOptions.rvocab): + return rvocab[url] + else: + raise ValidationException(f"Term {url!r} not in vocabulary") + + return url + + +def _load_field( + val: Any | None, + fieldtype: "_Loader", + baseuri: str, + loadingOptions: LoadingOptions, + lc: Any | None = None, +) -> Any: + """Load field.""" + if isinstance(val, MutableMapping): + if "$import" in val: + if loadingOptions.fileuri is None: + raise SchemaSaladException("Cannot load $import without fileuri") + url1: Final = loadingOptions.fetcher.urljoin(loadingOptions.fileuri, val["$import"]) + result, metadata = _document_load_by_url( + fieldtype, + url1, + loadingOptions, + ) + loadingOptions.imports.append(url1) + return result + if "$include" in val: + if loadingOptions.fileuri is None: + raise SchemaSaladException("Cannot load $import without fileuri") + url2: Final = loadingOptions.fetcher.urljoin(loadingOptions.fileuri, val["$include"]) + val = loadingOptions.fetcher.fetch_text(url2) + loadingOptions.includes.append(url2) + return fieldtype.load(val, baseuri, loadingOptions, lc=lc) + + +def parser_info() -> str: + return "org.w3id.cwl.v1_2" + + +class Secrets(cwl_utils.parser.cwl_v1_2.ProcessRequirement): + def __init__( + self, + secrets: Any, + 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] = "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) + return False + + def __hash__(self) -> int: + return hash((self.class_, self.secrets)) + + @classmethod + def fromDoc( + cls, + doc: Any, + baseuri: str, + loadingOptions: LoadingOptions, + docRoot: str | None = None + ) -> Self: + _doc = copy.copy(doc) + + if hasattr(doc, "lc"): + _doc.lc.data = doc.lc.data + _doc.lc.filename = doc.lc.filename + _errors__ = [] + try: + if _doc.get("class") is None: + raise ValidationException("missing required field `class`", None, []) + + class_ = _load_field( + _doc.get("class"), + uri_strtype_False_True_None_None, + baseuri, + loadingOptions, + lc=_doc.get("class") + ) + + vocab = _vocab | loadingOptions.vocab + if class_ not in (cls.__name__, vocab.get(cls.__name__)): + raise ValidationException(f"tried `{cls.__name__}` but") + except ValidationException as e: + raise e + try: + if _doc.get("secrets") is None: + raise ValidationException("missing required field `secrets`", None, []) + + secrets = _load_field( + _doc.get("secrets"), + uri_array_of_strtype_False_False_0_None, + baseuri, + loadingOptions, + lc=_doc.get("secrets") + ) + + except ValidationException as e: + error_message, to_print, verb_tensage = parse_errors(str(e)) + + if str(e) == "missing required field `secrets`": + _errors__.append( + ValidationException( + str(e), + None + ) + ) + else: + val = _doc.get("secrets") + if error_message != str(e): + val_type = convert_typing(extract_type(type(val))) + _errors__.append( + ValidationException( + "the `secrets` field is not valid because:", + SourceLine(_doc, "secrets", str), + [ValidationException(f"Value is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}", + detailed_message=f"Value `{val}` is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}")], + ) + ) + else: + _errors__.append( + ValidationException( + "the `secrets` field is not valid because:", + SourceLine(_doc, "secrets", str), + [e], + detailed_message=f"the `secrets` field with value `{val}` " + "is not valid because:", + ) + ) + extension_fields: MutableMapping[str, Any] = {} + for k in _doc.keys(): + if k not in cls.attrs: + if not k: + _errors__.append( + ValidationException("mapping with implicit null key") + ) + elif ":" in k: + ex = _expand_url( + k, "", loadingOptions, scoped_id=False, vocab_term=False + ) + extension_fields[ex] = _doc[k] + else: + _errors__.append( + ValidationException( + "invalid field `{}`, expected one of: `class`, `secrets`".format( + k + ), + SourceLine(_doc, k, str), + ) + ) + + if _errors__: + raise ValidationException("", None, _errors__, "*") + _constructed = cls( + secrets=secrets, + extension_fields=extension_fields, + loadingOptions=loadingOptions, + ) + return _constructed + + def save( + self, top: bool = False, base_url: str = "", relative_uris: bool = True + ) -> dict[str, Any]: + r: dict[str, Any] = {} + + if relative_uris: + for ef in self.extension_fields: + r[prefix_url(ef, self.loadingOptions.vocab)] = self.extension_fields[ef] + else: + for ef in self.extension_fields: + r[ef] = self.extension_fields[ef] + if self.class_ is not None: + vocab = _vocab | self.loadingOptions.vocab + rvocab = _rvocab | self.loadingOptions.rvocab + uri = vocab[self.class_] + if p := rvocab.get(uri[: -len(self.class_)]): + uri = f"{p}:{self.class_}" + else: + uri = self.class_ + u = save_relative_uri(uri, base_url, False, None, relative_uris) + r["class"] = u + if self.secrets is not None: + u = save_relative_uri(self.secrets, base_url, False, 0, relative_uris) + r["secrets"] = u + + # top refers to the directory level + if top: + if self.loadingOptions.namespaces: + r["$namespaces"] = self.loadingOptions.namespaces + if self.loadingOptions.schemas: + r["$schemas"] = self.loadingOptions.schemas + return r + + attrs: ClassVar[Collection[str]] = frozenset(["class", "secrets"]) + + +class ProcessGenerator(cwl_utils.parser.cwl_v1_2.Process): + id: str + + def __init__( + self, + inputs: Any, + outputs: Any, + run: Any, + id: Any | None = None, + label: Any | None = None, + doc: Any | None = None, + requirements: Any | None = None, + hints: Any | None = None, + cwlVersion: Any | None = None, + intent: Any | 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.intent = intent + self.class_: Final[str] = "ProcessGenerator" + self.run = run + + def __eq__(self, other: Any) -> bool: + if isinstance(other, ProcessGenerator): + return bool( + self.id == other.id + and self.label == other.label + and self.doc == other.doc + and self.inputs == other.inputs + and self.outputs == other.outputs + and self.requirements == other.requirements + and self.hints == other.hints + and self.cwlVersion == other.cwlVersion + and self.intent == other.intent + and self.class_ == other.class_ + and self.run == other.run + ) + return False + + def __hash__(self) -> int: + return hash( + ( + self.id, + self.label, + self.doc, + self.inputs, + self.outputs, + self.requirements, + self.hints, + self.cwlVersion, + self.intent, + self.class_, + self.run, + ) + ) + + @classmethod + def fromDoc( + cls, + doc: Any, + baseuri: str, + loadingOptions: LoadingOptions, + docRoot: str | None = None + ) -> Self: + _doc = copy.copy(doc) + + if hasattr(doc, "lc"): + _doc.lc.data = doc.lc.data + _doc.lc.filename = doc.lc.filename + _errors__ = [] + id = None + if "id" in _doc: + try: + id = _load_field( + _doc.get("id"), + uri_union_of_None_type_or_strtype_True_False_None_None, + baseuri, + loadingOptions, + lc=_doc.get("id") + ) + + except ValidationException as e: + error_message, to_print, verb_tensage = parse_errors(str(e)) + + if str(e) == "missing required field `id`": + _errors__.append( + ValidationException( + str(e), + None + ) + ) + else: + val = _doc.get("id") + if error_message != str(e): + val_type = convert_typing(extract_type(type(val))) + _errors__.append( + ValidationException( + "the `id` field is not valid because:", + SourceLine(_doc, "id", str), + [ValidationException(f"Value is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}", + detailed_message=f"Value `{val}` is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}")], + ) + ) + else: + _errors__.append( + ValidationException( + "the `id` field is not valid because:", + SourceLine(_doc, "id", str), + [e], + detailed_message=f"the `id` field with value `{val}` " + "is not valid because:", + ) + ) + + __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) + try: + if _doc.get("class") is None: + raise ValidationException("missing required field `class`", None, []) + + class_ = _load_field( + _doc.get("class"), + uri_strtype_False_True_None_None, + baseuri, + loadingOptions, + lc=_doc.get("class") + ) + + vocab = _vocab | loadingOptions.vocab + if class_ not in (cls.__name__, vocab.get(cls.__name__)): + raise ValidationException(f"tried `{cls.__name__}` but") + except ValidationException as e: + raise e + label = None + if "label" in _doc: + try: + label = _load_field( + _doc.get("label"), + union_of_None_type_or_strtype, + baseuri, + loadingOptions, + lc=_doc.get("label") + ) + + except ValidationException as e: + error_message, to_print, verb_tensage = parse_errors(str(e)) + + if str(e) == "missing required field `label`": + _errors__.append( + ValidationException( + str(e), + None + ) + ) + else: + val = _doc.get("label") + if error_message != str(e): + val_type = convert_typing(extract_type(type(val))) + _errors__.append( + ValidationException( + "the `label` field is not valid because:", + SourceLine(_doc, "label", str), + [ValidationException(f"Value is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}", + detailed_message=f"Value `{val}` is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}")], + ) + ) + else: + _errors__.append( + ValidationException( + "the `label` field is not valid because:", + SourceLine(_doc, "label", str), + [e], + detailed_message=f"the `label` field with value `{val}` " + "is not valid because:", + ) + ) + doc = None + if "doc" in _doc: + try: + doc = _load_field( + _doc.get("doc"), + union_of_None_type_or_strtype_or_array_of_strtype, + baseuri, + loadingOptions, + lc=_doc.get("doc") + ) + + except ValidationException as e: + error_message, to_print, verb_tensage = parse_errors(str(e)) + + if str(e) == "missing required field `doc`": + _errors__.append( + ValidationException( + str(e), + None + ) + ) + else: + val = _doc.get("doc") + if error_message != str(e): + val_type = convert_typing(extract_type(type(val))) + _errors__.append( + ValidationException( + "the `doc` field is not valid because:", + SourceLine(_doc, "doc", str), + [ValidationException(f"Value is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}", + detailed_message=f"Value `{val}` is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}")], + ) + ) + else: + _errors__.append( + ValidationException( + "the `doc` field is not valid because:", + SourceLine(_doc, "doc", str), + [e], + detailed_message=f"the `doc` field with value `{val}` " + "is not valid because:", + ) + ) + try: + if _doc.get("inputs") is None: + raise ValidationException("missing required field `inputs`", None, []) + + inputs = _load_field( + _doc.get("inputs"), + idmap_inputs_array_of_WorkflowInputParameterLoader, + baseuri, + loadingOptions, + lc=_doc.get("inputs") + ) + + except ValidationException as e: + error_message, to_print, verb_tensage = parse_errors(str(e)) + + if str(e) == "missing required field `inputs`": + _errors__.append( + ValidationException( + str(e), + None + ) + ) + else: + val = _doc.get("inputs") + if error_message != str(e): + val_type = convert_typing(extract_type(type(val))) + _errors__.append( + ValidationException( + "the `inputs` field is not valid because:", + SourceLine(_doc, "inputs", str), + [ValidationException(f"Value is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}", + detailed_message=f"Value `{val}` is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}")], + ) + ) + else: + _errors__.append( + ValidationException( + "the `inputs` field is not valid because:", + SourceLine(_doc, "inputs", str), + [e], + detailed_message=f"the `inputs` field with value `{val}` " + "is not valid because:", + ) + ) + try: + if _doc.get("outputs") is None: + raise ValidationException("missing required field `outputs`", None, []) + + outputs = _load_field( + _doc.get("outputs"), + idmap_outputs_array_of_ExpressionToolOutputParameterLoader, + baseuri, + loadingOptions, + lc=_doc.get("outputs") + ) + + except ValidationException as e: + error_message, to_print, verb_tensage = parse_errors(str(e)) + + if str(e) == "missing required field `outputs`": + _errors__.append( + ValidationException( + str(e), + None + ) + ) + else: + val = _doc.get("outputs") + if error_message != str(e): + val_type = convert_typing(extract_type(type(val))) + _errors__.append( + ValidationException( + "the `outputs` field is not valid because:", + SourceLine(_doc, "outputs", str), + [ValidationException(f"Value is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}", + detailed_message=f"Value `{val}` is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}")], + ) + ) + else: + _errors__.append( + ValidationException( + "the `outputs` field is not valid because:", + SourceLine(_doc, "outputs", str), + [e], + detailed_message=f"the `outputs` field with value `{val}` " + "is not valid because:", + ) + ) + requirements = None + if "requirements" in _doc: + try: + requirements = _load_field( + _doc.get("requirements"), + 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, + baseuri, + loadingOptions, + lc=_doc.get("requirements") + ) + + except ValidationException as e: + error_message, to_print, verb_tensage = parse_errors(str(e)) + + if str(e) == "missing required field `requirements`": + _errors__.append( + ValidationException( + str(e), + None + ) + ) + else: + val = _doc.get("requirements") + if error_message != str(e): + val_type = convert_typing(extract_type(type(val))) + _errors__.append( + ValidationException( + "the `requirements` field is not valid because:", + SourceLine(_doc, "requirements", str), + [ValidationException(f"Value is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}", + detailed_message=f"Value `{val}` is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}")], + ) + ) + else: + _errors__.append( + ValidationException( + "the `requirements` field is not valid because:", + SourceLine(_doc, "requirements", str), + [e], + detailed_message=f"the `requirements` field with value `{val}` " + "is not valid because:", + ) + ) + hints = None + if "hints" in _doc: + try: + hints = _load_field( + _doc.get("hints"), + 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, + baseuri, + loadingOptions, + lc=_doc.get("hints") + ) + + except ValidationException as e: + error_message, to_print, verb_tensage = parse_errors(str(e)) + + if str(e) == "missing required field `hints`": + _errors__.append( + ValidationException( + str(e), + None + ) + ) + else: + val = _doc.get("hints") + if error_message != str(e): + val_type = convert_typing(extract_type(type(val))) + _errors__.append( + ValidationException( + "the `hints` field is not valid because:", + SourceLine(_doc, "hints", str), + [ValidationException(f"Value is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}", + detailed_message=f"Value `{val}` is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}")], + ) + ) + else: + _errors__.append( + ValidationException( + "the `hints` field is not valid because:", + SourceLine(_doc, "hints", str), + [e], + detailed_message=f"the `hints` field with value `{val}` " + "is not valid because:", + ) + ) + cwlVersion = None + if "cwlVersion" in _doc: + try: + cwlVersion = _load_field( + _doc.get("cwlVersion"), + uri_union_of_None_type_or_CWLVersionLoader_False_True_None_None, + baseuri, + loadingOptions, + lc=_doc.get("cwlVersion") + ) + + except ValidationException as e: + error_message, to_print, verb_tensage = parse_errors(str(e)) + + if str(e) == "missing required field `cwlVersion`": + _errors__.append( + ValidationException( + str(e), + None + ) + ) + else: + val = _doc.get("cwlVersion") + if error_message != str(e): + val_type = convert_typing(extract_type(type(val))) + _errors__.append( + ValidationException( + "the `cwlVersion` field is not valid because:", + SourceLine(_doc, "cwlVersion", str), + [ValidationException(f"Value is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}", + detailed_message=f"Value `{val}` is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}")], + ) + ) + else: + _errors__.append( + ValidationException( + "the `cwlVersion` field is not valid because:", + SourceLine(_doc, "cwlVersion", str), + [e], + detailed_message=f"the `cwlVersion` field with value `{val}` " + "is not valid because:", + ) + ) + intent = None + if "intent" in _doc: + try: + intent = _load_field( + _doc.get("intent"), + uri_union_of_None_type_or_array_of_strtype_True_False_None_None, + baseuri, + loadingOptions, + lc=_doc.get("intent") + ) + + except ValidationException as e: + error_message, to_print, verb_tensage = parse_errors(str(e)) + + if str(e) == "missing required field `intent`": + _errors__.append( + ValidationException( + str(e), + None + ) + ) + else: + val = _doc.get("intent") + if error_message != str(e): + val_type = convert_typing(extract_type(type(val))) + _errors__.append( + ValidationException( + "the `intent` field is not valid because:", + SourceLine(_doc, "intent", str), + [ValidationException(f"Value is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}", + detailed_message=f"Value `{val}` is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}")], + ) + ) + else: + _errors__.append( + ValidationException( + "the `intent` field is not valid because:", + SourceLine(_doc, "intent", str), + [e], + detailed_message=f"the `intent` field with value `{val}` " + "is not valid because:", + ) + ) + + subscope_baseuri = _expand_url('run', baseuri, loadingOptions, True) + try: + if _doc.get("run") is None: + raise ValidationException("missing required field `run`", None, []) + + run = _load_field( + _doc.get("run"), + uri_union_of_strtype_or_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader_or_ProcessGeneratorLoader_False_False_None_None, + subscope_baseuri, + loadingOptions, + lc=_doc.get("run") + ) + + except ValidationException as e: + error_message, to_print, verb_tensage = parse_errors(str(e)) + + if str(e) == "missing required field `run`": + _errors__.append( + ValidationException( + str(e), + None + ) + ) + else: + val = _doc.get("run") + if error_message != str(e): + val_type = convert_typing(extract_type(type(val))) + _errors__.append( + ValidationException( + "the `run` field is not valid because:", + SourceLine(_doc, "run", str), + [ValidationException(f"Value is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}", + detailed_message=f"Value `{val}` is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}")], + ) + ) + else: + _errors__.append( + ValidationException( + "the `run` field is not valid because:", + SourceLine(_doc, "run", str), + [e], + detailed_message=f"the `run` field with value `{val}` " + "is not valid because:", + ) + ) + extension_fields: MutableMapping[str, Any] = {} + for k in _doc.keys(): + if k not in cls.attrs: + if not k: + _errors__.append( + ValidationException("mapping with implicit null key") + ) + elif ":" in k: + ex = _expand_url( + k, "", loadingOptions, scoped_id=False, vocab_term=False + ) + extension_fields[ex] = _doc[k] + else: + _errors__.append( + ValidationException( + "invalid field `{}`, expected one of: `id`, `label`, `doc`, `inputs`, `outputs`, `requirements`, `hints`, `cwlVersion`, `intent`, `class`, `run`".format( + k + ), + SourceLine(_doc, k, str), + ) + ) + + if _errors__: + raise ValidationException("", None, _errors__, "*") + _constructed = cls( + id=id, + label=label, + doc=doc, + inputs=inputs, + outputs=outputs, + requirements=requirements, + hints=hints, + cwlVersion=cwlVersion, + intent=intent, + run=run, + extension_fields=extension_fields, + loadingOptions=loadingOptions, + ) + loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + return _constructed + + def save( + self, top: bool = False, base_url: str = "", relative_uris: bool = True + ) -> dict[str, Any]: + r: dict[str, Any] = {} + + if relative_uris: + for ef in self.extension_fields: + r[prefix_url(ef, self.loadingOptions.vocab)] = self.extension_fields[ef] + else: + 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) + r["id"] = u + if self.class_ is not None: + vocab = _vocab | self.loadingOptions.vocab + rvocab = _rvocab | self.loadingOptions.rvocab + uri = vocab[self.class_] + if p := rvocab.get(uri[: -len(self.class_)]): + uri = f"{p}:{self.class_}" + else: + uri = self.class_ + u = save_relative_uri(uri, self.id, False, None, relative_uris) + r["class"] = u + if self.label is not None: + r["label"] = save( + self.label, top=False, base_url=self.id, relative_uris=relative_uris + ) + if self.doc is not None: + r["doc"] = save( + self.doc, top=False, base_url=self.id, relative_uris=relative_uris + ) + if self.inputs is not None: + r["inputs"] = save( + self.inputs, top=False, base_url=self.id, relative_uris=relative_uris + ) + if self.outputs is not None: + r["outputs"] = save( + self.outputs, top=False, base_url=self.id, relative_uris=relative_uris + ) + if self.requirements is not None: + r["requirements"] = save( + self.requirements, + top=False, + base_url=self.id, + relative_uris=relative_uris, + ) + if self.hints is not None: + r["hints"] = save( + self.hints, top=False, base_url=self.id, relative_uris=relative_uris + ) + if self.cwlVersion is not None: + u = save_relative_uri(self.cwlVersion, self.id, False, None, relative_uris) + r["cwlVersion"] = u + if self.intent is not None: + u = save_relative_uri(self.intent, self.id, True, None, relative_uris) + r["intent"] = u + if self.run is not None: + u = save_relative_uri(self.run, self.id, False, None, relative_uris) + r["run"] = u + + # top refers to the directory level + if top: + if self.loadingOptions.namespaces: + r["$namespaces"] = self.loadingOptions.namespaces + if self.loadingOptions.schemas: + r["$schemas"] = self.loadingOptions.schemas + return r + + attrs: ClassVar[Collection[str]] = frozenset( + [ + "id", + "label", + "doc", + "inputs", + "outputs", + "requirements", + "hints", + "cwlVersion", + "intent", + "class", + "run", + ] + ) + + +class MPIRequirement(cwl_utils.parser.cwl_v1_2.ProcessRequirement): + """ + Indicates that a process requires an MPI runtime. + + """ + + def __init__( + self, + processes: Any, + 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] = "MPIRequirement" + self.processes = processes + + def __eq__(self, other: Any) -> bool: + if isinstance(other, MPIRequirement): + return bool( + self.class_ == other.class_ and self.processes == other.processes + ) + return False + + def __hash__(self) -> int: + return hash((self.class_, self.processes)) + + @classmethod + def fromDoc( + cls, + doc: Any, + baseuri: str, + loadingOptions: LoadingOptions, + docRoot: str | None = None + ) -> Self: + _doc = copy.copy(doc) + + if hasattr(doc, "lc"): + _doc.lc.data = doc.lc.data + _doc.lc.filename = doc.lc.filename + _errors__ = [] + try: + if _doc.get("class") is None: + raise ValidationException("missing required field `class`", None, []) + + class_ = _load_field( + _doc.get("class"), + uri_strtype_False_True_None_None, + baseuri, + loadingOptions, + lc=_doc.get("class") + ) + + vocab = _vocab | loadingOptions.vocab + if class_ not in (cls.__name__, vocab.get(cls.__name__)): + raise ValidationException(f"tried `{cls.__name__}` but") + except ValidationException as e: + raise e + try: + if _doc.get("processes") is None: + raise ValidationException("missing required field `processes`", None, []) + + processes = _load_field( + _doc.get("processes"), + union_of_inttype_or_ExpressionLoader, + baseuri, + loadingOptions, + lc=_doc.get("processes") + ) + + except ValidationException as e: + error_message, to_print, verb_tensage = parse_errors(str(e)) + + if str(e) == "missing required field `processes`": + _errors__.append( + ValidationException( + str(e), + None + ) + ) + else: + val = _doc.get("processes") + if error_message != str(e): + val_type = convert_typing(extract_type(type(val))) + _errors__.append( + ValidationException( + "the `processes` field is not valid because:", + SourceLine(_doc, "processes", str), + [ValidationException(f"Value is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}", + detailed_message=f"Value `{val}` is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}")], + ) + ) + else: + _errors__.append( + ValidationException( + "the `processes` field is not valid because:", + SourceLine(_doc, "processes", str), + [e], + detailed_message=f"the `processes` field with value `{val}` " + "is not valid because:", + ) + ) + extension_fields: MutableMapping[str, Any] = {} + for k in _doc.keys(): + if k not in cls.attrs: + if not k: + _errors__.append( + ValidationException("mapping with implicit null key") + ) + elif ":" in k: + ex = _expand_url( + k, "", loadingOptions, scoped_id=False, vocab_term=False + ) + extension_fields[ex] = _doc[k] + else: + _errors__.append( + ValidationException( + "invalid field `{}`, expected one of: `class`, `processes`".format( + k + ), + SourceLine(_doc, k, str), + ) + ) + + if _errors__: + raise ValidationException("", None, _errors__, "*") + _constructed = cls( + processes=processes, + extension_fields=extension_fields, + loadingOptions=loadingOptions, + ) + return _constructed + + def save( + self, top: bool = False, base_url: str = "", relative_uris: bool = True + ) -> dict[str, Any]: + r: dict[str, Any] = {} + + if relative_uris: + for ef in self.extension_fields: + r[prefix_url(ef, self.loadingOptions.vocab)] = self.extension_fields[ef] + else: + for ef in self.extension_fields: + r[ef] = self.extension_fields[ef] + if self.class_ is not None: + vocab = _vocab | self.loadingOptions.vocab + rvocab = _rvocab | self.loadingOptions.rvocab + uri = vocab[self.class_] + if p := rvocab.get(uri[: -len(self.class_)]): + uri = f"{p}:{self.class_}" + else: + uri = self.class_ + u = save_relative_uri(uri, base_url, False, None, relative_uris) + r["class"] = u + if self.processes is not None: + r["processes"] = save( + self.processes, + top=False, + base_url=base_url, + relative_uris=relative_uris, + ) + + # top refers to the directory level + if top: + if self.loadingOptions.namespaces: + r["$namespaces"] = self.loadingOptions.namespaces + if self.loadingOptions.schemas: + r["$schemas"] = self.loadingOptions.schemas + return r + + attrs: ClassVar[Collection[str]] = frozenset(["class", "processes"]) + + +class CUDARequirement(cwl_utils.parser.cwl_v1_2.ProcessRequirement): + """ + Require support for NVIDA CUDA (GPU hardware acceleration). + + """ + + def __init__( + self, + cudaComputeCapability: Any, + cudaVersionMin: Any, + cudaDeviceCountMax: Any | None = None, + cudaDeviceCountMin: Any | 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.class_: Final[str] = "CUDARequirement" + self.cudaComputeCapability = cudaComputeCapability + self.cudaDeviceCountMax = cudaDeviceCountMax + self.cudaDeviceCountMin = cudaDeviceCountMin + self.cudaVersionMin = cudaVersionMin + + def __eq__(self, other: Any) -> bool: + if isinstance(other, CUDARequirement): + return bool( + self.class_ == other.class_ + and self.cudaComputeCapability == other.cudaComputeCapability + and self.cudaDeviceCountMax == other.cudaDeviceCountMax + and self.cudaDeviceCountMin == other.cudaDeviceCountMin + and self.cudaVersionMin == other.cudaVersionMin + ) + return False + + def __hash__(self) -> int: + return hash( + ( + self.class_, + self.cudaComputeCapability, + self.cudaDeviceCountMax, + self.cudaDeviceCountMin, + self.cudaVersionMin, + ) + ) + + @classmethod + def fromDoc( + cls, + doc: Any, + baseuri: str, + loadingOptions: LoadingOptions, + docRoot: str | None = None + ) -> Self: + _doc = copy.copy(doc) + + if hasattr(doc, "lc"): + _doc.lc.data = doc.lc.data + _doc.lc.filename = doc.lc.filename + _errors__ = [] + try: + if _doc.get("class") is None: + raise ValidationException("missing required field `class`", None, []) + + class_ = _load_field( + _doc.get("class"), + uri_strtype_False_True_None_None, + baseuri, + loadingOptions, + lc=_doc.get("class") + ) + + vocab = _vocab | loadingOptions.vocab + if class_ not in (cls.__name__, vocab.get(cls.__name__)): + raise ValidationException(f"tried `{cls.__name__}` but") + except ValidationException as e: + raise e + try: + if _doc.get("cudaComputeCapability") is None: + raise ValidationException("missing required field `cudaComputeCapability`", None, []) + + cudaComputeCapability = _load_field( + _doc.get("cudaComputeCapability"), + union_of_strtype_or_array_of_strtype, + baseuri, + loadingOptions, + lc=_doc.get("cudaComputeCapability") + ) + + except ValidationException as e: + error_message, to_print, verb_tensage = parse_errors(str(e)) + + if str(e) == "missing required field `cudaComputeCapability`": + _errors__.append( + ValidationException( + str(e), + None + ) + ) + else: + val = _doc.get("cudaComputeCapability") + if error_message != str(e): + val_type = convert_typing(extract_type(type(val))) + _errors__.append( + ValidationException( + "the `cudaComputeCapability` field is not valid because:", + SourceLine(_doc, "cudaComputeCapability", str), + [ValidationException(f"Value is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}", + detailed_message=f"Value `{val}` is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}")], + ) + ) + else: + _errors__.append( + ValidationException( + "the `cudaComputeCapability` field is not valid because:", + SourceLine(_doc, "cudaComputeCapability", str), + [e], + detailed_message=f"the `cudaComputeCapability` field with value `{val}` " + "is not valid because:", + ) + ) + cudaDeviceCountMax = None + if "cudaDeviceCountMax" in _doc: + try: + cudaDeviceCountMax = _load_field( + _doc.get("cudaDeviceCountMax"), + union_of_None_type_or_inttype_or_ExpressionLoader, + baseuri, + loadingOptions, + lc=_doc.get("cudaDeviceCountMax") + ) + + except ValidationException as e: + error_message, to_print, verb_tensage = parse_errors(str(e)) + + if str(e) == "missing required field `cudaDeviceCountMax`": + _errors__.append( + ValidationException( + str(e), + None + ) + ) + else: + val = _doc.get("cudaDeviceCountMax") + if error_message != str(e): + val_type = convert_typing(extract_type(type(val))) + _errors__.append( + ValidationException( + "the `cudaDeviceCountMax` field is not valid because:", + SourceLine(_doc, "cudaDeviceCountMax", str), + [ValidationException(f"Value is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}", + detailed_message=f"Value `{val}` is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}")], + ) + ) + else: + _errors__.append( + ValidationException( + "the `cudaDeviceCountMax` field is not valid because:", + SourceLine(_doc, "cudaDeviceCountMax", str), + [e], + detailed_message=f"the `cudaDeviceCountMax` field with value `{val}` " + "is not valid because:", + ) + ) + cudaDeviceCountMin = None + if "cudaDeviceCountMin" in _doc: + try: + cudaDeviceCountMin = _load_field( + _doc.get("cudaDeviceCountMin"), + union_of_None_type_or_inttype_or_ExpressionLoader, + baseuri, + loadingOptions, + lc=_doc.get("cudaDeviceCountMin") + ) + + except ValidationException as e: + error_message, to_print, verb_tensage = parse_errors(str(e)) + + if str(e) == "missing required field `cudaDeviceCountMin`": + _errors__.append( + ValidationException( + str(e), + None + ) + ) + else: + val = _doc.get("cudaDeviceCountMin") + if error_message != str(e): + val_type = convert_typing(extract_type(type(val))) + _errors__.append( + ValidationException( + "the `cudaDeviceCountMin` field is not valid because:", + SourceLine(_doc, "cudaDeviceCountMin", str), + [ValidationException(f"Value is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}", + detailed_message=f"Value `{val}` is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}")], + ) + ) + else: + _errors__.append( + ValidationException( + "the `cudaDeviceCountMin` field is not valid because:", + SourceLine(_doc, "cudaDeviceCountMin", str), + [e], + detailed_message=f"the `cudaDeviceCountMin` field with value `{val}` " + "is not valid because:", + ) + ) + try: + if _doc.get("cudaVersionMin") is None: + raise ValidationException("missing required field `cudaVersionMin`", None, []) + + cudaVersionMin = _load_field( + _doc.get("cudaVersionMin"), + strtype, + baseuri, + loadingOptions, + lc=_doc.get("cudaVersionMin") + ) + + except ValidationException as e: + error_message, to_print, verb_tensage = parse_errors(str(e)) + + if str(e) == "missing required field `cudaVersionMin`": + _errors__.append( + ValidationException( + str(e), + None + ) + ) + else: + val = _doc.get("cudaVersionMin") + if error_message != str(e): + val_type = convert_typing(extract_type(type(val))) + _errors__.append( + ValidationException( + "the `cudaVersionMin` field is not valid because:", + SourceLine(_doc, "cudaVersionMin", str), + [ValidationException(f"Value is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}", + detailed_message=f"Value `{val}` is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}")], + ) + ) + else: + _errors__.append( + ValidationException( + "the `cudaVersionMin` field is not valid because:", + SourceLine(_doc, "cudaVersionMin", str), + [e], + detailed_message=f"the `cudaVersionMin` field with value `{val}` " + "is not valid because:", + ) + ) + extension_fields: MutableMapping[str, Any] = {} + for k in _doc.keys(): + if k not in cls.attrs: + if not k: + _errors__.append( + ValidationException("mapping with implicit null key") + ) + elif ":" in k: + ex = _expand_url( + k, "", loadingOptions, scoped_id=False, vocab_term=False + ) + extension_fields[ex] = _doc[k] + else: + _errors__.append( + ValidationException( + "invalid field `{}`, expected one of: `class`, `cudaComputeCapability`, `cudaDeviceCountMax`, `cudaDeviceCountMin`, `cudaVersionMin`".format( + k + ), + SourceLine(_doc, k, str), + ) + ) + + if _errors__: + raise ValidationException("", None, _errors__, "*") + _constructed = cls( + cudaComputeCapability=cudaComputeCapability, + cudaDeviceCountMax=cudaDeviceCountMax, + cudaDeviceCountMin=cudaDeviceCountMin, + cudaVersionMin=cudaVersionMin, + extension_fields=extension_fields, + loadingOptions=loadingOptions, + ) + return _constructed + + def save( + self, top: bool = False, base_url: str = "", relative_uris: bool = True + ) -> dict[str, Any]: + r: dict[str, Any] = {} + + if relative_uris: + for ef in self.extension_fields: + r[prefix_url(ef, self.loadingOptions.vocab)] = self.extension_fields[ef] + else: + for ef in self.extension_fields: + r[ef] = self.extension_fields[ef] + if self.class_ is not None: + vocab = _vocab | self.loadingOptions.vocab + rvocab = _rvocab | self.loadingOptions.rvocab + uri = vocab[self.class_] + if p := rvocab.get(uri[: -len(self.class_)]): + uri = f"{p}:{self.class_}" + else: + uri = self.class_ + u = save_relative_uri(uri, base_url, False, None, relative_uris) + r["class"] = u + if self.cudaComputeCapability is not None: + r["cudaComputeCapability"] = save( + self.cudaComputeCapability, + top=False, + base_url=base_url, + relative_uris=relative_uris, + ) + if self.cudaDeviceCountMax is not None: + r["cudaDeviceCountMax"] = save( + self.cudaDeviceCountMax, + top=False, + base_url=base_url, + relative_uris=relative_uris, + ) + if self.cudaDeviceCountMin is not None: + r["cudaDeviceCountMin"] = save( + self.cudaDeviceCountMin, + top=False, + base_url=base_url, + relative_uris=relative_uris, + ) + if self.cudaVersionMin is not None: + r["cudaVersionMin"] = save( + self.cudaVersionMin, + top=False, + base_url=base_url, + relative_uris=relative_uris, + ) + + # top refers to the directory level + if top: + if self.loadingOptions.namespaces: + r["$namespaces"] = self.loadingOptions.namespaces + if self.loadingOptions.schemas: + r["$schemas"] = self.loadingOptions.schemas + return r + + attrs: ClassVar[Collection[str]] = frozenset( + [ + "class", + "cudaComputeCapability", + "cudaDeviceCountMax", + "cudaDeviceCountMin", + "cudaVersionMin", + ] + ) + + +class LoopInput(Saveable): + id: str + + def __init__( + self, + default: Any | None = None, + id: Any | None = None, + linkMerge: Any | None = None, + loopSource: Any | None = None, + pickValue: Any | None = None, + valueFrom: Any | 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.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( + self.default == other.default + and self.id == other.id + and self.linkMerge == other.linkMerge + and self.loopSource == other.loopSource + and self.pickValue == other.pickValue + and self.valueFrom == other.valueFrom + ) + return False + + def __hash__(self) -> int: + return hash( + ( + self.default, + self.id, + self.linkMerge, + self.loopSource, + self.pickValue, + self.valueFrom, + ) + ) + + @classmethod + def fromDoc( + cls, + doc: Any, + baseuri: str, + loadingOptions: LoadingOptions, + docRoot: str | None = None + ) -> Self: + _doc = copy.copy(doc) + + if hasattr(doc, "lc"): + _doc.lc.data = doc.lc.data + _doc.lc.filename = doc.lc.filename + _errors__ = [] + id = None + if "id" in _doc: + try: + id = _load_field( + _doc.get("id"), + uri_union_of_None_type_or_strtype_True_False_None_None, + baseuri, + loadingOptions, + lc=_doc.get("id") + ) + + except ValidationException as e: + error_message, to_print, verb_tensage = parse_errors(str(e)) + + if str(e) == "missing required field `id`": + _errors__.append( + ValidationException( + str(e), + None + ) + ) + else: + val = _doc.get("id") + if error_message != str(e): + val_type = convert_typing(extract_type(type(val))) + _errors__.append( + ValidationException( + "the `id` field is not valid because:", + SourceLine(_doc, "id", str), + [ValidationException(f"Value is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}", + detailed_message=f"Value `{val}` is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}")], + ) + ) + else: + _errors__.append( + ValidationException( + "the `id` field is not valid because:", + SourceLine(_doc, "id", str), + [e], + detailed_message=f"the `id` field with value `{val}` " + "is not valid because:", + ) + ) + + __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) + default = None + if "default" in _doc: + try: + default = _load_field( + _doc.get("default"), + union_of_None_type_or_Any_type, + baseuri, + loadingOptions, + lc=_doc.get("default") + ) + + except ValidationException as e: + error_message, to_print, verb_tensage = parse_errors(str(e)) + + if str(e) == "missing required field `default`": + _errors__.append( + ValidationException( + str(e), + None + ) + ) + else: + val = _doc.get("default") + if error_message != str(e): + val_type = convert_typing(extract_type(type(val))) + _errors__.append( + ValidationException( + "the `default` field is not valid because:", + SourceLine(_doc, "default", str), + [ValidationException(f"Value is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}", + detailed_message=f"Value `{val}` is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}")], + ) + ) + else: + _errors__.append( + ValidationException( + "the `default` field is not valid because:", + SourceLine(_doc, "default", str), + [e], + detailed_message=f"the `default` field with value `{val}` " + "is not valid because:", + ) + ) + linkMerge = None + if "linkMerge" in _doc: + try: + linkMerge = _load_field( + _doc.get("linkMerge"), + union_of_None_type_or_LinkMergeMethodLoader, + baseuri, + loadingOptions, + lc=_doc.get("linkMerge") + ) + + except ValidationException as e: + error_message, to_print, verb_tensage = parse_errors(str(e)) + + if str(e) == "missing required field `linkMerge`": + _errors__.append( + ValidationException( + str(e), + None + ) + ) + else: + val = _doc.get("linkMerge") + if error_message != str(e): + val_type = convert_typing(extract_type(type(val))) + _errors__.append( + ValidationException( + "the `linkMerge` field is not valid because:", + SourceLine(_doc, "linkMerge", str), + [ValidationException(f"Value is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}", + detailed_message=f"Value `{val}` is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}")], + ) + ) + else: + _errors__.append( + ValidationException( + "the `linkMerge` field is not valid because:", + SourceLine(_doc, "linkMerge", str), + [e], + detailed_message=f"the `linkMerge` field with value `{val}` " + "is not valid because:", + ) + ) + loopSource = None + if "loopSource" in _doc: + try: + loopSource = _load_field( + _doc.get("loopSource"), + uri_union_of_None_type_or_strtype_or_array_of_strtype_False_False_1_None, + baseuri, + loadingOptions, + lc=_doc.get("loopSource") + ) + + except ValidationException as e: + error_message, to_print, verb_tensage = parse_errors(str(e)) + + if str(e) == "missing required field `loopSource`": + _errors__.append( + ValidationException( + str(e), + None + ) + ) + else: + val = _doc.get("loopSource") + if error_message != str(e): + val_type = convert_typing(extract_type(type(val))) + _errors__.append( + ValidationException( + "the `loopSource` field is not valid because:", + SourceLine(_doc, "loopSource", str), + [ValidationException(f"Value is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}", + detailed_message=f"Value `{val}` is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}")], + ) + ) + else: + _errors__.append( + ValidationException( + "the `loopSource` field is not valid because:", + SourceLine(_doc, "loopSource", str), + [e], + detailed_message=f"the `loopSource` field with value `{val}` " + "is not valid because:", + ) + ) + pickValue = None + if "pickValue" in _doc: + try: + pickValue = _load_field( + _doc.get("pickValue"), + union_of_None_type_or_PickValueMethodLoader, + baseuri, + loadingOptions, + lc=_doc.get("pickValue") + ) + + except ValidationException as e: + error_message, to_print, verb_tensage = parse_errors(str(e)) + + if str(e) == "missing required field `pickValue`": + _errors__.append( + ValidationException( + str(e), + None + ) + ) + else: + val = _doc.get("pickValue") + if error_message != str(e): + val_type = convert_typing(extract_type(type(val))) + _errors__.append( + ValidationException( + "the `pickValue` field is not valid because:", + SourceLine(_doc, "pickValue", str), + [ValidationException(f"Value is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}", + detailed_message=f"Value `{val}` is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}")], + ) + ) + else: + _errors__.append( + ValidationException( + "the `pickValue` field is not valid because:", + SourceLine(_doc, "pickValue", str), + [e], + detailed_message=f"the `pickValue` field with value `{val}` " + "is not valid because:", + ) + ) + valueFrom = None + if "valueFrom" in _doc: + try: + valueFrom = _load_field( + _doc.get("valueFrom"), + union_of_None_type_or_strtype_or_ExpressionLoader, + baseuri, + loadingOptions, + lc=_doc.get("valueFrom") + ) + + except ValidationException as e: + error_message, to_print, verb_tensage = parse_errors(str(e)) + + if str(e) == "missing required field `valueFrom`": + _errors__.append( + ValidationException( + str(e), + None + ) + ) + else: + val = _doc.get("valueFrom") + if error_message != str(e): + val_type = convert_typing(extract_type(type(val))) + _errors__.append( + ValidationException( + "the `valueFrom` field is not valid because:", + SourceLine(_doc, "valueFrom", str), + [ValidationException(f"Value is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}", + detailed_message=f"Value `{val}` is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}")], + ) + ) + else: + _errors__.append( + ValidationException( + "the `valueFrom` field is not valid because:", + SourceLine(_doc, "valueFrom", str), + [e], + detailed_message=f"the `valueFrom` field with value `{val}` " + "is not valid because:", + ) + ) + extension_fields: MutableMapping[str, Any] = {} + for k in _doc.keys(): + if k not in cls.attrs: + if not k: + _errors__.append( + ValidationException("mapping with implicit null key") + ) + elif ":" in k: + ex = _expand_url( + k, "", loadingOptions, scoped_id=False, vocab_term=False + ) + extension_fields[ex] = _doc[k] + else: + _errors__.append( + ValidationException( + "invalid field `{}`, expected one of: `default`, `id`, `linkMerge`, `loopSource`, `pickValue`, `valueFrom`".format( + k + ), + SourceLine(_doc, k, str), + ) + ) + + if _errors__: + raise ValidationException("", None, _errors__, "*") + _constructed = cls( + default=default, + id=id, + linkMerge=linkMerge, + loopSource=loopSource, + pickValue=pickValue, + valueFrom=valueFrom, + extension_fields=extension_fields, + loadingOptions=loadingOptions, + ) + loadingOptions.idx[cast(str, id)] = (_constructed, loadingOptions) + return _constructed + + def save( + self, top: bool = False, base_url: str = "", relative_uris: bool = True + ) -> dict[str, Any]: + r: dict[str, Any] = {} + + if relative_uris: + for ef in self.extension_fields: + r[prefix_url(ef, self.loadingOptions.vocab)] = self.extension_fields[ef] + else: + 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) + r["id"] = u + if self.default is not None: + r["default"] = save( + self.default, top=False, base_url=self.id, relative_uris=relative_uris + ) + if self.linkMerge is not None: + r["linkMerge"] = save( + self.linkMerge, top=False, base_url=self.id, relative_uris=relative_uris + ) + if self.loopSource is not None: + u = save_relative_uri(self.loopSource, self.id, False, 1, relative_uris) + r["loopSource"] = u + if self.pickValue is not None: + r["pickValue"] = save( + self.pickValue, top=False, base_url=self.id, relative_uris=relative_uris + ) + if self.valueFrom is not None: + r["valueFrom"] = save( + self.valueFrom, top=False, base_url=self.id, relative_uris=relative_uris + ) + + # top refers to the directory level + if top: + if self.loadingOptions.namespaces: + r["$namespaces"] = self.loadingOptions.namespaces + if self.loadingOptions.schemas: + r["$schemas"] = self.loadingOptions.schemas + return r + + attrs: ClassVar[Collection[str]] = frozenset( + ["default", "id", "linkMerge", "loopSource", "pickValue", "valueFrom"] + ) + + +class Loop(cwl_utils.parser.cwl_v1_2.ProcessRequirement): + """ + Prototype to enable workflow-level looping of a step. + + Valid only under ``requirements`` of a `https://www.commonwl.org/v1.2/Workflow.html#WorkflowStep `__. Unlike other CWL requirements, Loop requirement is not propagated to inner steps. + + ``loopWhen`` is an expansion of the CWL v1.2 ``when`` construct which controls conditional execution. + + Using ``loopWhen`` and ``when`` for the same step will produce an error. + + ``loopWhen`` is not compatible with ``scatter`` at this time and combining the two in the same step will produce an error. + + """ + + def __init__( + self, + loop: Any, + loopWhen: Any, + outputMethod: Any, + 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] = "Loop" + self.loop = loop + self.loopWhen = loopWhen + self.outputMethod = outputMethod + + def __eq__(self, other: Any) -> bool: + if isinstance(other, Loop): + return bool( + self.class_ == other.class_ + and self.loop == other.loop + and self.loopWhen == other.loopWhen + and self.outputMethod == other.outputMethod + ) + return False + + def __hash__(self) -> int: + return hash((self.class_, self.loop, self.loopWhen, self.outputMethod)) + + @classmethod + def fromDoc( + cls, + doc: Any, + baseuri: str, + loadingOptions: LoadingOptions, + docRoot: str | None = None + ) -> Self: + _doc = copy.copy(doc) + + if hasattr(doc, "lc"): + _doc.lc.data = doc.lc.data + _doc.lc.filename = doc.lc.filename + _errors__ = [] + try: + if _doc.get("class") is None: + raise ValidationException("missing required field `class`", None, []) + + class_ = _load_field( + _doc.get("class"), + uri_strtype_False_True_None_None, + baseuri, + loadingOptions, + lc=_doc.get("class") + ) + + vocab = _vocab | loadingOptions.vocab + if class_ not in (cls.__name__, vocab.get(cls.__name__)): + raise ValidationException(f"tried `{cls.__name__}` but") + except ValidationException as e: + raise e + try: + if _doc.get("loop") is None: + raise ValidationException("missing required field `loop`", None, []) + + loop = _load_field( + _doc.get("loop"), + idmap_loop_array_of_LoopInputLoader, + baseuri, + loadingOptions, + lc=_doc.get("loop") + ) + + except ValidationException as e: + error_message, to_print, verb_tensage = parse_errors(str(e)) + + if str(e) == "missing required field `loop`": + _errors__.append( + ValidationException( + str(e), + None + ) + ) + else: + val = _doc.get("loop") + if error_message != str(e): + val_type = convert_typing(extract_type(type(val))) + _errors__.append( + ValidationException( + "the `loop` field is not valid because:", + SourceLine(_doc, "loop", str), + [ValidationException(f"Value is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}", + detailed_message=f"Value `{val}` is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}")], + ) + ) + else: + _errors__.append( + ValidationException( + "the `loop` field is not valid because:", + SourceLine(_doc, "loop", str), + [e], + detailed_message=f"the `loop` field with value `{val}` " + "is not valid because:", + ) + ) + try: + if _doc.get("loopWhen") is None: + raise ValidationException("missing required field `loopWhen`", None, []) + + loopWhen = _load_field( + _doc.get("loopWhen"), + ExpressionLoader, + baseuri, + loadingOptions, + lc=_doc.get("loopWhen") + ) + + except ValidationException as e: + error_message, to_print, verb_tensage = parse_errors(str(e)) + + if str(e) == "missing required field `loopWhen`": + _errors__.append( + ValidationException( + str(e), + None + ) + ) + else: + val = _doc.get("loopWhen") + if error_message != str(e): + val_type = convert_typing(extract_type(type(val))) + _errors__.append( + ValidationException( + "the `loopWhen` field is not valid because:", + SourceLine(_doc, "loopWhen", str), + [ValidationException(f"Value is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}", + detailed_message=f"Value `{val}` is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}")], + ) + ) + else: + _errors__.append( + ValidationException( + "the `loopWhen` field is not valid because:", + SourceLine(_doc, "loopWhen", str), + [e], + detailed_message=f"the `loopWhen` field with value `{val}` " + "is not valid because:", + ) + ) + try: + if _doc.get("outputMethod") is None: + raise ValidationException("missing required field `outputMethod`", None, []) + + outputMethod = _load_field( + _doc.get("outputMethod"), + LoopOutputModesLoader, + baseuri, + loadingOptions, + lc=_doc.get("outputMethod") + ) + + except ValidationException as e: + error_message, to_print, verb_tensage = parse_errors(str(e)) + + if str(e) == "missing required field `outputMethod`": + _errors__.append( + ValidationException( + str(e), + None + ) + ) + else: + val = _doc.get("outputMethod") + if error_message != str(e): + val_type = convert_typing(extract_type(type(val))) + _errors__.append( + ValidationException( + "the `outputMethod` field is not valid because:", + SourceLine(_doc, "outputMethod", str), + [ValidationException(f"Value is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}", + detailed_message=f"Value `{val}` is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}")], + ) + ) + else: + _errors__.append( + ValidationException( + "the `outputMethod` field is not valid because:", + SourceLine(_doc, "outputMethod", str), + [e], + detailed_message=f"the `outputMethod` field with value `{val}` " + "is not valid because:", + ) + ) + extension_fields: MutableMapping[str, Any] = {} + for k in _doc.keys(): + if k not in cls.attrs: + if not k: + _errors__.append( + ValidationException("mapping with implicit null key") + ) + elif ":" in k: + ex = _expand_url( + k, "", loadingOptions, scoped_id=False, vocab_term=False + ) + extension_fields[ex] = _doc[k] + else: + _errors__.append( + ValidationException( + "invalid field `{}`, expected one of: `class`, `loop`, `loopWhen`, `outputMethod`".format( + k + ), + SourceLine(_doc, k, str), + ) + ) + + if _errors__: + raise ValidationException("", None, _errors__, "*") + _constructed = cls( + loop=loop, + loopWhen=loopWhen, + outputMethod=outputMethod, + extension_fields=extension_fields, + loadingOptions=loadingOptions, + ) + return _constructed + + def save( + self, top: bool = False, base_url: str = "", relative_uris: bool = True + ) -> dict[str, Any]: + r: dict[str, Any] = {} + + if relative_uris: + for ef in self.extension_fields: + r[prefix_url(ef, self.loadingOptions.vocab)] = self.extension_fields[ef] + else: + for ef in self.extension_fields: + r[ef] = self.extension_fields[ef] + if self.class_ is not None: + vocab = _vocab | self.loadingOptions.vocab + rvocab = _rvocab | self.loadingOptions.rvocab + uri = vocab[self.class_] + if p := rvocab.get(uri[: -len(self.class_)]): + uri = f"{p}:{self.class_}" + else: + uri = self.class_ + u = save_relative_uri(uri, base_url, False, None, relative_uris) + r["class"] = u + if self.loop is not None: + r["loop"] = save( + self.loop, top=False, base_url=base_url, relative_uris=relative_uris + ) + if self.loopWhen is not None: + r["loopWhen"] = save( + self.loopWhen, top=False, base_url=base_url, relative_uris=relative_uris + ) + if self.outputMethod is not None: + r["outputMethod"] = save( + self.outputMethod, + top=False, + base_url=base_url, + relative_uris=relative_uris, + ) + + # top refers to the directory level + if top: + if self.loadingOptions.namespaces: + r["$namespaces"] = self.loadingOptions.namespaces + if self.loadingOptions.schemas: + r["$schemas"] = self.loadingOptions.schemas + return r + + attrs: ClassVar[Collection[str]] = frozenset( + ["class", "loop", "loopWhen", "outputMethod"] + ) + + +class ShmSize(cwl_utils.parser.cwl_v1_2.ProcessRequirement): + def __init__( + self, + shmSize: Any, + extension_fields: MutableMapping[str, Any] | None = None, + loadingOptions: LoadingOptions | None = None, + ) -> None: + if extension_fields: + self.extension_fields = extension_fields + else: + self.extension_fields = CommentedMap() + if loadingOptions: + self.loadingOptions = loadingOptions + else: + self.loadingOptions = LoadingOptions() + self.class_: Final[str] = "ShmSize" + self.shmSize = shmSize + + def __eq__(self, other: Any) -> bool: + if isinstance(other, ShmSize): + return bool(self.class_ == other.class_ and self.shmSize == other.shmSize) + return False + + def __hash__(self) -> int: + return hash((self.class_, self.shmSize)) + + @classmethod + def fromDoc( + cls, + doc: Any, + baseuri: str, + loadingOptions: LoadingOptions, + docRoot: str | None = None + ) -> Self: + _doc = copy.copy(doc) + + if hasattr(doc, "lc"): + _doc.lc.data = doc.lc.data + _doc.lc.filename = doc.lc.filename + _errors__ = [] + try: + if _doc.get("class") is None: + raise ValidationException("missing required field `class`", None, []) + + class_ = _load_field( + _doc.get("class"), + uri_strtype_False_True_None_None, + baseuri, + loadingOptions, + lc=_doc.get("class") + ) + + vocab = _vocab | loadingOptions.vocab + if class_ not in (cls.__name__, vocab.get(cls.__name__)): + raise ValidationException(f"tried `{cls.__name__}` but") + except ValidationException as e: + raise e + try: + if _doc.get("shmSize") is None: + raise ValidationException("missing required field `shmSize`", None, []) + + shmSize = _load_field( + _doc.get("shmSize"), + strtype, + baseuri, + loadingOptions, + lc=_doc.get("shmSize") + ) + + except ValidationException as e: + error_message, to_print, verb_tensage = parse_errors(str(e)) + + if str(e) == "missing required field `shmSize`": + _errors__.append( + ValidationException( + str(e), + None + ) + ) + else: + val = _doc.get("shmSize") + if error_message != str(e): + val_type = convert_typing(extract_type(type(val))) + _errors__.append( + ValidationException( + "the `shmSize` field is not valid because:", + SourceLine(_doc, "shmSize", str), + [ValidationException(f"Value is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}", + detailed_message=f"Value `{val}` is a {val_type}, " + f"but valid {to_print} for this field " + f"{verb_tensage} {error_message}")], + ) + ) + else: + _errors__.append( + ValidationException( + "the `shmSize` field is not valid because:", + SourceLine(_doc, "shmSize", str), + [e], + detailed_message=f"the `shmSize` field with value `{val}` " + "is not valid because:", + ) + ) + extension_fields: MutableMapping[str, Any] = {} + for k in _doc.keys(): + if k not in cls.attrs: + if not k: + _errors__.append( + ValidationException("mapping with implicit null key") + ) + elif ":" in k: + ex = _expand_url( + k, "", loadingOptions, scoped_id=False, vocab_term=False + ) + extension_fields[ex] = _doc[k] + else: + _errors__.append( + ValidationException( + "invalid field `{}`, expected one of: `class`, `shmSize`".format( + k + ), + SourceLine(_doc, k, str), + ) + ) + + if _errors__: + raise ValidationException("", None, _errors__, "*") + _constructed = cls( + shmSize=shmSize, + extension_fields=extension_fields, + loadingOptions=loadingOptions, + ) + return _constructed + + def save( + self, top: bool = False, base_url: str = "", relative_uris: bool = True + ) -> dict[str, Any]: + r: dict[str, Any] = {} + + if relative_uris: + for ef in self.extension_fields: + r[prefix_url(ef, self.loadingOptions.vocab)] = self.extension_fields[ef] + else: + for ef in self.extension_fields: + r[ef] = self.extension_fields[ef] + if self.class_ is not None: + vocab = _vocab | self.loadingOptions.vocab + rvocab = _rvocab | self.loadingOptions.rvocab + uri = vocab[self.class_] + if p := rvocab.get(uri[: -len(self.class_)]): + uri = f"{p}:{self.class_}" + else: + uri = self.class_ + u = save_relative_uri(uri, base_url, False, None, relative_uris) + r["class"] = u + if self.shmSize is not None: + r["shmSize"] = save( + self.shmSize, top=False, base_url=base_url, relative_uris=relative_uris + ) + + # top refers to the directory level + if top: + if self.loadingOptions.namespaces: + r["$namespaces"] = self.loadingOptions.namespaces + if self.loadingOptions.schemas: + r["$schemas"] = self.loadingOptions.schemas + return r + + attrs: ClassVar[Collection[str]] = frozenset(["class", "shmSize"]) + + +_vocab.update({ + "Any": "https://w3id.org/cwl/salad#Any", + "ArraySchema": "https://w3id.org/cwl/salad#ArraySchema", + "CUDARequirement": "http://commonwl.org/cwltool#CUDARequirement", + "CWLArraySchema": "https://w3id.org/cwl/cwl#CWLArraySchema", + "CWLInputFile": "https://w3id.org/cwl/cwl#CWLInputFile", + "CWLObjectType": "https://w3id.org/cwl/cwl#CWLObjectType", + "CWLRecordField": "https://w3id.org/cwl/cwl#CWLRecordField", + "CWLRecordSchema": "https://w3id.org/cwl/cwl#CWLRecordSchema", + "CWLType": "https://w3id.org/cwl/cwl#CWLType", + "CWLVersion": "https://w3id.org/cwl/cwl#CWLVersion", + "CommandInputArraySchema": "https://w3id.org/cwl/cwl#CommandInputArraySchema", + "CommandInputEnumSchema": "https://w3id.org/cwl/cwl#CommandInputEnumSchema", + "CommandInputParameter": "https://w3id.org/cwl/cwl#CommandInputParameter", + "CommandInputRecordField": "https://w3id.org/cwl/cwl#CommandInputRecordField", + "CommandInputRecordSchema": "https://w3id.org/cwl/cwl#CommandInputRecordSchema", + "CommandInputSchema": "https://w3id.org/cwl/cwl#CommandInputSchema", + "CommandLineBindable": "https://w3id.org/cwl/cwl#CommandLineBindable", + "CommandLineBinding": "https://w3id.org/cwl/cwl#CommandLineBinding", + "CommandLineTool": "https://w3id.org/cwl/cwl#CommandLineTool", + "CommandOutputArraySchema": "https://w3id.org/cwl/cwl#CommandOutputArraySchema", + "CommandOutputBinding": "https://w3id.org/cwl/cwl#CommandOutputBinding", + "CommandOutputEnumSchema": "https://w3id.org/cwl/cwl#CommandOutputEnumSchema", + "CommandOutputParameter": "https://w3id.org/cwl/cwl#CommandOutputParameter", + "CommandOutputRecordField": "https://w3id.org/cwl/cwl#CommandOutputRecordField", + "CommandOutputRecordSchema": "https://w3id.org/cwl/cwl#CommandOutputRecordSchema", + "Directory": "https://w3id.org/cwl/cwl#Directory", + "Dirent": "https://w3id.org/cwl/cwl#Dirent", + "DockerRequirement": "https://w3id.org/cwl/cwl#DockerRequirement", + "Documented": "https://w3id.org/cwl/salad#Documented", + "EnumSchema": "https://w3id.org/cwl/salad#EnumSchema", + "EnvVarRequirement": "https://w3id.org/cwl/cwl#EnvVarRequirement", + "EnvironmentDef": "https://w3id.org/cwl/cwl#EnvironmentDef", + "Expression": "https://w3id.org/cwl/cwl#Expression", + "ExpressionPlaceholder": "https://w3id.org/cwl/cwl#ExpressionPlaceholder", + "ExpressionTool": "https://w3id.org/cwl/cwl#ExpressionTool", + "ExpressionToolOutputParameter": "https://w3id.org/cwl/cwl#ExpressionToolOutputParameter", + "FieldBase": "https://w3id.org/cwl/cwl#FieldBase", + "File": "https://w3id.org/cwl/cwl#File", + "IOSchema": "https://w3id.org/cwl/cwl#IOSchema", + "Identified": "https://w3id.org/cwl/cwl#Identified", + "IdentifierRequired": "https://w3id.org/cwl/cwl#IdentifierRequired", + "InitialWorkDirRequirement": "https://w3id.org/cwl/cwl#InitialWorkDirRequirement", + "InlineJavascriptRequirement": "https://w3id.org/cwl/cwl#InlineJavascriptRequirement", + "InplaceUpdateRequirement": "https://w3id.org/cwl/cwl#InplaceUpdateRequirement", + "InputArraySchema": "https://w3id.org/cwl/cwl#InputArraySchema", + "InputBinding": "https://w3id.org/cwl/cwl#InputBinding", + "InputEnumSchema": "https://w3id.org/cwl/cwl#InputEnumSchema", + "InputFormat": "https://w3id.org/cwl/cwl#InputFormat", + "InputParameter": "https://w3id.org/cwl/cwl#InputParameter", + "InputRecordField": "https://w3id.org/cwl/cwl#InputRecordField", + "InputRecordSchema": "https://w3id.org/cwl/cwl#InputRecordSchema", + "InputSchema": "https://w3id.org/cwl/cwl#InputSchema", + "Labeled": "https://w3id.org/cwl/cwl#Labeled", + "LinkMergeMethod": "https://w3id.org/cwl/cwl#LinkMergeMethod", + "LoadContents": "https://w3id.org/cwl/cwl#LoadContents", + "LoadListingEnum": "https://w3id.org/cwl/cwl#LoadListingEnum", + "LoadListingRequirement": "https://w3id.org/cwl/cwl#LoadListingRequirement", + "Loop": "http://commonwl.org/cwltool#Loop", + "LoopInput": "http://commonwl.org/cwltool#LoopInput", + "MPIRequirement": "http://commonwl.org/cwltool#MPIRequirement", + "MapSchema": "https://w3id.org/cwl/salad#MapSchema", + "MultipleInputFeatureRequirement": "https://w3id.org/cwl/cwl#MultipleInputFeatureRequirement", + "NetworkAccess": "https://w3id.org/cwl/cwl#NetworkAccess", + "Operation": "https://w3id.org/cwl/cwl#Operation", + "OperationInputParameter": "https://w3id.org/cwl/cwl#OperationInputParameter", + "OperationOutputParameter": "https://w3id.org/cwl/cwl#OperationOutputParameter", + "OutputArraySchema": "https://w3id.org/cwl/cwl#OutputArraySchema", + "OutputEnumSchema": "https://w3id.org/cwl/cwl#OutputEnumSchema", + "OutputFormat": "https://w3id.org/cwl/cwl#OutputFormat", + "OutputParameter": "https://w3id.org/cwl/cwl#OutputParameter", + "OutputRecordField": "https://w3id.org/cwl/cwl#OutputRecordField", + "OutputRecordSchema": "https://w3id.org/cwl/cwl#OutputRecordSchema", + "OutputSchema": "https://w3id.org/cwl/cwl#OutputSchema", + "Parameter": "https://w3id.org/cwl/cwl#Parameter", + "PickValueMethod": "https://w3id.org/cwl/cwl#PickValueMethod", + "PrimitiveType": "https://w3id.org/cwl/salad#PrimitiveType", + "Process": "https://w3id.org/cwl/cwl#Process", + "ProcessGenerator": "http://commonwl.org/cwltool#ProcessGenerator", + "ProcessRequirement": "https://w3id.org/cwl/cwl#ProcessRequirement", + "RecordField": "https://w3id.org/cwl/salad#RecordField", + "RecordSchema": "https://w3id.org/cwl/salad#RecordSchema", + "ResourceRequirement": "https://w3id.org/cwl/cwl#ResourceRequirement", + "ScatterFeatureRequirement": "https://w3id.org/cwl/cwl#ScatterFeatureRequirement", + "ScatterMethod": "https://w3id.org/cwl/cwl#ScatterMethod", + "SchemaDefRequirement": "https://w3id.org/cwl/cwl#SchemaDefRequirement", + "SecondaryFileSchema": "https://w3id.org/cwl/cwl#SecondaryFileSchema", + "Secrets": "http://commonwl.org/cwltool#Secrets", + "ShellCommandRequirement": "https://w3id.org/cwl/cwl#ShellCommandRequirement", + "ShmSize": "http://commonwl.org/cwltool#ShmSize", + "Sink": "https://w3id.org/cwl/cwl#Sink", + "SoftwarePackage": "https://w3id.org/cwl/cwl#SoftwarePackage", + "SoftwareRequirement": "https://w3id.org/cwl/cwl#SoftwareRequirement", + "StepInputExpressionRequirement": "https://w3id.org/cwl/cwl#StepInputExpressionRequirement", + "SubworkflowFeatureRequirement": "https://w3id.org/cwl/cwl#SubworkflowFeatureRequirement", + "ToolTimeLimit": "https://w3id.org/cwl/cwl#ToolTimeLimit", + "UnionSchema": "https://w3id.org/cwl/salad#UnionSchema", + "WorkReuse": "https://w3id.org/cwl/cwl#WorkReuse", + "Workflow": "https://w3id.org/cwl/cwl#Workflow", + "WorkflowInputParameter": "https://w3id.org/cwl/cwl#WorkflowInputParameter", + "WorkflowOutputParameter": "https://w3id.org/cwl/cwl#WorkflowOutputParameter", + "WorkflowStep": "https://w3id.org/cwl/cwl#WorkflowStep", + "WorkflowStepInput": "https://w3id.org/cwl/cwl#WorkflowStepInput", + "WorkflowStepOutput": "https://w3id.org/cwl/cwl#WorkflowStepOutput", + "all": "http://commonwl.org/cwltool#Loop/outputMethod/LoopOutputModes/all", + "all_non_null": "https://w3id.org/cwl/cwl#PickValueMethod/all_non_null", + "array": "https://w3id.org/cwl/salad#array", + "boolean": "http://www.w3.org/2001/XMLSchema#boolean", + "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", + "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", + "float": "http://www.w3.org/2001/XMLSchema#float", + "int": "http://www.w3.org/2001/XMLSchema#int", + "last": "http://commonwl.org/cwltool#Loop/outputMethod/LoopOutputModes/last", + "long": "http://www.w3.org/2001/XMLSchema#long", + "map": "https://w3id.org/cwl/salad#map", + "merge_flattened": "https://w3id.org/cwl/cwl#LinkMergeMethod/merge_flattened", + "merge_nested": "https://w3id.org/cwl/cwl#LinkMergeMethod/merge_nested", + "nested_crossproduct": "https://w3id.org/cwl/cwl#ScatterMethod/nested_crossproduct", + "no_listing": "https://w3id.org/cwl/cwl#LoadListingEnum/no_listing", + "null": "https://w3id.org/cwl/salad#null", + "record": "https://w3id.org/cwl/salad#record", + "shallow_listing": "https://w3id.org/cwl/cwl#LoadListingEnum/shallow_listing", + "stderr": "https://w3id.org/cwl/cwl#stderr", + "stdin": "https://w3id.org/cwl/cwl#stdin", + "stdout": "https://w3id.org/cwl/cwl#stdout", + "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.2": "https://w3id.org/cwl/cwl#v1.2", +}) +_rvocab.update({ + "https://w3id.org/cwl/salad#Any": "Any", + "https://w3id.org/cwl/salad#ArraySchema": "ArraySchema", + "http://commonwl.org/cwltool#CUDARequirement": "CUDARequirement", + "https://w3id.org/cwl/cwl#CWLArraySchema": "CWLArraySchema", + "https://w3id.org/cwl/cwl#CWLInputFile": "CWLInputFile", + "https://w3id.org/cwl/cwl#CWLObjectType": "CWLObjectType", + "https://w3id.org/cwl/cwl#CWLRecordField": "CWLRecordField", + "https://w3id.org/cwl/cwl#CWLRecordSchema": "CWLRecordSchema", + "https://w3id.org/cwl/cwl#CWLType": "CWLType", + "https://w3id.org/cwl/cwl#CWLVersion": "CWLVersion", + "https://w3id.org/cwl/cwl#CommandInputArraySchema": "CommandInputArraySchema", + "https://w3id.org/cwl/cwl#CommandInputEnumSchema": "CommandInputEnumSchema", + "https://w3id.org/cwl/cwl#CommandInputParameter": "CommandInputParameter", + "https://w3id.org/cwl/cwl#CommandInputRecordField": "CommandInputRecordField", + "https://w3id.org/cwl/cwl#CommandInputRecordSchema": "CommandInputRecordSchema", + "https://w3id.org/cwl/cwl#CommandInputSchema": "CommandInputSchema", + "https://w3id.org/cwl/cwl#CommandLineBindable": "CommandLineBindable", + "https://w3id.org/cwl/cwl#CommandLineBinding": "CommandLineBinding", + "https://w3id.org/cwl/cwl#CommandLineTool": "CommandLineTool", + "https://w3id.org/cwl/cwl#CommandOutputArraySchema": "CommandOutputArraySchema", + "https://w3id.org/cwl/cwl#CommandOutputBinding": "CommandOutputBinding", + "https://w3id.org/cwl/cwl#CommandOutputEnumSchema": "CommandOutputEnumSchema", + "https://w3id.org/cwl/cwl#CommandOutputParameter": "CommandOutputParameter", + "https://w3id.org/cwl/cwl#CommandOutputRecordField": "CommandOutputRecordField", + "https://w3id.org/cwl/cwl#CommandOutputRecordSchema": "CommandOutputRecordSchema", + "https://w3id.org/cwl/cwl#Directory": "Directory", + "https://w3id.org/cwl/cwl#Dirent": "Dirent", + "https://w3id.org/cwl/cwl#DockerRequirement": "DockerRequirement", + "https://w3id.org/cwl/salad#Documented": "Documented", + "https://w3id.org/cwl/salad#EnumSchema": "EnumSchema", + "https://w3id.org/cwl/cwl#EnvVarRequirement": "EnvVarRequirement", + "https://w3id.org/cwl/cwl#EnvironmentDef": "EnvironmentDef", + "https://w3id.org/cwl/cwl#Expression": "Expression", + "https://w3id.org/cwl/cwl#ExpressionPlaceholder": "ExpressionPlaceholder", + "https://w3id.org/cwl/cwl#ExpressionTool": "ExpressionTool", + "https://w3id.org/cwl/cwl#ExpressionToolOutputParameter": "ExpressionToolOutputParameter", + "https://w3id.org/cwl/cwl#FieldBase": "FieldBase", + "https://w3id.org/cwl/cwl#File": "File", + "https://w3id.org/cwl/cwl#IOSchema": "IOSchema", + "https://w3id.org/cwl/cwl#Identified": "Identified", + "https://w3id.org/cwl/cwl#IdentifierRequired": "IdentifierRequired", + "https://w3id.org/cwl/cwl#InitialWorkDirRequirement": "InitialWorkDirRequirement", + "https://w3id.org/cwl/cwl#InlineJavascriptRequirement": "InlineJavascriptRequirement", + "https://w3id.org/cwl/cwl#InplaceUpdateRequirement": "InplaceUpdateRequirement", + "https://w3id.org/cwl/cwl#InputArraySchema": "InputArraySchema", + "https://w3id.org/cwl/cwl#InputBinding": "InputBinding", + "https://w3id.org/cwl/cwl#InputEnumSchema": "InputEnumSchema", + "https://w3id.org/cwl/cwl#InputFormat": "InputFormat", + "https://w3id.org/cwl/cwl#InputParameter": "InputParameter", + "https://w3id.org/cwl/cwl#InputRecordField": "InputRecordField", + "https://w3id.org/cwl/cwl#InputRecordSchema": "InputRecordSchema", + "https://w3id.org/cwl/cwl#InputSchema": "InputSchema", + "https://w3id.org/cwl/cwl#Labeled": "Labeled", + "https://w3id.org/cwl/cwl#LinkMergeMethod": "LinkMergeMethod", + "https://w3id.org/cwl/cwl#LoadContents": "LoadContents", + "https://w3id.org/cwl/cwl#LoadListingEnum": "LoadListingEnum", + "https://w3id.org/cwl/cwl#LoadListingRequirement": "LoadListingRequirement", + "http://commonwl.org/cwltool#Loop": "Loop", + "http://commonwl.org/cwltool#LoopInput": "LoopInput", + "http://commonwl.org/cwltool#MPIRequirement": "MPIRequirement", + "https://w3id.org/cwl/salad#MapSchema": "MapSchema", + "https://w3id.org/cwl/cwl#MultipleInputFeatureRequirement": "MultipleInputFeatureRequirement", + "https://w3id.org/cwl/cwl#NetworkAccess": "NetworkAccess", + "https://w3id.org/cwl/cwl#Operation": "Operation", + "https://w3id.org/cwl/cwl#OperationInputParameter": "OperationInputParameter", + "https://w3id.org/cwl/cwl#OperationOutputParameter": "OperationOutputParameter", + "https://w3id.org/cwl/cwl#OutputArraySchema": "OutputArraySchema", + "https://w3id.org/cwl/cwl#OutputEnumSchema": "OutputEnumSchema", + "https://w3id.org/cwl/cwl#OutputFormat": "OutputFormat", + "https://w3id.org/cwl/cwl#OutputParameter": "OutputParameter", + "https://w3id.org/cwl/cwl#OutputRecordField": "OutputRecordField", + "https://w3id.org/cwl/cwl#OutputRecordSchema": "OutputRecordSchema", + "https://w3id.org/cwl/cwl#OutputSchema": "OutputSchema", + "https://w3id.org/cwl/cwl#Parameter": "Parameter", + "https://w3id.org/cwl/cwl#PickValueMethod": "PickValueMethod", + "https://w3id.org/cwl/salad#PrimitiveType": "PrimitiveType", + "https://w3id.org/cwl/cwl#Process": "Process", + "http://commonwl.org/cwltool#ProcessGenerator": "ProcessGenerator", + "https://w3id.org/cwl/cwl#ProcessRequirement": "ProcessRequirement", + "https://w3id.org/cwl/salad#RecordField": "RecordField", + "https://w3id.org/cwl/salad#RecordSchema": "RecordSchema", + "https://w3id.org/cwl/cwl#ResourceRequirement": "ResourceRequirement", + "https://w3id.org/cwl/cwl#ScatterFeatureRequirement": "ScatterFeatureRequirement", + "https://w3id.org/cwl/cwl#ScatterMethod": "ScatterMethod", + "https://w3id.org/cwl/cwl#SchemaDefRequirement": "SchemaDefRequirement", + "https://w3id.org/cwl/cwl#SecondaryFileSchema": "SecondaryFileSchema", + "http://commonwl.org/cwltool#Secrets": "Secrets", + "https://w3id.org/cwl/cwl#ShellCommandRequirement": "ShellCommandRequirement", + "http://commonwl.org/cwltool#ShmSize": "ShmSize", + "https://w3id.org/cwl/cwl#Sink": "Sink", + "https://w3id.org/cwl/cwl#SoftwarePackage": "SoftwarePackage", + "https://w3id.org/cwl/cwl#SoftwareRequirement": "SoftwareRequirement", + "https://w3id.org/cwl/cwl#StepInputExpressionRequirement": "StepInputExpressionRequirement", + "https://w3id.org/cwl/cwl#SubworkflowFeatureRequirement": "SubworkflowFeatureRequirement", + "https://w3id.org/cwl/cwl#ToolTimeLimit": "ToolTimeLimit", + "https://w3id.org/cwl/salad#UnionSchema": "UnionSchema", + "https://w3id.org/cwl/cwl#WorkReuse": "WorkReuse", + "https://w3id.org/cwl/cwl#Workflow": "Workflow", + "https://w3id.org/cwl/cwl#WorkflowInputParameter": "WorkflowInputParameter", + "https://w3id.org/cwl/cwl#WorkflowOutputParameter": "WorkflowOutputParameter", + "https://w3id.org/cwl/cwl#WorkflowStep": "WorkflowStep", + "https://w3id.org/cwl/cwl#WorkflowStepInput": "WorkflowStepInput", + "https://w3id.org/cwl/cwl#WorkflowStepOutput": "WorkflowStepOutput", + "http://commonwl.org/cwltool#Loop/outputMethod/LoopOutputModes/all": "all", + "https://w3id.org/cwl/cwl#PickValueMethod/all_non_null": "all_non_null", + "https://w3id.org/cwl/salad#array": "array", + "http://www.w3.org/2001/XMLSchema#boolean": "boolean", + "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/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", + "http://www.w3.org/2001/XMLSchema#float": "float", + "http://www.w3.org/2001/XMLSchema#int": "int", + "http://commonwl.org/cwltool#Loop/outputMethod/LoopOutputModes/last": "last", + "http://www.w3.org/2001/XMLSchema#long": "long", + "https://w3id.org/cwl/salad#map": "map", + "https://w3id.org/cwl/cwl#LinkMergeMethod/merge_flattened": "merge_flattened", + "https://w3id.org/cwl/cwl#LinkMergeMethod/merge_nested": "merge_nested", + "https://w3id.org/cwl/cwl#ScatterMethod/nested_crossproduct": "nested_crossproduct", + "https://w3id.org/cwl/cwl#LoadListingEnum/no_listing": "no_listing", + "https://w3id.org/cwl/salad#null": "null", + "https://w3id.org/cwl/salad#record": "record", + "https://w3id.org/cwl/cwl#LoadListingEnum/shallow_listing": "shallow_listing", + "https://w3id.org/cwl/cwl#stderr": "stderr", + "https://w3id.org/cwl/cwl#stdin": "stdin", + "https://w3id.org/cwl/cwl#stdout": "stdout", + "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.2": "v1.2", +}) + +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", + "int", + "long", + "float", + "double", + "string", + ), + "PrimitiveType", +) +""" +Names of salad data types (based on Avro schema declarations). + +Refer to the `Avro schema declaration documentation `__ for detailed information. + +null: no value + +boolean: a binary value + +int: 32-bit signed integer + +long: 64-bit signed integer + +float: single precision (32-bit) IEEE 754 floating-point number + +double: double precision (64-bit) IEEE 754 floating-point number + +string: Unicode character sequence +""" +AnyLoader: Final = _EnumLoader(("Any",), "Any") +""" +The **Any** type validates for any non-null value. +""" +RecordFieldLoader: Final = _RecordLoader( + schema_salad.metaschema.RecordField, None, None +) +RecordSchemaLoader: Final = _RecordLoader( + schema_salad.metaschema.RecordSchema, None, None +) +EnumSchemaLoader: Final = _RecordLoader(schema_salad.metaschema.EnumSchema, None, None) +ArraySchemaLoader: Final = _RecordLoader( + schema_salad.metaschema.ArraySchema, None, None +) +MapSchemaLoader: Final = _RecordLoader(schema_salad.metaschema.MapSchema, None, None) +UnionSchemaLoader: Final = _RecordLoader( + schema_salad.metaschema.UnionSchema, None, None +) +CWLTypeLoader: Final = _EnumLoader( + ( + "null", + "boolean", + "int", + "long", + "float", + "double", + "string", + "File", + "Directory", + ), + "CWLType", +) +""" +Extends primitive types with the concept of a file and directory as a builtin type. + +File: A File object + +Directory: A Directory object +""" +CWLArraySchemaLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.CWLArraySchema, None, None +) +CWLRecordFieldLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.CWLRecordField, None, None +) +CWLRecordSchemaLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.CWLRecordSchema, None, None +) +FileLoader: Final = _RecordLoader(cwl_utils.parser.cwl_v1_2.File, None, None) +DirectoryLoader: Final = _RecordLoader(cwl_utils.parser.cwl_v1_2.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: Final = _ArrayLoader( + union_of_None_type_or_CWLObjectTypeLoader +) +map_of_union_of_None_type_or_CWLObjectTypeLoader: Final = _MapLoader( + union_of_None_type_or_CWLObjectTypeLoader, "None", None, None +) +InlineJavascriptRequirementLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.InlineJavascriptRequirement, None, None +) +SchemaDefRequirementLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.SchemaDefRequirement, None, None +) +LoadListingRequirementLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.LoadListingRequirement, None, None +) +DockerRequirementLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.DockerRequirement, None, None +) +SoftwareRequirementLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.SoftwareRequirement, None, None +) +InitialWorkDirRequirementLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.InitialWorkDirRequirement, None, None +) +EnvVarRequirementLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.EnvVarRequirement, None, None +) +ShellCommandRequirementLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.ShellCommandRequirement, None, None +) +ResourceRequirementLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.ResourceRequirement, None, None +) +WorkReuseLoader: Final = _RecordLoader(cwl_utils.parser.cwl_v1_2.WorkReuse, None, None) +NetworkAccessLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.NetworkAccess, None, None +) +InplaceUpdateRequirementLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.InplaceUpdateRequirement, None, None +) +ToolTimeLimitLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.ToolTimeLimit, None, None +) +SubworkflowFeatureRequirementLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.SubworkflowFeatureRequirement, None, None +) +ScatterFeatureRequirementLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.ScatterFeatureRequirement, None, None +) +MultipleInputFeatureRequirementLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.MultipleInputFeatureRequirement, None, None +) +StepInputExpressionRequirementLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.StepInputExpressionRequirement, 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( + ( + InlineJavascriptRequirementLoader, + SchemaDefRequirementLoader, + LoadListingRequirementLoader, + DockerRequirementLoader, + SoftwareRequirementLoader, + InitialWorkDirRequirementLoader, + EnvVarRequirementLoader, + ShellCommandRequirementLoader, + ResourceRequirementLoader, + WorkReuseLoader, + NetworkAccessLoader, + InplaceUpdateRequirementLoader, + ToolTimeLimitLoader, + SubworkflowFeatureRequirementLoader, + ScatterFeatureRequirementLoader, + MultipleInputFeatureRequirementLoader, + StepInputExpressionRequirementLoader, + SecretsLoader, + MPIRequirementLoader, + CUDARequirementLoader, + LoopLoader, + 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( + 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( + ( + 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( + 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") +""" +Current version symbol for CWL documents. +""" +LoadListingEnumLoader: Final = _EnumLoader( + ( + "no_listing", + "shallow_listing", + "deep_listing", + ), + "LoadListingEnum", +) +""" +Specify the desired behavior for loading the ``listing`` field of a Directory object for use by expressions. + +no_listing: Do not load the directory listing. + +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( + cwl_utils.parser.cwl_v1_2.InputBinding, None, None +) +InputRecordFieldLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.InputRecordField, None, None +) +InputRecordSchemaLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.InputRecordSchema, None, None +) +InputEnumSchemaLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.InputEnumSchema, None, None +) +InputArraySchemaLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.InputArraySchema, None, None +) +OutputRecordFieldLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.OutputRecordField, None, None +) +OutputRecordSchemaLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.OutputRecordSchema, None, None +) +OutputEnumSchemaLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.OutputEnumSchema, None, None +) +OutputArraySchemaLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.OutputArraySchema, None, None +) +SecondaryFileSchemaLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.SecondaryFileSchema, None, None +) +EnvironmentDefLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.EnvironmentDef, None, None +) +CommandLineBindingLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.CommandLineBinding, None, None +) +CommandOutputBindingLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.CommandOutputBinding, None, None +) +CommandInputRecordFieldLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.CommandInputRecordField, None, None +) +CommandInputRecordSchemaLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.CommandInputRecordSchema, None, None +) +CommandInputEnumSchemaLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.CommandInputEnumSchema, None, None +) +CommandInputArraySchemaLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.CommandInputArraySchema, None, None +) +CommandOutputRecordFieldLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.CommandOutputRecordField, None, None +) +CommandOutputRecordSchemaLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.CommandOutputRecordSchema, None, None +) +CommandOutputEnumSchemaLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.CommandOutputEnumSchema, None, None +) +CommandOutputArraySchemaLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.CommandOutputArraySchema, None, None +) +CommandInputParameterLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.CommandInputParameter, None, None +) +CommandOutputParameterLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.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`` level. + +The following + +:: + + inputs: + an_input_name: + type: stdin + + +is equivalent to + +:: + + inputs: + an_input_name: + type: File + streamable: true + + stdin: $(inputs.an_input_name.path) +""" +stdoutLoader: Final = _EnumLoader(("stdout",), "stdout") +""" +Only valid as a ``type`` for a ``CommandLineTool`` output with no ``outputBinding`` set. + +The following + +:: + + outputs: + an_output_name: + type: stdout + + stdout: a_stdout_file + + +is equivalent to + +:: + + outputs: + an_output_name: + type: File + streamable: true + outputBinding: + glob: a_stdout_file + + stdout: a_stdout_file + + +If there is no ``stdout`` name provided, a random filename will be created. For example, the following + +:: + + outputs: + an_output_name: + type: stdout + + +is equivalent to + +:: + + outputs: + an_output_name: + type: File + streamable: true + outputBinding: + glob: random_stdout_filenameABCDEFG + + stdout: random_stdout_filenameABCDEFG + + +If the ``CommandLineTool`` contains logically chained commands (e.g. ``echo a && echo b``) ``stdout`` must include the output of every command. +""" +stderrLoader: Final = _EnumLoader(("stderr",), "stderr") +""" +Only valid as a ``type`` for a ``CommandLineTool`` output with no ``outputBinding`` set. + +The following + +:: + + outputs: + an_output_name: + type: stderr + + stderr: a_stderr_file + + +is equivalent to + +:: + + outputs: + an_output_name: + type: File + streamable: true + outputBinding: + glob: a_stderr_file + + stderr: a_stderr_file + + +If there is no ``stderr`` name provided, a random filename will be created. For example, the following + +:: + + outputs: + an_output_name: + type: stderr + + +is equivalent to + +:: + + outputs: + an_output_name: + type: File + streamable: true + outputBinding: + glob: random_stderr_filenameABCDEFG + + stderr: random_stderr_filenameABCDEFG +""" +CommandLineToolLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.CommandLineTool, None, None +) +SoftwarePackageLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.SoftwarePackage, None, None +) +DirentLoader: Final = _RecordLoader(cwl_utils.parser.cwl_v1_2.Dirent, None, None) +ExpressionToolOutputParameterLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.ExpressionToolOutputParameter, None, None +) +WorkflowInputParameterLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.WorkflowInputParameter, None, None +) +ExpressionToolLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.ExpressionTool, None, None +) +LinkMergeMethodLoader: Final = _EnumLoader( + ( + "merge_nested", + "merge_flattened", + ), + "LinkMergeMethod", +) +""" +The input link merge method, described in `WorkflowStepInput <#WorkflowStepInput>`__. +""" +PickValueMethodLoader: Final = _EnumLoader( + ( + "first_non_null", + "the_only_non_null", + "all_non_null", + ), + "PickValueMethod", +) +""" +Picking non-null values among inbound data links, described in `WorkflowStepInput <#WorkflowStepInput>`__. +""" +WorkflowOutputParameterLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.WorkflowOutputParameter, None, None +) +WorkflowStepInputLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.WorkflowStepInput, None, None +) +WorkflowStepOutputLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.WorkflowStepOutput, None, None +) +ScatterMethodLoader: Final = _EnumLoader( + ( + "dotproduct", + "nested_crossproduct", + "flat_crossproduct", + ), + "ScatterMethod", +) +""" +The scatter method, as described in `workflow step scatter <#WorkflowStep>`__. +""" +WorkflowStepLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.WorkflowStep, None, None +) +WorkflowLoader: Final = _RecordLoader(cwl_utils.parser.cwl_v1_2.Workflow, None, None) +OperationInputParameterLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.OperationInputParameter, None, None +) +OperationOutputParameterLoader: Final = _RecordLoader( + cwl_utils.parser.cwl_v1_2.OperationOutputParameter, None, None +) +OperationLoader: Final = _RecordLoader(cwl_utils.parser.cwl_v1_2.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: 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, + EnumSchemaLoader, + ArraySchemaLoader, + MapSchemaLoader, + UnionSchemaLoader, + strtype, + ) +) +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: ( + Final +) = _UnionLoader( + ( + PrimitiveTypeLoader, + RecordSchemaLoader, + EnumSchemaLoader, + ArraySchemaLoader, + MapSchemaLoader, + UnionSchemaLoader, + strtype, + 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( + 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( + ( + 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" +) +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: Final = _URILoader( + union_of_None_type_or_strtype, True, False, None, None +) +uri_array_of_strtype_True_False_None_None: Final = _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( + 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( + ( + PrimitiveTypeLoader, + CWLRecordSchemaLoader, + EnumSchemaLoader, + CWLArraySchemaLoader, + strtype, + ) +) +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: ( + Final +) = _UnionLoader( + ( + PrimitiveTypeLoader, + CWLRecordSchemaLoader, + EnumSchemaLoader, + CWLArraySchemaLoader, + strtype, + 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( + 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( + 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( + ( + 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( + 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 +) +union_of_None_type_or_inttype: Final = _UnionLoader( + ( + None_type, + inttype, + ) +) +union_of_FileLoader_or_DirectoryLoader: Final = _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, + ) + ) +) +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 + ), + 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 +) +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: Final = _UnionLoader( + ( + None_type, + booltype, + ) +) +union_of_None_type_or_LoadListingEnumLoader: Final = _UnionLoader( + ( + None_type, + LoadListingEnumLoader, + ) +) +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: ( + Final +) = _UnionLoader( + ( + _SecondaryDSLLoader( + union_of_None_type_or_SecondaryFileSchemaLoader_or_array_of_SecondaryFileSchemaLoader + ), + 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, + ) + ) +) +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: Final = _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 + ) +) +union_of_CWLTypeLoader_or_InputRecordSchemaLoader_or_InputEnumSchemaLoader_or_InputArraySchemaLoader_or_strtype: ( + Final +) = _UnionLoader( + ( + CWLTypeLoader, + InputRecordSchemaLoader, + InputEnumSchemaLoader, + InputArraySchemaLoader, + strtype, + ) +) +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: ( + Final +) = _UnionLoader( + ( + CWLTypeLoader, + InputRecordSchemaLoader, + InputEnumSchemaLoader, + InputArraySchemaLoader, + strtype, + 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( + 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( + ( + 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( + 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( + ( + CWLTypeLoader, + OutputRecordSchemaLoader, + OutputEnumSchemaLoader, + OutputArraySchemaLoader, + strtype, + ) +) +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: ( + Final +) = _UnionLoader( + ( + CWLTypeLoader, + OutputRecordSchemaLoader, + OutputEnumSchemaLoader, + OutputArraySchemaLoader, + strtype, + 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( + 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( + ( + 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( + 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( + ( + CommandInputParameterLoader, + WorkflowInputParameterLoader, + OperationInputParameterLoader, + ) +) +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: ( + Final +) = _IdMapLoader( + array_of_union_of_CommandInputParameterLoader_or_WorkflowInputParameterLoader_or_OperationInputParameterLoader, + "id", + "type", +) +union_of_CommandOutputParameterLoader_or_ExpressionToolOutputParameterLoader_or_WorkflowOutputParameterLoader_or_OperationOutputParameterLoader: ( + Final +) = _UnionLoader( + ( + CommandOutputParameterLoader, + ExpressionToolOutputParameterLoader, + WorkflowOutputParameterLoader, + OperationOutputParameterLoader, + ) +) +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: ( + 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: ( + 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: ( + 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: ( + Final +) = _UnionLoader( + ( + InlineJavascriptRequirementLoader, + SchemaDefRequirementLoader, + LoadListingRequirementLoader, + DockerRequirementLoader, + SoftwareRequirementLoader, + InitialWorkDirRequirementLoader, + EnvVarRequirementLoader, + ShellCommandRequirementLoader, + ResourceRequirementLoader, + WorkReuseLoader, + NetworkAccessLoader, + InplaceUpdateRequirementLoader, + ToolTimeLimitLoader, + SubworkflowFeatureRequirementLoader, + ScatterFeatureRequirementLoader, + MultipleInputFeatureRequirementLoader, + StepInputExpressionRequirementLoader, + SecretsLoader, + MPIRequirementLoader, + CUDARequirementLoader, + LoopLoader, + ShmSizeLoader, + 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( + 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( + ( + 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( + 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, + ) +) +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_array_of_strtype_True_False_None_None: Final = _URILoader( + union_of_None_type_or_array_of_strtype, True, False, None, None +) +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( + ( + CommandInputRecordSchemaLoader, + CommandInputEnumSchemaLoader, + CommandInputArraySchemaLoader, + ) +) +array_of_union_of_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader: ( + Final +) = _ArrayLoader( + union_of_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader +) +union_of_strtype_or_ExpressionLoader: Final = _UnionLoader( + ( + strtype, + ExpressionLoader, + ) +) +union_of_None_type_or_booltype_or_ExpressionLoader: Final = _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 = ( + _UnionLoader( + ( + None_type, + strtype, + ExpressionLoader, + array_of_strtype, + ) + ) +) +union_of_None_type_or_ExpressionLoader: Final = _UnionLoader( + ( + None_type, + ExpressionLoader, + ) +) +union_of_None_type_or_CommandLineBindingLoader: Final = _UnionLoader( + ( + None_type, + CommandLineBindingLoader, + ) +) +union_of_CWLTypeLoader_or_CommandInputRecordSchemaLoader_or_CommandInputEnumSchemaLoader_or_CommandInputArraySchemaLoader_or_strtype: ( + Final +) = _UnionLoader( + ( + CWLTypeLoader, + CommandInputRecordSchemaLoader, + CommandInputEnumSchemaLoader, + CommandInputArraySchemaLoader, + strtype, + ) +) +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: ( + Final +) = _UnionLoader( + ( + CWLTypeLoader, + CommandInputRecordSchemaLoader, + CommandInputEnumSchemaLoader, + CommandInputArraySchemaLoader, + strtype, + 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( + 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( + ( + 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" + ) +) +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: ( + Final +) = _UnionLoader( + ( + CWLTypeLoader, + CommandOutputRecordSchemaLoader, + CommandOutputEnumSchemaLoader, + CommandOutputArraySchemaLoader, + strtype, + ) +) +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: ( + Final +) = _UnionLoader( + ( + CWLTypeLoader, + CommandOutputRecordSchemaLoader, + CommandOutputEnumSchemaLoader, + CommandOutputArraySchemaLoader, + strtype, + 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( + 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( + ( + None_type, + CommandOutputBindingLoader, + ) +) +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: 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: ( + 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: ( + Final +) = _UnionLoader( + ( + CWLTypeLoader, + stdinLoader, + CommandInputRecordSchemaLoader, + CommandInputEnumSchemaLoader, + CommandInputArraySchemaLoader, + strtype, + 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( + 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( + ( + CWLTypeLoader, + stdoutLoader, + stderrLoader, + CommandOutputRecordSchemaLoader, + CommandOutputEnumSchemaLoader, + CommandOutputArraySchemaLoader, + strtype, + 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( + 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",), "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( + ( + 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( + ( + 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, + ) +) +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 +) +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_DirentLoader_or_ExpressionLoader_or_FileLoader_or_DirectoryLoader_or_array_of_union_of_FileLoader_or_DirectoryLoader: ( + Final +) = _UnionLoader( + ( + None_type, + DirentLoader, + ExpressionLoader, + FileLoader, + DirectoryLoader, + 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( + 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( + ( + 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 +) +array_of_EnvironmentDefLoader: Final = _ArrayLoader(EnvironmentDefLoader) +idmap_envDef_array_of_EnvironmentDefLoader: Final = _IdMapLoader( + array_of_EnvironmentDefLoader, "envName", "envValue" +) +ShellCommandRequirement_classLoader: Final = _EnumLoader( + ("ShellCommandRequirement",), "ShellCommandRequirement_class" +) +uri_ShellCommandRequirement_classLoader_False_True_None_None: Final = _URILoader( + ShellCommandRequirement_classLoader, False, True, None, None +) +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_floattype_or_ExpressionLoader: Final = _UnionLoader( + ( + None_type, + 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 +) +union_of_booltype_or_ExpressionLoader: Final = _UnionLoader( + ( + booltype, + ExpressionLoader, + ) +) +NetworkAccess_classLoader: Final = _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( + ("ToolTimeLimit",), "ToolTimeLimit_class" +) +uri_ToolTimeLimit_classLoader_False_True_None_None: Final = _URILoader( + ToolTimeLimit_classLoader, False, True, None, None +) +union_of_inttype_or_ExpressionLoader: Final = _UnionLoader( + ( + inttype, + ExpressionLoader, + ) +) +union_of_None_type_or_InputBindingLoader: Final = _UnionLoader( + ( + None_type, + InputBindingLoader, + ) +) +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: 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( + ( + None_type, + LinkMergeMethodLoader, + ) +) +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: 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" +) +union_of_strtype_or_WorkflowStepOutputLoader: Final = _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( + 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, + ) +) +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( + ( + strtype, + CommandLineToolLoader, + ExpressionToolLoader, + WorkflowLoader, + OperationLoader, + ProcessGeneratorLoader, + ) +) +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: Final = ( + _URILoader(union_of_None_type_or_strtype_or_array_of_strtype, False, False, 0, None) +) +union_of_None_type_or_ScatterMethodLoader: Final = _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 +) +array_of_WorkflowOutputParameterLoader: Final = _ArrayLoader( + WorkflowOutputParameterLoader +) +idmap_outputs_array_of_WorkflowOutputParameterLoader: Final = _IdMapLoader( + array_of_WorkflowOutputParameterLoader, "id", "type" +) +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( + ("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( + ("MultipleInputFeatureRequirement",), "MultipleInputFeatureRequirement_class" +) +uri_MultipleInputFeatureRequirement_classLoader_False_True_None_None: Final = ( + _URILoader(MultipleInputFeatureRequirement_classLoader, False, True, None, None) +) +StepInputExpressionRequirement_classLoader: Final = _EnumLoader( + ("StepInputExpressionRequirement",), "StepInputExpressionRequirement_class" +) +uri_StepInputExpressionRequirement_classLoader_False_True_None_None: Final = _URILoader( + StepInputExpressionRequirement_classLoader, False, True, None, None +) +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: Final = _ArrayLoader( + OperationInputParameterLoader +) +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( + array_of_strtype, False, False, 0, None +) +union_of_strtype_or_array_of_strtype: Final = _UnionLoader( + ( + strtype, + array_of_strtype, + ) +) +union_of_None_type_or_Any_type: Final = _UnionLoader( + ( + None_type, + Any_type, + ) +) +array_of_LoopInputLoader: Final = _ArrayLoader(LoopInputLoader) +idmap_loop_array_of_LoopInputLoader: Final = _IdMapLoader( + array_of_LoopInputLoader, "id", "loopSource" +) +LoopOutputModesLoader: Final = _EnumLoader( + ( + "last", + "all", + ), + "LoopOutputModes", +) +union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader_or_ProcessGeneratorLoader: ( + Final +) = _UnionLoader( + ( + CommandLineToolLoader, + ExpressionToolLoader, + WorkflowLoader, + OperationLoader, + ProcessGeneratorLoader, + ) +) +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: ( + Final +) = _UnionLoader( + ( + CommandLineToolLoader, + ExpressionToolLoader, + WorkflowLoader, + OperationLoader, + ProcessGeneratorLoader, + array_of_union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader_or_ProcessGeneratorLoader, + ) +) + +CWLObjectTypeLoader.add_loaders( + ( + booltype, + inttype, + floattype, + strtype, + FileLoader, + DirectoryLoader, + array_of_union_of_None_type_or_CWLObjectTypeLoader, + map_of_union_of_None_type_or_CWLObjectTypeLoader, + ) +) + + +def load_document( + doc: Any, + baseuri: str | None = None, + loadingOptions: LoadingOptions | None = None, +) -> Any: + if baseuri is None: + baseuri = file_uri(os.getcwd()) + "/" + if loadingOptions is None: + loadingOptions = LoadingOptions() + result, metadata = _document_load( + 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, + doc, + baseuri, + loadingOptions, + ) + return result + + +def load_document_with_metadata( + doc: Any, + 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()) + "/" + if loadingOptions is None: + loadingOptions = LoadingOptions(fileuri=baseuri) + return _document_load( + 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, + doc, + baseuri, + loadingOptions, + addl_metadata_fields=addl_metadata_fields, + ) + + +def load_document_by_string( + string: Any, + uri: str, + loadingOptions: LoadingOptions | None = None, +) -> Any: + yaml = yaml_no_ts() + result = yaml.load(string) + add_lc_filename(result, uri) + + if loadingOptions is None: + loadingOptions = LoadingOptions(fileuri=uri) + + result, metadata = _document_load( + 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, + result, + uri, + loadingOptions, + ) + return result + + +def load_document_by_yaml( + yaml: Any, + uri: str, + loadingOptions: LoadingOptions | None = None, +) -> Any: + """ + Shortcut to load via a YAML object. + yaml: must be from ruamel.yaml.main.YAML.load with preserve_quotes=True + """ + add_lc_filename(yaml, uri) + + if loadingOptions is None: + loadingOptions = LoadingOptions(fileuri=uri) + + result, metadata = _document_load( + 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, + yaml, + uri, + loadingOptions, + ) + return result diff --git a/cwltool/load_tool.py b/cwltool/load_tool.py index cd5612cb3..ae53d5560 100644 --- a/cwltool/load_tool.py +++ b/cwltool/load_tool.py @@ -18,6 +18,7 @@ from schema_salad.exceptions import ValidationException from schema_salad.fetcher import Fetcher from schema_salad.ref_resolver import Loader, file_uri +from schema_salad.runtime import LoadingOptions, save from schema_salad.schema import validate_doc from schema_salad.sourceline import SourceLine, cmap from schema_salad.utils import ( @@ -31,6 +32,7 @@ from . import CWL_CONTENT_TYPES, process, update from .context import LoadingContext from .errors import GraphTargetMissingException +from .fast_parser import load_document_with_metadata from .loghandler import _logger from .process import Process, get_schema, shortname from .update import ALLUPDATES @@ -264,9 +266,7 @@ def _fast_parser_convert_stdstreams_to_files( _fast_parser_convert_stdstreams_to_files(p) -def _fast_parser_expand_hint_class( - hints: Any | None, loadingOptions: cwl_v1_2.LoadingOptions -) -> None: +def _fast_parser_expand_hint_class(hints: Any | None, loadingOptions: LoadingOptions) -> None: if isinstance(hints, MutableSequence): for h in hints: if isinstance(h, MutableMapping) and "class" in h: @@ -277,7 +277,7 @@ def _fast_parser_expand_hint_class( def _fast_parser_handle_hints( processobj: cwl_v1_2.Process | MutableSequence[cwl_v1_2.Process], - loadingOptions: cwl_v1_2.LoadingOptions, + loadingOptions: LoadingOptions, ) -> None: if isinstance(processobj, (cwl_v1_2.CommandLineTool, cwl_v1_2.Workflow)): _fast_parser_expand_hint_class(processobj.hints, loadingOptions) @@ -304,10 +304,10 @@ def fast_parser( loadingContext: LoadingContext, fetcher: Fetcher, ) -> tuple[CommentedMap | CommentedSeq, CommentedMap]: - lopt = cwl_v1_2.LoadingOptions(idx=loadingContext.codegen_idx, fileuri=fileuri, fetcher=fetcher) + lopt = LoadingOptions(idx=loadingContext.codegen_idx, fileuri=fileuri, fetcher=fetcher) if uri not in loadingContext.codegen_idx: - cwl_v1_2.load_document_with_metadata( + load_document_with_metadata( workflowobj, fileuri, loadingOptions=lopt, @@ -321,7 +321,7 @@ def fast_parser( processobj: MutableMapping[str, Any] | MutableSequence[Any] | i32 | i64 | float | str | None - processobj = cwl_v1_2.save(objects, relative_uris=False) + processobj = save(objects, relative_uris=False) metadata: dict[str, Any] = {} metadata["id"] = loadopt.fileuri @@ -351,7 +351,7 @@ def fast_parser( fileobj = cmap( cast( Union[int, float, str, dict[str, Any], list[Any], None], - cwl_v1_2.save(objects, relative_uris=False), + save(objects, relative_uris=False), ) ) visit_class( diff --git a/mypy-requirements.txt b/mypy-requirements.txt index a84672027..6701ec2d4 100644 --- a/mypy-requirements.txt +++ b/mypy-requirements.txt @@ -1,6 +1,6 @@ mypy==2.1.0 # also update pyproject.toml ruamel.yaml>=0.16.0,<0.20 -cwl-utils>=0.41 +cwl-utils @ git+https://github.com/common-workflow-language/cwl-utils.git@refs/pull/413/head cwltest types-requests types-setuptools diff --git a/pyproject.toml b/pyproject.toml index d3971ded8..398088243 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,8 +6,8 @@ requires = [ "types-requests", "types-psutil>=7.1.3.20251210", "ruamel.yaml>=0.16.0,<0.20", - "schema-salad>=8.9,<9", - "cwl-utils>=0.41", + "schema-salad @ git+https://github.com/common-workflow-language/schema_salad.git@refs/pull/1028/head", + "cwl-utils @ git+https://github.com/common-workflow-language/cwl-utils.git@refs/pull/413/head", "toml", "argcomplete>=1.12.0", "rich-argparse", diff --git a/requirements.txt b/requirements.txt index bee685d2c..1509ac95d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ requests>=2.32.2 ruamel.yaml>=0.16.0,<0.20 rdflib>=4.2.2,<7.7 -schema-salad>=8.9,<9 +schema-salad @ git+https://github.com/common-workflow-language/schema_salad.git@refs/pull/1028/head prov==1.5.1 mypy-extensions psutil>=5.6.6 @@ -9,7 +9,7 @@ coloredlogs pydot>=1.4.1 argcomplete>=1.12.0 pyparsing!=3.0.2 # breaks --print-dot (pydot) https://github.com/pyparsing/pyparsing/issues/319 -cwl-utils>=0.41 +cwl-utils @ git+https://github.com/common-workflow-language/cwl-utils.git@refs/pull/413/head spython>=0.3.0 rich-argparse pygments>=2.20.0 # fix for CVE-2026-4539 diff --git a/setup.py b/setup.py index a74d9ea4f..a1f0d4398 100644 --- a/setup.py +++ b/setup.py @@ -152,7 +152,7 @@ def _find_package_data(base: str, globs: list[str], root: str = "cwltool") -> li # https://github.com/ionrock/cachecontrol/issues/137 "ruamel.yaml >= 0.16, < 0.20", "rdflib >= 4.2.2, < 7.7.0", - "schema-salad >= 8.9, < 9", + "schema-salad @ git+https://github.com/common-workflow-language/schema_salad.git@refs/pull/1028/head", "prov == 1.5.1", "mypy-extensions", "psutil >= 5.6.6", @@ -160,7 +160,7 @@ def _find_package_data(base: str, globs: list[str], root: str = "cwltool") -> li "pydot >= 1.4.1", "argcomplete >= 1.12.0", "pyparsing != 3.0.2", # breaks --print-dot (pydot) https://github.com/pyparsing/pyparsing/issues/319 - "cwl-utils >= 0.41", + "cwl-utils @ git+https://github.com/common-workflow-language/cwl-utils.git@refs/pull/413/head", "spython >= 0.3.0", "rich-argparse", "pygments>=2.20.0", # fix for CVE-2026-4539