pallassgj / bpipe

Automatically exported from code.google.com/p/bpipe
0 stars 1 forks source link

Returning an Object from a Pipeline Stage Should not be Treated as an Output #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This behavior produces surprising results and forces confusing work arounds.

For example, this pipeline stage:

  hello = {
    exec "cp $input $output"
    x = "foo"
  }

Produces an error:

  Pipeline failed!

  Expected output file ./foo could not be found

This happens because the expression 'x = "foo"' evaluates to a String object, 
which, being the last expression in the pipeline stage is treated by Groovy as 
a return value.  Bpipe then sees it and considers it an output.

The "return value as output" is in fact a relic from when Bpipe had no 
"produce", "transform" or "filter" constructs and is now really needed only by 
internal parts of Bpipe.  Removing it will make Bpipe clearer.

Note: there will still be occasions when the user needs to specify that a 
different output from the default one assumed by Bpipe should be forwarded to 
the next stage.  This should be a separate construct, called "forward".

Original issue reported on code.google.com by ssade...@gmail.com on 6 May 2012 at 2:52

GoogleCodeExporter commented 9 years ago
should be released in 0.9.4

Original comment by ssade...@gmail.com on 6 May 2012 at 4:27