InitialWorkDirRequirement error with array of Directories
1
0
Entering edit mode
5.9 years ago
ionox0 ▴ 390

I believe this should be supported as per the v1.0 spec

cwlVersion: v1.0
class: CommandLineTool
baseCommand: [touch]
arguments:
- ${return './' + inputs.directories[0].basename + '/' + inputs.to_touch}

requirements:
- class: InlineJavascriptRequirement
- class: InitialWorkDirRequirement
  listing:
  - entry: $(inputs.files)
  - entry: $(inputs.directories)

inputs:
  to_touch: string
  directories:
    type: Directory[]
  files:
    type: File[]

outputs:
  output:
    type: string
    outputBinding:
      outputEval: 'asdf'

But I am receiving this error from cwltool:

(test13)  johnsoni@lski2427  ~/Desktop/initial_wd_dir_test  cwltool --debug test.cwl inputs.yaml
/Users/johnsoni/Desktop/virtualenvs/test13/bin/cwltool 1.0.20180306140409
Resolved 'test.cwl' to 'file:///Users/johnsoni/Desktop/initial_wd_dir_test/test.cwl'
[job test.cwl] initializing from file:///Users/johnsoni/Desktop/initial_wd_dir_test/test.cwl
[job test.cwl] {
    "to_touch": "a_new_one",
    "directories": [
        {
            "class": "Directory",
            "location": "file:///Users/johnsoni/Desktop/initial_wd_dir_test/test_dir",
            "basename": "test_dir"
        },
        {
            "class": "Directory",
            "location": "file:///Users/johnsoni/Desktop/initial_wd_dir_test/test_dir_2",
            "basename": "test_dir_2"
        }
    ],
    "files": [
        {
            "class": "File",
            "location": "file:///Users/johnsoni/Desktop/initial_wd_dir_test/file1",
            "size": 0,
            "basename": "file1",
            "nameroot": "file1",
            "nameext": ""
        },
        {
            "class": "File",
            "location": "file:///Users/johnsoni/Desktop/initial_wd_dir_test/file2",
            "size": 0,
            "basename": "file2",
            "nameroot": "file2",
            "nameext": ""
        }
    ]
}
Got workflow error
Traceback (most recent call last):
  File "/Users/johnsoni/Desktop/virtualenvs/test13/lib/python2.7/site-packages/cwltool-1.0.20180306140409-py2.7.egg/cwltool/executors.py", line 98, in run_jobs
    for r in jobiter:
  File "/Users/johnsoni/Desktop/virtualenvs/test13/lib/python2.7/site-packages/cwltool-1.0.20180306140409-py2.7.egg/cwltool/command_line_tool.py", line 417, in job
    self.updatePathmap(builder.outdir, builder.pathmapper, l)
  File "/Users/johnsoni/Desktop/virtualenvs/test13/lib/python2.7/site-packages/cwltool-1.0.20180306140409-py2.7.egg/cwltool/command_line_tool.py", line 241, in updatePathmap
    for sf in fn.get("secondaryFiles", []):
AttributeError: 'CommentedSeq' object has no attribute 'get'
Workflow error, try again with --debug for more information:
'CommentedSeq' object has no attribute 'get'
Traceback (most recent call last):
  File "/Users/johnsoni/Desktop/virtualenvs/test13/lib/python2.7/site-packages/cwltool-1.0.20180306140409-py2.7.egg/cwltool/main.py", line 588, in main
    **vars(args))
  File "/Users/johnsoni/Desktop/virtualenvs/test13/lib/python2.7/site-packages/cwltool-1.0.20180306140409-py2.7.egg/cwltool/executors.py", line 29, in __call__
    return self.execute(*args, **kwargs)
  File "/Users/johnsoni/Desktop/virtualenvs/test13/lib/python2.7/site-packages/cwltool-1.0.20180306140409-py2.7.egg/cwltool/executors.py", line 69, in execute
    self.run_jobs(t, job_order_object, logger, **kwargs)
  File "/Users/johnsoni/Desktop/virtualenvs/test13/lib/python2.7/site-packages/cwltool-1.0.20180306140409-py2.7.egg/cwltool/executors.py", line 113, in run_jobs
    raise WorkflowException(Text(e))
WorkflowException: 'CommentedSeq' object has no attribute 'get'
cwl • 1.4k views
ADD COMMENT
3
Entering edit mode
5.9 years ago
ionox0 ▴ 390

Answered my own question. It is the listing field that must evaluate to a list, so lists are not supported in the entry fields

requirements:
- class: InlineJavascriptRequirement
- class: InitialWorkDirRequirement
  listing: $(inputs.directories)
ADD COMMENT

Login before adding your answer.

Traffic: 2620 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6