Task¶
-
class
properties.extras.
BaseTask
[source]¶ Class for defining a computational task
Input and Output class attributes must be subclasses of BaseInput and BaseOutput respectively. Task is executed by calling an instance of the task with Input property/value pairs as keyword arguments.
-
__call__
(**kwargs)[source]¶ Execute the task
Keyword arguments are used to construct Input instance. This is validated and passed to
run
. The Output ofrun
is validated, passed toprocess_output
, and returned.
-
process_output
(output_obj)[source]¶ Processes valid Output object into desired task output
This method is executed during
__call__
on the output ofrun
.By default, this serializes the output to a dictionary.
-
run
(input_obj)[source]¶ Execution logic for the task
This method must be overridden in Task subclasses
To run a Task, create an instance of the Task, then call the instance with the required input parameters. This will construct and validate an Input object.
run
receives this validated Input object. It then must process the inputs and return an Output object.
-
-
class
properties.extras.
BaseInput
(**kwargs)[source]¶ HasProperties object with input parameters for a computation
-
class
properties.extras.
BaseOutput
(**kwargs)[source]¶ HasProperties object with the result of a computation
Required Properties:
-
class
properties.extras.
TaskStatus
(**kwargs)[source]¶ HasProperties object to indicate present status of the task
Optional Properties: