Skip to content

Commit

Permalink
fixed output file collection for optional file outputs set to False
Browse files Browse the repository at this point in the history
  • Loading branch information
tclose committed Sep 29, 2023
1 parent 810dcd2 commit 8e6e21d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pydra/engine/specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,9 +451,14 @@ def collect_additional_outputs(self, inputs, output_dir, outputs):
input_value = getattr(inputs, fld.name, attr.NOTHING)
if input_value is not attr.NOTHING:
if TypeParser.contains_type(FileSet, fld.type):
label = f"output field '{fld.name}' of {self}"
input_value = TypeParser(fld.type, label=label).coerce(input_value)
additional_out[fld.name] = input_value
if input_value is not False:
label = f"output field '{fld.name}' of {self}"
input_value = TypeParser(fld.type, label=label).coerce(
input_value
)
additional_out[fld.name] = input_value
else:
additional_out[fld.name] = input_value

Check warning on line 461 in pydra/engine/specs.py

View check run for this annotation

Codecov / codecov/patch

pydra/engine/specs.py#L461

Added line #L461 was not covered by tests
elif (
fld.default is None or fld.default == attr.NOTHING
) and not fld.metadata: # TODO: is it right?
Expand Down

0 comments on commit 8e6e21d

Please sign in to comment.