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 Feb 24, 2024
1 parent da5579c commit ec32186
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 @@ -452,9 +452,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 462 in pydra/engine/specs.py

View check run for this annotation

Codecov / codecov/patch

pydra/engine/specs.py#L462

Added line #L462 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 ec32186

Please sign in to comment.