common-workflow-language / common-workflow-language/cwltool

cwltool does not recognize the array property 'length' in ECMAScript expressions

未关闭
#235 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
376
派生
255
平均合并
2 天 7 小时
30 天内合并 PR
12

描述

When not using the full javascript engine, cwltool doesn't recognize length as a special field in `$(input.files.length)` but it should.

I'm interested in requesting a maximum number of cores to be equal to the number of files in an input of type `File[]`. However, when I set `maxCores: $(input.files.length)`, I get the error `ERROR: Execution failed: list indices must be integers, not str`.

CWL and yml inputs are provided in the zip attached: [fastqc.zip](https://github.com/common-workflow-language/cwltool/files/605465/fastqc.zip)

Full traceback is below:
```
$ cwltool fastqc.cwl fastqc_local_inputs.yml
/usr/bin/cwltool 1.0.20161107145355
Got workflow error
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/cwltool/main.py", line 220, in single_job_executor
for r in jobiter:
File "/usr/lib/python2.7/dist-packages/cwltool/draft2tool.py", line 243, in job
builder = self._init_job(joborder, **kwargs)
File "/usr/lib/python2.7/dist-packages/cwltool/process.py", line 508, in _init_job
builder.resources = self.evalResources(builder, kwargs)
File "/usr/lib/python2.7/dist-packages/cwltool/process.py", line 533, in evalResources
mx = builder.do_eval(resourceReq[a+"Max"])
File "/usr/lib/python2.7/dist-packages/cwltool/builder.py", line 206, in do_eval
timeout=self.timeout)
File "/usr/lib/python2.7/dist-packages/cwltool/expression.py", line 185, in do_eval
jslib=jslib)
File "/usr/lib/python2.7/dist-packages/cwltool/expression.py", line 143, in interpolate
timeout=timeout)
File "/usr/lib/python2.7/dist-packages/cwltool/expression.py", line 126, in evaluator
return next_seg(m.group(0)[m.end(1) - m.start(0):-1], obj[m.group(1)])
File "/usr/lib/python2.7/dist-packages/cwltool/expression.py", line 112, in next_seg
return next_seg(remain[m.end(0):], obj[m.group(0)[1:]])
File "/usr/lib/python2.7/dist-packages/cwltool/expression.py", line 112, in next_seg
return next_seg(remain[m.end(0):], obj[m.group(0)[1:]])
TypeError: list indices must be integers, not str
Workflow error, try again with --debug for more information:
list indices must be integers, not st
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。