Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python CodeGen: Loading and saving tool leads to validation fail #552

Open
ZimmerA opened this issue Jun 21, 2022 · 0 comments
Open

Python CodeGen: Loading and saving tool leads to validation fail #552

ZimmerA opened this issue Jun 21, 2022 · 0 comments

Comments

@ZimmerA
Copy link
Contributor

ZimmerA commented Jun 21, 2022

After generating Python utilities for https://github.com/common-workflow-language/cwl-v1.2/tree/1.2.1_proposed I tried loading and subsequently saving one of the test files (/tests/count-lines14-wf.cwl) using the following code:

f = open("/home/adrian/Dokumente/Coding/CWL/cwl-v1.2/tests/count-lines14-wf.cwl", "r")
doc = load_document_by_string(f.read(), "file:///home/adrian/Dokumente/Coding/CWL/cwl-v1.2/tests/count-lines14-wf.cwl")

out = doc.save(True, "file:///home/adrian/Dokumente/Coding/CWL/cwl-v1.2/tests/count-lines14-wf.cwl", True)
with open(f"./count-lines14-wf.cwl", "w") as file:
    yaml = yaml_no_ts()
    yaml.dump(out, file)

The result was the following document:

class: Workflow
id: file:///home/adrian/Dokumente/Coding/CWL/cwl-v1.2/tests/count-lines14-wf.cwl
inputs:
- id: file1
  type: File
- id: file2
  type: File
outputs:
- id: count_output
  outputSource: step1/count_output
  type:
    name: _:a5070f24-d2c6-46de-90ed-7286845ecf62
    items: int
    type: array
requirements:
- class: MultipleInputFeatureRequirement
- class: ScatterFeatureRequirement
- class: SubworkflowFeatureRequirement
cwlVersion: v1.2
steps:
- id: step1
  in:
  - id: file1
    source:
    - file1
    - file2
  out:
  - count_output
  run:
    class: Workflow
    id: _:8dcc1f57-11bd-4b83-93be-48b3f43fa358
    inputs:
    - id: file:///home/adrian/Dokumente/Coding/CWL/cwl-v1.2/tests/count-lines14-wf.cwl#step1/file1
      type: File
    outputs:
    - id: file:///home/adrian/Dokumente/Coding/CWL/cwl-v1.2/tests/count-lines14-wf.cwl#step1/count_output
      outputSource: step2/output
      type: int
    steps:
    - id: file:///home/adrian/Dokumente/Coding/CWL/cwl-v1.2/tests/count-lines14-wf.cwl#step1/step1
      in:
      - id: file1
        source: step1/file1
      out:
      - output
      run: wc-tool.cwl
    - id: file:///home/adrian/Dokumente/Coding/CWL/cwl-v1.2/tests/count-lines14-wf.cwl#step1/step2
      in:
      - id: file1
        source: step1/step1/output
      out:
      - output
      run: parseInt-tool.cwl
  scatter: file1

Trying to validate this with cwltool version 3.1.20220607081835 leads to the following error:

ERROR Tool definition failed initialization:
Tool definition ordereddict([('class', 'Workflow'), ('id', '_:8dcc1f57-11bd-4b83-93be-48b3f43fa358'), ('inputs', [ordereddict([('id', 'file:///home/adrian/Dokumente/Coding/CWL/cwl-v1.2/tests/count-lines14-wf.cwl#step1/file1'), ('type', 'File')])]), ('outputs', [ordereddict([('id', 'file:///home/adrian/Dokumente/Coding/CWL/cwl-v1.2/tests/count-lines14-wf.cwl#step1/count_output'), ('outputSource', 'file:///home/adrian/Dokumente/Coding/CWL/cwl-v1.2/tests/count-lines14-wf.cwl#step1/step2/output'), ('type', 'int')])]), ('steps', [ordereddict([('id', 'file:///home/adrian/Dokumente/Coding/CWL/cwl-v1.2/tests/count-lines14-wf.cwl#step1/step1'), ('in', [ordereddict([('id', 'file:///home/adrian/Dokumente/Coding/CWL/cwl-v1.2/tests/count-lines14-wf.cwl#step1/step1/file1'), ('source', 'file:///home/adrian/Dokumente/Coding/CWL/cwl-v1.2/tests/count-lines14-wf.cwl#step1/step1/file1')])]), ('out', ['file:///home/adrian/Dokumente/Coding/CWL/cwl-v1.2/tests/count-lines14-wf.cwl#step1/step1/output']), ('run', 'file:///home/adrian/Dokumente/Coding/CWL/cwl-v1.2/tests/wc-tool.cwl')]), ordereddict([('id', 'file:///home/adrian/Dokumente/Coding/CWL/cwl-v1.2/tests/count-lines14-wf.cwl#step1/step2'), ('in', [ordereddict([('id', 'file:///home/adrian/Dokumente/Coding/CWL/cwl-v1.2/tests/count-lines14-wf.cwl#step1/step2/file1'), ('source', 'file:///home/adrian/Dokumente/Coding/CWL/cwl-v1.2/tests/count-lines14-wf.cwl#step1/step1/output')])]), ('out', ['file:///home/adrian/Dokumente/Coding/CWL/cwl-v1.2/tests/count-lines14-wf.cwl#step1/step2/output']), ('run', 'file:///home/adrian/Dokumente/Coding/CWL/cwl-v1.2/tests/parseInt-tool.cwl')])])]) failed validation:
../../Dokumente/Coding/CWL/cwl-v1.2/tests/count-lines14-wf.cwl:42:9:   source not found:
                                                                       file:///home/adrian/Dokumente/Coding/CWL/cwl-v1.2/tests/count-lines14-wf.cwl#step1/step1/file1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant