PMCC-BioinformaticsCore / janis-core

Core python modules for Janis Pipeline workflow assistant
GNU General Public License v3.0
4 stars 9 forks source link

CWL generation: invalid result with output_type=File(), selector=Stdout() → "outputEval: _stderr" #95

Open mr-c opened 3 years ago

mr-c commented 3 years ago
outputs:
- id: result
  label: result
  type: File
  outputBinding:
    glob: _stdout
    outputEval: _stderr
    loadContents: false

The outputEval: _stderr is nonsensical here

From

hello_janis.py


from typing import List, Optional, Dict, Any

from janis_core import * from janis_core.types.common_data_types import File

Optionalexample_Dev = CommandToolBuilder( tool="OptionalExample", base_command=["echo", "Hello, World!"], inputs=[], outputs=[ ToolOutput( tag="result", output_type=File(), selector=Stdout(subtype=File(), optional=False), doc=OutputDocumentation(doc=None), ) ], container="ubuntu:latest", version="DEV", )

if name == "main": Optionalexample_Dev().translate("cwl")

mr-c commented 3 years ago

FYI, that example above is a variation on the output of fromwdl using the following.

version 1.0                                                                     

task OptionalExample {                                                          
    input {                                                                     
    }                                                                           

    command {                                                                   
       echo Hello, world!                                                       
    }                                                                           

    output {                                                                    
        File result = stdout()                                                  
    }                                                                           

    runtime {                                                                   
        memory: 1                                                               
    }                                                                           

}

So maybe fromwdl should be updated to use generate ToolOutput(tag="result",output_type=Stdout) instead