We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5e5615b commit 51c5fb7Copy full SHA for 51c5fb7
cwltool/load_tool.py
@@ -43,14 +43,23 @@
43
from .update import ALLUPDATES
44
from .utils import CWLObjectType, ResolverType, visit_class
45
46
-jobloaderctx: ContextType = {
+docloaderctx: ContextType = {
47
"cwl": "https://w3id.org/cwl/cwl#",
48
"cwltool": "http://commonwl.org/cwltool#",
49
"path": {"@type": "@id"},
50
"location": {"@type": "@id"},
51
"id": "@id",
52
}
53
54
+jobloader_id_name = "__id"
55
+jobloaderctx: ContextType = {
56
+ "cwl": "https://w3id.org/cwl/cwl#",
57
+ "cwltool": "http://commonwl.org/cwltool#",
58
+ "path": {"@type": "@id"},
59
+ "location": {"@type": "@id"},
60
+ jobloader_id_name: "@id",
61
+}
62
+
63
64
overrides_ctx: ContextType = {
65
"overrideTarget": {"@type": "@id"},
@@ -72,7 +81,7 @@ def default_loader(
72
81
doc_cache: bool = True,
73
82
) -> Loader:
74
83
return Loader(
75
- jobloaderctx,
84
+ docloaderctx,
76
85
fetcher_constructor=fetcher_constructor,
77
86
allow_attachments=lambda r: enable_dev,
78
87
doc_cache=doc_cache,
cwltool/main.py
@@ -70,6 +70,7 @@
70
from .load_tool import (
71
default_loader,
fetch_document,
+ jobloader_id_name,
jobloaderctx,
load_overrides,
make_tool,
@@ -446,7 +447,7 @@ def init_job_order(
446
447
_logger.exception("Failed to resolv job_order: %s", cmd_line["job_order"])
448
exit(1)
449
else:
- job_order_object = {"id": args.workflow}
450
+ job_order_object = {jobloader_id_name: args.workflow}
451
452
del cmd_line["job_order"]
453
@@ -506,7 +507,7 @@ def expand_formats(p: CWLObjectType) -> None:
506
507
process.inputs_record_schema, job_order_object, discover_secondaryFiles=True
508
)
509
basedir: Optional[str] = None
- uri = cast(str, job_order_object["id"])
510
+ uri = cast(str, job_order_object[jobloader_id_name])
511
if uri == args.workflow:
512
basedir = os.path.dirname(uri)
513
uri = ""
@@ -529,8 +530,8 @@ def expand_formats(p: CWLObjectType) -> None:
529
530
531
if "cwl:tool" in job_order_object:
532
del job_order_object["cwl:tool"]
- if "id" in job_order_object:
533
- del job_order_object["id"]
+ if jobloader_id_name in job_order_object:
534
+ del job_order_object[jobloader_id_name]
535
return job_order_object
536
537
tests/test_examples.py
@@ -1859,3 +1859,16 @@ def test_invalid_nested_array() -> None:
1859
assert (
1860
"tests/nested-array.cwl:6:5: Field 'type' references unknown identifier 'string[][]'"
1861
) in stderr
1862
1863
1864
+def test_input_named_id() -> None:
1865
+ """Confirm that it is valid to have an input named "id"."""
1866
+ exit_code, stdout, stderr = get_main_output(
1867
+ [
1868
+ "--validate",
1869
+ "--debug",
1870
+ get_data("tests/wf/input_named_id.cwl"),
1871
+ get_data("tests/wf/input_named_id.yaml"),
1872
+ ]
1873
+ )
1874
+ assert exit_code == 0, stderr
tests/wf/input_named_id.cwl
@@ -0,0 +1,13 @@
1
+label: FeatureFinderIdentification
2
+doc: ""
3
+inputs:
4
+ id:
5
+ doc: featureXML or consensusXML file
6
+ type: File
7
+outputs:
8
+ []
9
+cwlVersion: v1.2
10
+class: CommandLineTool
11
+baseCommand:
12
+ - FeatureFinderIdentification
13
tests/wf/input_named_id.yaml
@@ -0,0 +1,3 @@
+id:
+ class: File
+ path: ../2.fastq
0 commit comments