Skip to content

Commit d0385a2

Browse files
committed
fix up handling of non-lazy outputs
1 parent d323ec7 commit d0385a2

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

pydra/compose/workflow.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
extract_fields_from_class,
1313
)
1414
from pydra.utils.general import attrs_values
15-
from pydra.utils.typing import StateArray
15+
from pydra.utils.typing import StateArray, is_lazy
1616

1717
if ty.TYPE_CHECKING:
1818
from pydra.engine.workflow import Workflow
@@ -334,11 +334,10 @@ def _from_job(cls, job: "Job[WorkflowTask]") -> ty.Self:
334334
values = {}
335335
lazy_field: LazyOutField
336336
for name, lazy_field in attrs_values(workflow.outputs).items():
337-
val_out = (
338-
lazy_field._get_value(workflow=workflow, graph=exec_graph)
339-
if isinstance(lazy_field, LazyOutField)
340-
else lazy_field
341-
)
337+
if is_lazy(lazy_field):
338+
val_out = lazy_field._get_value(workflow=workflow, graph=exec_graph)
339+
else:
340+
val_out = lazy_field # handle non-lazy inputs that are passed through
342341
if isinstance(val_out, StateArray):
343342
val_out = list(val_out) # implicitly combine state arrays
344343
values[name] = val_out

0 commit comments

Comments
 (0)