hpcflow.app.InputSource#

class hpcflow.app.InputSource(source_type, import_ref=None, task_ref=None, task_source_type=None, element_iters=None, path=None, where=None)#

Bases: InputSource

An input source to a workflow task.

Parameters:
  • source_type (InputSourceType) – Type of the input source.

  • import_ref – Where the input comes from when the type is IMPORT.

  • task_ref – Which task is this an input for? Used when the type is TASK.

  • task_source_type (TaskSourceType) – Type of task source.

  • element_iters – Which element iterations does this apply to?

  • path – Path to where this input goes.

  • where (Rule | list[Rule] | ElementFilter) – Filtering rules.

Methods

default

Make an instnace of an input source that is default.

from_json_like

Make an instance of this class from JSON (or YAML) data.

from_string

Parse a dot-delimited string definition of an InputSource.

get_task

If source_type is task, then return the referenced task from the given workflow.

import_

Make an instnace of an input source that is an import.

is_in

Check if this input source is in a list of other input sources, without considering the element_iters and where attributes.

local

Make an instnace of an input source that is local.

task

Make an instnace of an input source that is a task.

to_dict

Serialize this object as a dictionary.

to_json_like

Serialize this object as an object structure that can be trivially converted to JSON.

to_string

Render this input source as a string.

Attributes

app

source_type

Type of the input source.

import_ref

Where the input comes from when the type is IMPORT.

task_ref

Which task is this an input for? Used when the type is TASK.

task_source_type

Type of task source.

element_iters

Which element iterations does this apply to?

where

Filtering rules.

path

Path to where this input goes.

app = BaseApp(name='hpcFlow', version='0.2.0a181')#
classmethod default()#

Make an instnace of an input source that is default.

element_iters#

Which element iterations does this apply to?

classmethod from_json_like(json_like, shared_data=None)#

Make an instance of this class from JSON (or YAML) data.

Parameters:
  • json_like – The data to deserialise.

  • shared_data – Shared context data.

Return type:

The deserialised object.

classmethod from_string(str_defn)#

Parse a dot-delimited string definition of an InputSource.

Parameter#

str_defn:

The string to parse.

Examples

task.[task_ref].input task.[task_ref].output local default import.[import_ref]

get_task(workflow)#

If source_type is task, then return the referenced task from the given workflow.

classmethod import_(import_ref, element_iters=None, where=None)#

Make an instnace of an input source that is an import.

Parameters:
  • import_ref – Import reference.

  • element_iters – Originating element iterations.

  • where – Filtering rule.

import_ref#

Where the input comes from when the type is IMPORT.

is_in(other_input_sources)#

Check if this input source is in a list of other input sources, without considering the element_iters and where attributes.

Parameters:

other_input_sources (List[InputSource]) –

Return type:

None | int

classmethod local()#

Make an instnace of an input source that is local.

path#

Path to where this input goes.

source_type#

Type of the input source.

classmethod task(task_ref, task_source_type=None, element_iters=None, where=None)#

Make an instnace of an input source that is a task.

Parameters:
  • task_ref – Source task reference.

  • task_source_type – Type of task source.

  • element_iters – Originating element iterations.

  • where – Filtering rule.

task_ref#

Which task is this an input for? Used when the type is TASK.

task_source_type#

Type of task source.

to_dict()#

Serialize this object as a dictionary.

to_json_like(dct=None, shared_data=None, exclude=None, path=None)#

Serialize this object as an object structure that can be trivially converted to JSON. Note that YAML can also be produced from the result of this method; it just requires a different final serialization step.

to_string()#

Render this input source as a string.

where#

Filtering rules.