matflow.InputSource#
- class matflow.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
Make an instnace of an input source that is default.
Make an instance of this class from JSON (or YAML) data.
Parse a dot-delimited string definition of an InputSource.
If source_type is task, then return the referenced task from the given workflow.
Make an instnace of an input source that is an import.
Check if this input source is in a list of other input sources, without considering the element_iters and where attributes.
Make an instnace of an input source that is local.
Make an instnace of an input source that is a task.
Serialize this object as a dictionary.
Serialize this object as an object structure that can be trivially converted to JSON.
Render this input source as a string.
Attributes
Type of the input source.
Where the input comes from when the type is IMPORT.
Which task is this an input for? Used when the type is TASK.
Type of task source.
Which element iterations does this apply to?
Filtering rules.
Path to where this input goes.
- app = App(name='MatFlow', version='0.3.0a132')#
- 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.