bbp_workflow.luigi

Various tools augmenting luigi.

Classes

CompleteTask(*args, **kwargs)

Complete task.

Decoder(*[, object_pairs_hook, ...])

OptionalQuantityParameter([default, ...])

Optional parameter whose value is a quantity.

QuantityDictParameter(*args[, schema])

Parameter whose value is a quantity.

QuantityParameter([default, is_global, ...])

Parameter whose value is a quantity.

RemoteContext(*args, **kwargs)

No host key check context.

RemoteTarget(*args, **kwargs)

No host key check target.

Requirement(task_class[, inherit_params])

Requirement specification.

Requires()

Composition to replace luigi.task.Task.requires().

RunAnywayTarget(task_obj)

Does the same as the base class and ignores permission exception on file cleanup.

extends(*tasks_to_extend)

Special task inheritance with parameter look-up from parent classes config file sections.

inherits(*tasks_to_inherit)

Task inheritance.

class bbp_workflow.luigi.CompleteTask(*args, **kwargs)

Bases: Task

Complete task.

class bbp_workflow.luigi.Decoder(*, object_pairs_hook=None, parse_constant=None, strict=True)

Bases: JSONDecoder

.

class bbp_workflow.luigi.OptionalQuantityParameter(default=<object object>, is_global=False, significant=True, description=None, config_path=None, positional=True, always_in_help=False, batch_method=None, visibility=ParameterVisibility.PUBLIC)

Bases: QuantityParameter

Optional parameter whose value is a quantity.

normalize(x)

Normalize the given value if it is not None.

parse(x)

Parse the given value if it is a string (empty strings are parsed to None).

serialize(x)

Serialize the given value if the value is not None else return an empty string.

class bbp_workflow.luigi.QuantityDictParameter(*args, schema=None, **kwargs)

Bases: DictParameter

Parameter whose value is a quantity.

parse(source)

Parse.

serialize(x)

Opposite of parse().

Converts the value x to a string.

Parameters:

x – the value to serialize.

class bbp_workflow.luigi.QuantityParameter(default=<object object>, is_global=False, significant=True, description=None, config_path=None, positional=True, always_in_help=False, batch_method=None, visibility=ParameterVisibility.PUBLIC)

Bases: Parameter

Parameter whose value is a quantity.

parse(x)

Parse a quantity from the string.

class bbp_workflow.luigi.RemoteContext(*args, **kwargs)

Bases: RemoteContext

No host key check context.

class bbp_workflow.luigi.RemoteTarget(*args, **kwargs)

Bases: RemoteTarget

No host key check target.

class bbp_workflow.luigi.Requirement(task_class, inherit_params=True, **params)

Bases: object

Requirement specification.

class bbp_workflow.luigi.Requires

Bases: object

Composition to replace luigi.task.Task.requires().

class bbp_workflow.luigi.RunAnywayTarget(task_obj)

Bases: RunAnywayTarget

Does the same as the base class and ignores permission exception on file cleanup.

done(value=None)

Create temporary file to mark the task as done.

get_data()

Return the content of the output path.

class bbp_workflow.luigi.extends(*tasks_to_extend)

Bases: object

Special task inheritance with parameter look-up from parent classes config file sections.

Usage:

test.cfg
 [AnotherTask]
 a: hello

 [YetAnotherTask]
 b: world
test.py
 class AnotherTask(luigi.Task):
     a = luigi.Parameter()

 class YetAnotherTask(luigi.Task):
     b = luigi.Parameter()

 @extends(AnotherTask, YetAnotherTask)
 class MyTask(luigi.Task):

     def run(self):
        print(self.a) # this will be defined
        print(self.b) # this will be defined
        # ...
class bbp_workflow.luigi.inherits(*tasks_to_inherit)

Bases: object

Task inheritance.

New after Luigi 2.7.6: multiple arguments support.

Usage:

class AnotherTask(luigi.Task):
    m = luigi.IntParameter()

class YetAnotherTask(luigi.Task):
    n = luigi.IntParameter()

@inherits(AnotherTask)
class MyFirstTask(luigi.Task):
    def requires(self):
       return self.clone_parent()

    def run(self):
       print(self.m) # this will be defined
       # ...

@inherits(AnotherTask, YetAnotherTask)
class MySecondTask(luigi.Task):
    def requires(self):
       return self.clone_parents()

    def run(self):
       print(self.n) # this will be defined
       # ...