avid.actions.rttb.bioModelCalc.BioModelCalcBatchAction

class avid.actions.rttb.bioModelCalc.BioModelCalcBatchAction(inputSelector, planSelector=None, planLinker=None, modelParameterMapsSelector=None, modelParameterMapsLinker=None, modelParameterMapsSorter=None, actionTag='bioModelCalc', session=None, additionalActionProps=None, scheduler=<avid.actions.simpleScheduler.SimpleScheduler object>, **singleActionParameters)

Bases: BatchActionBase

Base class for action objects that are used together with selectors and should therefore able to process a batch of SingleActionBased actions.

__init__(inputSelector, planSelector=None, planLinker=None, modelParameterMapsSelector=None, modelParameterMapsLinker=None, modelParameterMapsSorter=None, actionTag='bioModelCalc', session=None, additionalActionProps=None, scheduler=<avid.actions.simpleScheduler.SimpleScheduler object>, **singleActionParameters)

init the action and setting the workflow session, the action is working in. :param actionTag: Tag of the action within the session :param additionalActionProps: Dictionary that can be used to define additional properties that should be added to any artefact that are produced by the action. :param actionClass: Class of the action that should be generated :param actionCreationDelegate: Callable delegate that, if set, will be used to generate the action classes. Either actionClass or actionCreationDelegate have to be set; but only one of them. ActionBatchGenerator assumes that the delegate returns a list of generate action instances. The delegate will be called like the action class. A delegate can be used to manipulate the generation of the action instances after the whole splitting, sorting, selecting and linking is done. :param primaryInputSelector: Selector that indicates the primary input for the actions that should be generated :param primaryAlias: Name of the primary input that should be used as argument key if passed to action. If not set PRIMARY_INPUT_KEY will be used. :param additionalInputSelectors: Dictionary containing additional input selectors for other inputs that should be passed to an action instance. Key is the name of an additional input an also the argument name used to pass the input to the action instance. The associated dict value must be a selector instance or None to indicate that this input will have no data but exists. :param splitter: Dictionary specifying a splitter that should be used for a specific input (primary or additional) If no splitter is defined explicitly for an input SingleSplitter() will be assumed. The key indicates the input that should be associated with the splitter. To associate primary input use PRIMARY_INPUT_KEY as key.The values of the dict are the splitter instances that should be used for the respective key. :param sorter: Dictionary specifying a sorter that should be used for a specific input (primary or additional) If no sorter is defined explicitly for an input, BaseSorter() (so no sorting at all) will be assumed. The key indicates the input that should be associated with the sorter. To associate primary input use PRIMARY_INPUT_KEY as key. The values of the dict are the sorter instances that should be used for the respective key. :param linker: Dictionary specifying a linker that should be used for a specific additional input to link it with the primary input. Thus the master selection passed to the linker will always be provided by the primary input. If no linker is defined explicitly for an input CaseLinker() (so all inputs must have the same case) will be assumed. The key indicates the input that should be associated with the linker. The values of the dict are the linker instances that should be used for the respective key. :param dependentLinker: Allows to specify linkage for an additional input where the master selection must not be the primary input (in contrast to using the linker argument). Thus you can specifies that an additional input A is (also) linked to an additional input B. The method assumes the following structure of the variable. It is a dictionary. The dictionary key indicates the input that should be linked. So it can be any additional input. It must not be the primary input. The value associated with a dict key is an iterable (e.g. list) the first element is the name of the input that serves as master for the linkage. It may be any additional input (except itself = key of the value) or the primary input. The second element is the linker instance that should be used. You may combine linker and dependentLinker specifications for any additional input. To associate primary input as master use PRIMARY_INPUT_KEY as value. :param relevanceSelector: Selector used to specify for all inputs of actions what is relevant. If not set it is assumed that only artefact of type TYPE_VALUE_RESULT are relevant. :param session: Session object of the workflow the action is working in :param scheduler Strategy how to execute the single actions.

Methods

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

init the action and setting the workflow session, the action is working in.

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.