common-workflow-language / common-workflow-language/cwl-utils

'save' function truncate input source name if it contains step name

Ouverte
#402 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
43
Forks
28
Merge moyen
4 h 7 min
PR mergées (30 j)
4

Description

I remarked that if a Workflow input source name contains exactly the step name, then if I apply the [save](https://github.com/common-workflow-language/cwl-utils/blob/main/cwl_utils/parser/__init__.py#L410) function on this workflow, the input source is truncated.

Here is an example:
```
cwlVersion: v1.2
class: Workflow
label: "Main Workflow"
doc: >
Test.

inputs:
first_input:
type: string
default: "step_1.log"
second_step_input:
type: string
default: "step_2.log"

outputs:
log:
type: File[]
outputSource:
- second_step/log

steps:
first_step:
run: first_step.cwl
in:
input_1: first_input
out: [log]

second_step:
run: second_step.cwl
in:
input_2: second_step_input
out: [log]
```

Then if you load and save the workflow:
```
from cwl_utils.parser import save, load_document
from cwl_utils.pack import pack

from pathlib import Path

cwl_path = Path("test_workflow.cwl")
cwl_obj = load_document(pack(str(cwl_path)))

saved_cwl = save(cwl_obj)
print(saved_cwl)
```

It gives you:
```
[...] {'id': 'second_step', 'in': [{'id': 'input_2', 'source': '_input'}] [...]
```

The input source is no more `second_step_input` but `_input`.

Do you have any idea if this behavior is expected?

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.