Skip to content

Commit f26225e

Browse files
committed
reworked code to make codecov happy
1 parent 616706d commit f26225e

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

pydra/engine/specs.py

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -462,26 +462,28 @@ def collect_additional_outputs(self, inputs, output_dir, outputs):
462462
try:
463463
additional_out[fld.name] = getattr(inputs, fld.name)
464464
except AttributeError:
465-
if (
466-
fld.default is None or fld.default == attr.NOTHING
467-
) and not fld.metadata: # TODO: is it right?
468-
raise AttributeError("File has to have default value or metadata")
469-
elif fld.default != attr.NOTHING:
470-
additional_out[fld.name] = self._field_defaultvalue(fld, output_dir)
471-
elif fld.metadata:
472-
if (
473-
fld.type in [int, float, bool, str, list]
474-
and "callable" not in fld.metadata
475-
):
476-
raise AttributeError(
477-
f"{fld.type} has to have a callable in metadata"
478-
)
479-
additional_out[fld.name] = self._field_metadata(
480-
fld, inputs, output_dir, outputs
481-
)
465+
pass
482466
else:
483467
if fld.type in (File, MultiOutputFile, Directory, Path):
484468
additional_out[fld.name] = Path(additional_out[fld.name]).absolute()
469+
continue
470+
if (
471+
fld.default is None or fld.default == attr.NOTHING
472+
) and not fld.metadata: # TODO: is it right?
473+
raise AttributeError("File has to have default value or metadata")
474+
elif fld.default != attr.NOTHING:
475+
additional_out[fld.name] = self._field_defaultvalue(fld, output_dir)
476+
elif fld.metadata:
477+
if (
478+
fld.type in [int, float, bool, str, list]
479+
and "callable" not in fld.metadata
480+
):
481+
raise AttributeError(
482+
f"{fld.type} has to have a callable in metadata"
483+
)
484+
additional_out[fld.name] = self._field_metadata(
485+
fld, inputs, output_dir, outputs
486+
)
485487
return additional_out
486488

487489
def generated_output_names(self, inputs, output_dir):

0 commit comments

Comments
 (0)