hpcflow.app.Task#

class hpcflow.app.Task(schema, repeats=None, groups=None, resources=None, inputs=None, input_files=None, sequences=None, input_sources=None, nesting_order=None, env_preset=None, environments=None, allow_non_coincident_task_sources=False, element_sets=None, output_labels=None, sourceable_elem_iters=None, merge_envs=True)#

Bases: Task

Parametrisation of an isolated task for which a subset of input values are given “locally”. The remaining input values are expected to be satisfied by other tasks/imports in the workflow.

Parameters:
  • schema (Union[app.TaskSchema, str, List[app.TaskSchema], List[str]]) – A TaskSchema object or a list of TaskSchema objects.

  • inputs (Optional[List[app.InputValue]]) – A list of InputValue objects.

  • repeats (Optional[List[Dict]]) –

  • groups (Optional[List[app.ElementGroup]]) –

  • resources (Optional[Dict[str, Dict]]) –

  • input_files (Optional[List[app.InputFile]]) –

  • sequences (Optional[List[app.ValueSequence]]) –

  • input_sources (Optional[Dict[str, app.InputSource]]) –

  • nesting_order (Optional[List]) –

  • env_preset (Optional[str]) –

  • environments (Optional[Dict[str, Dict[str, Any]]]) –

  • allow_non_coincident_task_sources (Optional[bool]) –

  • element_sets (Optional[List[app.ElementSet]]) –

  • output_labels (Optional[List[app.OutputLabel]]) –

  • sourceable_elem_iters (Optional[List[int]]) –

  • merge_envs (Optional[bool]) –

Methods

add_group

all_schema_actions

from_json_like

get_available_task_input_sources

For each input parameter of this task, generate a list of possible input sources that derive from inputs or outputs of this and other provided tasks.

get_input_statuses

Get a dict whose keys are normalised input paths (without the "inputs" prefix), and whose values are InputStatus objects.

get_param_provided_element_sets

Get the element set indices of this task for which a specified parameter type is locally provided.

get_schema_action

get_task_unique_names

Get the unique name of each in a list of tasks.

is_input_type_required

Check if an given input type must be specified in the parametrisation of this element set.

prepare_element_resolution

provides_parameters

Get all provided parameter labelled types and whether they are inputs and outputs, considering all element sets.

set_sequence_parameters

to_dict

to_json_like

to_persistent

Return a copy where any schema input defaults are saved to a persistent workflow.

Attributes

all_schema_input_normalised_paths

all_schema_input_types

Get the set of all schema input types (over all specified schemas).

all_schema_inputs

all_schema_output_types

Get the set of all schema output types (over all specified schemas).

all_schema_outputs

all_sourced_normalised_paths

app

defined_input_types

dir_name

Artefact directory name.

element_sets

index

insert_ID

name

non_universal_input_types

Get input types for each schema that are non-universal.

num_all_schema_actions

num_element_sets

objective

output_labels

schema

Returns the single task schema, if only one, else raises.

schemas

undefined_input_types

undefined_inputs

universal_input_types

Get input types that are associated with all schemas

add_group(name, where, group_by_distinct)#
Parameters:
all_schema_actions()#
Return type:

Iterator[Tuple[int, Action]]

property all_schema_input_normalised_paths#
property all_schema_input_types#

Get the set of all schema input types (over all specified schemas).

property all_schema_inputs: Tuple[SchemaInput]#
property all_schema_output_types#

Get the set of all schema output types (over all specified schemas).

property all_schema_outputs: Tuple[SchemaOutput]#
property all_sourced_normalised_paths#
app = BaseApp(name='hpcFlow', version='0.2.0a173')#
property defined_input_types#
property dir_name#

Artefact directory name.

property element_sets#
classmethod from_json_like(json_like, shared_data=None)#
Parameters:
  • json_like (Union[Dict, List]) –

  • shared_data (Optional[Dict[str, ObjectList]]) –

get_available_task_input_sources(element_set, source_tasks=None)#

For each input parameter of this task, generate a list of possible input sources that derive from inputs or outputs of this and other provided tasks.

Note this only produces a subset of available input sources for each input parameter; other available input sources may exist from workflow imports.

Parameters:
Return type:

List[InputSource]

get_input_statuses(elem_set)#

Get a dict whose keys are normalised input paths (without the “inputs” prefix), and whose values are InputStatus objects.

Parameters:

elem_set (ElementSet) – The element set for which input statuses should be returned.

Return type:

Dict[str, InputStatus]

get_param_provided_element_sets(labelled_path)#

Get the element set indices of this task for which a specified parameter type is locally provided.

Parameters:

labelled_path (str) –

Return type:

List[int]

get_schema_action(idx)#
static get_task_unique_names(tasks)#

Get the unique name of each in a list of tasks.

Return type:

list of str

Parameters:

tasks (List[Task]) –

property index#
property insert_ID#
is_input_type_required(typ, element_set)#

Check if an given input type must be specified in the parametrisation of this element set.

A schema input need not be specified if it is only required to generate an input file, and that input file is passed directly.

Parameters:
Return type:

bool

property name#
property non_universal_input_types#

Get input types for each schema that are non-universal.

property num_all_schema_actions: int#
property num_element_sets#
property objective#
property output_labels#
prepare_element_resolution(element_set, input_data_indices)#
provides_parameters()#

Get all provided parameter labelled types and whether they are inputs and outputs, considering all element sets.

Return type:

Tuple[Tuple[str, str]]

property schema: TaskSchema#

Returns the single task schema, if only one, else raises.

property schemas: List[TaskSchema]#
set_sequence_parameters(element_set)#
to_dict()#
to_json_like(dct=None, shared_data=None, exclude=None, path=None)#
to_persistent(workflow, insert_ID)#

Return a copy where any schema input defaults are saved to a persistent workflow. Element set data is not made persistent.

property undefined_input_types#
property undefined_inputs#
property universal_input_types#

Get input types that are associated with all schemas