See also

@originate ( output, [extras,...] )ΒΆ

Purpose:
  • Creates (originates) a set of starting file without dependencies from scratch (ex nihilo!)
  • Only called to create files which do not exist.
  • Invoked onces (a job created) per item in the output list.

Note

The first argument for the task function is the output. There is by definition no input for @originate

Example:

from ruffus import *
@originate(["a", "b", "c", "d"], "extra")
def test(output_file, extra):
    open(output_file, "w")

pipeline_run()
>>> pipeline_run()
    Job  = [None -> a, extra] completed
    Job  = [None -> b, extra] completed
    Job  = [None -> c, extra] completed
    Job  = [None -> d, extra] completed
Completed Task = test

>>> # all files exist: nothing to do
>>> pipeline_run()

>>> # delete 'a' so that it is missing
>>> import os
>>> os.unlink("a")

>>> pipeline_run()
    Job  = [None -> a, extra] completed
Completed Task = test

Parameters:

  • output = output
    • Can be a single file name or a list of files
    • Each item in the list is treated as the output of a separate job
  • extras = extras

    Any extra parameters are passed verbatim to the task function

    If you are using named parameters, these can be passed as a list, i.e. extras= [...]

    Any extra parameters are consumed by the task function and not forwarded further down the pipeline.