1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
.. include:: ../global.inc
.. _decorators.merge:
.. index::
pair: @merge; Syntax
.. seealso::
* :ref:`@merge <new_manual.merge>` in the **Ruffus** Manual
* :ref:`Decorators <decorators>` for more decorators
.. |input| replace:: `input`
.. _input: `decorators.merge.input`_
.. |extras| replace:: `extras`
.. _extras: `decorators.merge.extras`_
.. |output| replace:: `output`
.. _output: `decorators.merge.output`_
########################################################################
@merge ( |input|_, |output|_, [|extras|_,...] )
########################################################################
**Purpose:**
Merges multiple |input|_ into a single |output|_.
Only out of date tasks (comparing |input|_ and |output|_ files) will be run
**Example**::
@merge(previous_task, 'all.summary')
def summarize(infiles, summary_file):
pass
**Parameters:**
.. _decorators.merge.input:
* **input** = *tasks_or_file_names*
can be a:
#. Task / list of tasks.
File names are taken from the output of the specified task(s)
#. (Nested) list of file name strings.
File names containing ``*[]?`` will be expanded as a |glob|_.
E.g.:``"a.*" => "a.1", "a.2"``
.. _decorators.merge.output:
* **output** = *output*
Specifies the resulting output file name(s).
.. _decorators.merge.extras:
* **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.
See :ref:`here <decorators.collate>` for more advanced uses of merging.
|