Closed ghost closed 9 years ago
Thanks. This will be available in the next point release of ruffus 2.6.3 (?)
In the meantime, support is available in the git repository.
There is test code in test_suffix_output_dir.py
.
For both
@tranform(suffix(...), output_dir = "something"
) and
@subdivide(suffix(...), output_dir = "something")
,
the onus is on the Ruffus programmer not to do something senseless, like have a suffix()
which includes a path / the parent directory:
@transform(input = prev_task, filter = suffix("parent_dir/a.txt"), output = "parent_dir/b.txt", output_dir = "working_dir")
def stupid_code(inputs, outputs):
pass
There is no reasonable way of interpreting such code. Don't do it.
The
output_dir
named parameter for@transform
in combination withsuffix(...)
is a tremendously helpful simplification that allows for an explicit separation of directory structure(s) from file naming. Extending that to, e.g., subdivide might clarify the pipeline code for these cases.