FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

ENH: Make `output_name` optional in `Pipeline.run` by basnijholt · Pull Request #959 · pipefunc/pipefunc · GitHub

ENH: Make output_name optional in Pipeline.run - #959

Merged
basnijholt merged 1 commit into
mainfrom
run-optional-output-name
Jun 9, 2026
Merged

ENH: Make output_name optional in Pipeline.run#959
basnijholt merged 1 commit into
mainfrom
run-optional-output-name

Conversation

Copy link
Copy Markdown
Collaborator

Summary

Addresses the first suggestion in #902: pipeline.run required an output_name, even when the pipeline has a unique leaf node, while pipeline(...) (i.e., __call__) did not.

  • Pipeline.run(output_name=None) (now the default) resolves to the unique leaf node's output name, or to all leaf nodes when there are multiple, returning a tuple of their outputs (as requested in Improvements / suggestions by #902: "just run the full pipeline, even without unique leaf nodes").
  • Pipeline.__call__ now delegates the None case to run, so pipeline(a=1, b=2) also works for pipelines with multiple leaf nodes instead of raising.

Example

@pipefunc(output_name="c")
def f(a, b):
    return a + b

@pipefunc(output_name="d")
def g(c):
    return 2 * c

pipeline = Pipeline([f, g])
pipeline.run(kwargs={"a": 1, "b": 2})  # 6, no output_name needed

Verification

  • New tests: unique leaf default, multiple-leaves default (tuple result, both via run and __call__), and a leaf with a multi-output output_name tuple.
  • Full suite: 1396 passed, 11 skipped, 2 xfailed.
  • pre-commit (ruff, mypy, etc.) passes.

Closes nothing on its own; part of #902.

Defaults to the unique leaf node's output, or all leaf nodes when
there are multiple (returning a tuple), matching `Pipeline.__call__`.

Addresses one of the suggestions in #902.

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

✅ PR Title Formatted Correctly

The title of this PR has been updated to match the correct format. Thank you!

basnijholt merged commit ce55ab7 into main Jun 9, 2026
17 of 18 checks passed
basnijholt deleted the run-optional-output-name branch June 9, 2026 22:44

codecov Bot commented Jun 9, 2026
edited
Loading

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
pipefunc/_pipeline/_base.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codspeed-hq Bot commented Jun 9, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 6 untouched benchmarks


Comparing run-optional-output-name (8eeb9fb) with main (a0b4069)

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL