common-workflow-language / common-workflow-language/schema_salad

Roundtrip (load/save) failures

Open
#187 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
86
Forks
64
Avg merge
19h 24m
Merged PRs (30d)
19

Description

Attempting to roundtrip the following workflow:

[topmed-alignment.cwl.txt](https://github.com/common-workflow-language/schema_salad/files/2182314/topmed-alignment.cwl.txt)

Fails validation

Roundtrip code
```
import cwlpy.cwlmodels as cwlmodels
import ruamel.yaml as yaml
import sys

W1 = cwlmodels.load_document('topmed-alignment.cwl')
yaml.dump(cwlmodels.save(W1), sys.stdout, Dumper=yaml.RoundTripDumper)
```

```
$ python roundtrip.py > test.cwl
$ cwltool --validate test.cwl
/Users/kghose/miniconda2/envs/kaggle/bin/cwltool 1.0.20180709065250
Resolved 'test.cwl' to 'file:///Users/kghose/Code/cwlpy/examples/003.sbg.topmed/test.cwl'
test.cwl:205:3: checking item
test.cwl:205:3: Field `class` contains undefined reference to `https://sevenbridges.comAWSInstanceType`
Tool definition failed validation:
test.cwl:191:1: checking field `outputs`
test.cwl:192:3: checking object `topmed-alignment.cwl#output`
test.cwl:197:3: Field `outputSource` references unknown identifier `file:///Users/kghose/Code/cwlpy/examples/003.sbg.topmed/topmed-alignment.cwl#output/topmed_post_align/output`, tried file:///Users/kghose/Code/cwlpy/examples/003.sbg.topmed/topmed-alignment.cwl#output/file:///Users/kghose/Code/cwlpy/examples/003.sbg.topmed/topmed-alignment.cwl#output/topmed_post_align/output, file:///Users/kghose/Code/cwlpy/examples/003.sbg.topmed/topmed-alignment.cwl#file:///Users/kghose/Code/cwlpy/examples/003.sbg.topmed/topmed-alignment.cwl#output/topmed_post_align/output
```

Generated CWL is:
[test.cwl.txt](https://github.com/common-workflow-language/schema_salad/files/2182320/test.cwl.txt)

```
schema-salad-tool --codegen python CommonWorkflowLanguage.yml > ../cwlpy/cwlmodels.py
Current version: 2.7.20180701171628
```

```
cwltool --version
1.0.20180709065250
```

```
ruamel.yaml 0.13.13
```

@tetron

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.