Package mbuild :: Module plan :: Class plan_t
[frames] | no frames]

Class plan_t

source code

object --+
         |
        plan_t

An object that the builders create and is passed to the DAG dag_t to order the tasks. This is used exclusively to create command_t's.

Instance Methods
 
__init__(self, command, args=None, env=None, input=None, output=None, name=None)
Create an input record for the dag_t describing a command.
source code
 
__str__(self)
str(x)
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, command, args=None, env=None, input=None, output=None, name=None)
(Constructor)

source code 

Create an input record for the dag_t describing a command. The command can be a string to execute or a python function or a list of strings and python functions. The python function will be passed two arguments: args and env. args is typically a list, but could be anything.

The input and output lists of files are used by the dag_t to order this command relative to other commands.

When the command is a python function, the python function is called with two arguments: args and an env of type env_t. The args can be anything but are typically the inputs to the python function and any information required to generate the corresponding outputs. The python functions return a 2-typle (retcode, stdout).

The input list: When the command is a python function, the plan_t's input list contains at least the input files names passed via args variable. The input list can be a superset containing more stuff that might trigger the command execution.

If the command does not produce a specific output, you can specify a dummy file name to allow sequencing relative to other commands.

Parameters:
  • command (string or python function or a list) - string or python function.
  • args (list) - (optional) arguments to the command if it is a python function
  • env (env_t) - (optional) an environment to pass to the python function
  • input (list) - (optional) files upon which this command depends.
  • output (list) - (optional) files which depend on this command.
  • name (string) - (optional) short name to be used to identify the work/task
Overrides: object.__init__

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)