avid.actions.mitk.taskListGenerator.TaskListGeneratorAction

class avid.actions.mitk.taskListGenerator.TaskListGeneratorAction(inputSelector, actionTag='TaskListGenerator', generateCallable=None, indicateCallable=None, generate_tasks_callable=None, passOnlyURLs=False, **kwargs)

Bases: PythonUnaryStackBatchAction

Class that takes a list of artefacts and generates a MITK tasklist based on them

__init__(inputSelector, actionTag='TaskListGenerator', generateCallable=None, indicateCallable=None, generate_tasks_callable=None, passOnlyURLs=False, **kwargs)
Parameters:
  • inputSelector – Specified artefacts will all be included in the resulting tasklist

  • generateCallable – Custom callable that defines how the resulting tasklist should be built. By default, each tasklist entry contains the artefact name and url. The signature of generateCallable is: generateCallable(inputs ( = Input artefacts), outputs (=the output that should be produced), **allArgs (= all other arguments passed to the action)

  • indicateCallable – Custom callable that defines which outputs should be produced (see generateCallable). By default, a single json file in the top directory of the current session content will be created.

  • generate_tasks_callable – Custom callable that creates a list of tasks to write into a tasklist. If a custom generateCallable is defined, this method may not be used. By default, each input artefact gets a task with it as Image. generate_tasks_callable() receives the same inputs as generateCallable, but returns a list of dictionaries that define tasklist tasks.

Methods

__init__(inputSelector[, actionTag, ...])

param inputSelector:

Specified artefacts will all be included in the resulting tasklist

do()

Triggers the processing of an action instance.

do_finalize()

Function that has to be called after the data processing of an action processing to finalize the action state and do the bookkeeping (e.g. notifying the session, checking the validity and existence of the outputs).

do_processing()

Function that has to be called to do the data processing of an action processing.

do_setup()

Function that has to be called to prepare an action for the processing.

generateActions()

Function that (pre)generates the actions of the batch action.

getFailedActions()

Returns all actions of the session that have failed.

getSkippedActions()

Returns all actions of the session that have been skipped.

getSuccessfulActions([no_warnings])

Returns all actions of the session that have been successful.

getSuccessfulActionsWithWarnings()

Returns all actions of the session that have been successful but with warnings.

indicateOutputs()

Return a list of artefact entries the action will produce if do_setup() is called.

Attributes

ACTION_FAILURE

Indicating the skipping of the (last) execution of an action.

ACTION_PENDING

Indicating that the action instance is currently generating the outputs.

ACTION_RUNNING

Indicating that the action instance is in an uninitialized state.

ACTION_SKIPPED

Indicating that the action instance was not executed so far.

ACTION_SUCCESS

Indicating the failure of the (last) execution of an action instance.

ACTION_UNINIT

PRIMARY_INPUT_KEY

actionInstanceUID

actionTag

action_tag_selector

has_warnings

instanceName

isFailure

isPending

isRunning

isSkipped

isSuccess

is_uninitialized

last_exec_state

last_warnings

number_of_actions

Returns the number of actions in the batch.

outputArtefacts

ACTION_FAILURE = 'FAILURE'

Indicating the skipping of the (last) execution of an action. As any outputs the action instance would produce are available and still up to date.

ACTION_PENDING = 'PENDING'

Indicating that the action instance is currently generating the outputs.

ACTION_RUNNING = 'RUNNING'

Indicating that the action instance is in an uninitialized state.

ACTION_SKIPPED = 'SKIPPED'

Indicating that the action instance was not executed so far.

ACTION_SUCCESS = 'SUCCESS'

Indicating the failure of the (last) execution of an action instance.

do()

Triggers the processing of an action instance. This should be used as public trigger of an action. It is a convenient version that will trigger do_setup, do_process and do_finalize in the right way. Returns the action instance itself.

do_finalize()

Function that has to be called after the data processing of an action processing to finalize the action state and do the bookkeeping (e.g. notifying the session, checking the validity and existence of the outputs). After the call of the method the outputs of action instance are collected and verified. It is advised to use do(), which will use do_finalize() appropriately.

do_processing()

Function that has to be called to do the data processing of an action processing. After the call of the method the outputs of action instance are computed. It is advised to use do(), which will use do_processing() appropriately.

do_setup()

Function that has to be called to prepare an action for the processing. After the call of the method the action instance is able to process the data (if needed). The return value indicates of the instance can/needs to process (true) or not (false). It is advised to use do(), which will use do_setup() appropriately. After the call of this method, the instance will have one of the following states: (1) pending: expected state. Indicating that action should/needs to process and no waiting for triggering do_process() (2) skipped: indicated ouput data is already there and valid. No need for do_process, directly trigger do_finalize() (3) failed: indicated that the setup failed (e.g. because inputs are invalid). No need for do_process, directly trigger do_finalize()

generateActions()

Function that (pre)generates the actions of the batch action. If actions are already generated, nothing will happen.

getFailedActions()

Returns all actions of the session that have failed.

getSkippedActions()

Returns all actions of the session that have been skipped.

getSuccessfulActions(no_warnings=False)

Returns all actions of the session that have been successful.

getSuccessfulActionsWithWarnings()

Returns all actions of the session that have been successful but with warnings.

indicateOutputs()

Return a list of artefact entries the action will produce if do_setup() is called. The method should return complete entries. Therefore, the entries should already contain the url where they will be stored if the action is executed. Remark: The output indication might not represent the final result of an action (e.g. because an action is not able to determine the outputs before they are actually generated.). This the list might only indicate the assumed outputs. Also An action can return None to signal that it cannot indicate the outputs before generation. :return: Either a list of indicated outputs or None.

property number_of_actions

Returns the number of actions in the batch.