matflow.WorkflowTask#
- class matflow.WorkflowTask(workflow, template, index, element_IDs)#
Bases:
WorkflowTask
Class to represent a Task that is bound to a Workflow.
Methods
Check valid input sources are specified for a new task to be added to the workflow in a given position.
Get elements from downstream tasks that depend on this task.
Get tasks (insert ID or WorkflowTask objects) that depends on this task.
Get elements from upstream tasks that this task depends on.
Get tasks (insert ID or WorkflowTask objects) that this task depends on.
Try to initialise any uninitialised EARs of this task.
Find the index of the Zarr parameter group index list corresponding to each input data for all elements.
Attributes
Get all workflow tasks that are downstream from this task.
Get all workflow tasks that are upstream from this task.
- add_elements(base_element=None, inputs=None, input_files=None, sequences=None, resources=None, repeats=None, input_sources=None, nesting_order=None, element_sets=None, sourceable_elem_iters=None, propagate_to=None, return_indices=False)#
- app = App(name='MatFlow', version='0.3.0a129')#
- property dir_name#
- property downstream_tasks#
Get all workflow tasks that are downstream from this task.
- property element_IDs#
- property elements#
- ensure_input_sources(element_set)#
Check valid input sources are specified for a new task to be added to the workflow in a given position. If none are specified, set them according to the default behaviour.
This method mutates element_set.input_sources.
- generate_new_elements(input_data_indices, output_data_indices, element_data_indices, sequence_indices, source_indices)#
- get(path, raise_on_missing=False, default=None)#
- get_all_element_iterations()#
- Return type:
- get_dependent_elements(as_objects=False)#
Get elements from downstream tasks that depend on this task.
- get_dependent_tasks(as_objects=False)#
Get tasks (insert ID or WorkflowTask objects) that depends on this task.
- Parameters:
as_objects (bool) –
- Return type:
List[int | WorkflowTask]
- get_element_dependencies(as_objects=False)#
Get elements from upstream tasks that this task depends on.
- get_task_dependencies(as_objects=False)#
Get tasks (insert ID or WorkflowTask objects) that this task depends on.
Dependencies may come from either elements from upstream tasks, or from locally defined inputs/sequences/defaults from upstream tasks.
- Parameters:
as_objects (bool) –
- Return type:
List[int | WorkflowTask]
- property index#
- initialise_EARs(iter_IDs=None)#
Try to initialise any uninitialised EARs of this task.
- property inputs#
- property insert_ID#
- property name#
- classmethod new_empty_task(workflow, template, index)#
- property num_actions#
- property num_element_sets#
- property num_elements#
- property outputs#
- static resolve_element_data_indices(multiplicities)#
Find the index of the Zarr parameter group index list corresponding to each input data for all elements.
# TODO: update docstring; shouldn’t reference Zarr.
- Parameters:
multiplicities (list of dict) –
- Each list item represents a sequence of values with keys:
multiplicity: int nesting_order: int path : str
- Returns:
element_dat_idx – Each list item is a dict representing a single task element and whose keys are input data paths and whose values are indices that index the values of the dict returned by the task.make_persistent method.
- Return type:
- property template#
- property unique_name#
- property upstream_tasks#
Get all workflow tasks that are upstream from this task.
- property workflow#