viash-io / viash

script + metadata = standalone component
https://viash.io
GNU General Public License v3.0
39 stars 2 forks source link

[BUG] To require, or not to require #729

Open rcannood opened 3 months ago

rcannood commented 3 months ago

What happened?

There is a discrepancy between the behaviour of an executable vs. a nextflow module. More specifically, when a Viash component has an argument that is required but also already has a default value. When running the component without providing a value for the argument, should the component produce an error?

Steps to reproduce

Contents of config.vsh.yaml:

name: test
arguments:
  - type: string
    name: --string
    default: foo
    required: true
resources:
  - type: python_script
    text: print(par)
runners:
  - type: executable
  - type: nextflow
viash ns build --parallel

Executables return an error:

target/executable/test/test
[error] --string is a required argument. Use --help to get more information on the parameters.

Nextflow modules do not:

nextflow run target/nextflow/test/main.nf
N E X T F L O W  ~  version 23.10.0
Launching `target/nextflow/test/main.nf` [maniac_davinci] DSL2 - revision: 48a6cf6211
executor >  local (2)
[c0/62cf8e] process > test:processWf:test_process (run)                  [100%] 1 of 1 ✔
[e6/7bdcea] process > test:publishStatesSimpleWf:publishStatesProc (run) [100%] 1 of 1 ✔

Expected behavior

That is to be decided. I think I would be favour of the current Nextflow module behaviour, and changing the behaviour of the executable.

Relevant log output

No response

Version

Viash v0.9.0-RC4

Possible solution

No response

Confirmation

Additional context

No response