hpcflow / hpcflow-new

Mozilla Public License 2.0
0 stars 5 forks source link

Non-locally provided `InputSource.task(..., task_source_type="input")` sources are not identified as available sources #671

Closed aplowman closed 2 months ago

aplowman commented 2 months ago

Consider a workflow with tasks with the following input and output parameter relationship:

task inputs outputs
t1 p0 p1
t2 p1 p2
t3 p1, p2 -

When Task.get_available_task_input_sources() is called to find possible input sources for t3's p1 parameter, only the output parameter from t1 is identified; the input parameter to t2 is not identified as a possible source. This is because, for task_source_type="input" sources, we only check for locally provided inputs (i.e. InputValues and ValueSequences). This is not usually a problem, because often the p1 input on t2 is usually derived from the p1 output on t1.

However, there are cases where it is required, and it is a reasonable expectation to be able to select that input source. In particular, if we have a group defined on t2 and consumed by t3, the values for p1 in t3 will be empty, because the group was not defined in t1, from which the values for p1 were sourced.

To fix this, we need to modify the input branch in Task._get_task_source_element_iters so it also consideres element sets that have task-type input sources for that parameter.

aplowman commented 2 months ago

Fixed in #672