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

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

Ouverte
#235 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
376
Forks
255
Merge moyen
2 j 7 h
PR mergées (30 j)
12

Description

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
```

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.