Skip to content

Commit

Permalink
removed implicit extraction of output names from return values
Browse files Browse the repository at this point in the history
  • Loading branch information
tclose committed Dec 21, 2024
1 parent fb86964 commit 97c6f11
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions pydra/design/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -783,19 +783,6 @@ def extract_function_inputs_and_outputs(
else:
inputs[inpt_name] = arg_type(type=inpt, default=default)
return_type = type_hints.get("return", ty.Any)
if outputs is None:
src = inspect.getsource(function).strip()
return_lines = re.findall(r"\n\s+return .*$", src)
if len(return_lines) == 1 and src.endswith(return_lines[0]):
return_line = return_lines[0].split("#")[0]
implicit_outputs = [
o.strip()
for o in re.match(r"\s*return\s+(.*)", return_line).group(1).split(",")
]
if len(implicit_outputs) and all(
re.match(r"^\w+$", o) for o in implicit_outputs
):
outputs = implicit_outputs
if outputs and len(outputs) > 1:
if return_type is not ty.Any:
if ty.get_origin(return_type) is not tuple:
Expand Down

0 comments on commit 97c6f11

Please sign in to comment.