Ruffus Decorators¶
See also
Core¶
| Decorator | Examples | |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
Combinatorics¶
| Decorator | Examples | |
|---|---|---|
|
||
@permutations (Summary / Manual)
|
|
|
@combinations (Summary / Manual)
|
|
|
@combinations_with_replacement (Summary / Manual)
|
|
Advanced¶
Decorator Examples @subdivide (Summary / Manual) - Subdivides a set of Inputs each further into multiple Outputs. - The number of files in each Output can be set at runtime by the use of globs. - Many to Even More operator. - The use of split is a synonym for subdivide is deprecated.
- @subdivide (
tasks_or_file_names, regex(regex_pattern), [ inputs | add_inputs(input_pattern), ]output_pattern, [extra_parameters,...] )
- @subdivide (
tasks_or_file_names, formatter([regex_pattern] ), [ inputs | add_inputs(input_pattern), ]output_pattern, [extra_parameters,...] )
- Infers input as well as output from regular expression substitutions
- Useful for adding additional file dependencies
- @transform (
tasks_or_file_names, regex(regex_pattern), [ inputs | add_inputs(input_pattern), ]output_pattern, [extra_parameters,...] )
- @transform (
tasks_or_file_names, formatter(regex_pattern), [ inputs | add_inputs(input_pattern), ]output_pattern, [extra_parameters,...] )
- Groups multiple input files using regular expression matching
- Input resulting in the same output after substitution will be collated together.
- @collate (
tasks_or_file_names, regex(regex_pattern), inputs | add_inputs(input_pattern),output_pattern, [extra_parameters,...] )
- @collate (
tasks_or_file_names, formatter(formatter_pattern), inputs | add_inputs(input_pattern),output_pattern, [extra_parameters,...] )
- Indicates task dependency
- optional mkdir prerequisite (see Manual)
- Calls function after task completes
- Optional touch_file indicator (Manual)
- @posttask (
signal_task_completion_function)
- @posttask (touch_file(
'task1.completed'))
- Switches tasks on and off at run time depending on its parameters
- Evaluated each time pipeline_run(...), pipeline_printout(...) or pipeline_printout_graph(...) is called.
- Dormant tasks behave as if they are up to date and have no output.
- @active_if (
on_or_off1, [on_or_off2, ...])@jobs_limit (Summary / Manual)
- Limits the amount of multiprocessing for the specified task
- Ensures that fewer than N jobs for this task are run in parallel
- Overrides
multiprocessparameter in pipeline_run(...)
- @jobs_limit (
NUMBER_OF_JOBS_RUNNING_CONCURRENTLY)
- Generates paths for os.makedirs
- Customise the graphic for each task in printed flowcharts
- @graphviz (
graphviz_parameter = XXX,[graphviz_parameter2 = YYY ...])
Esoteric!¶
Decorator Examples
- I/O parameters
- skips up-to-date jobs
- Should use @transform etc instead
- By default, does not check if jobs are up to date
- Best used in conjuction with @check_if_uptodate
- @parallel (
parameter_list) (see Manual)
- @parallel (
parameter_generating_function) (see Manual)@check_if_uptodate (Summary / Manual)
- Custom function to determine if jobs need to be run
- @check_if_uptodate (
is_task_up_to_date_function)
- @files_re (
tasks_or_file_names,matching_regex, [input_pattern,]output_pattern,...)
input_pattern/output_patternare regex patterns used to create input/output file names from the starting list of either glob_str or file names