common-workflow-language / common-workflow-language/cwl-utils
'save' function truncate input source name if it contains step name
- 主要言語
- Python
- スター
- 43
- フォーク
- 28
- 平均マージ
- 4時間 7分
- マージ済み PR(30日)
- 4
説明
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?
コントリビューションガイド
評価
この issue はまだ評価されていません。