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

MAINT: Deprecate `cleanup` parameter in favor of `resume` parameter by basnijholt · Pull Request #921 · pipefunc/pipefunc · GitHub

MAINT: Deprecate cleanup parameter in favor of resume parameter - #921

Merged
basnijholt merged 8 commits into
mainfrom
reuse
Nov 5, 2025
Merged

MAINT: Deprecate cleanup parameter in favor of resume parameter #921
basnijholt merged 8 commits into
mainfrom
reuse

Conversation

Copy link
Copy Markdown
Collaborator

No description provided.

Deprecate the `cleanup: bool` parameter across all map functions and
replace it with `reuse: bool` for clearer semantics:
- `cleanup=True` (old) ≡ `reuse=False` (new): clean up before running
- `cleanup=False` (old) ≡ `reuse=True` (new): reuse previous run data

Changes:
- Update all 8 function signatures (Pipeline.map, run_map, etc.)
- Add deprecation warnings when cleanup is used
- Update RunInfo.create() and internal validation logic
- Update adaptive learner functions (create_learners, etc.)
- Update CLI to support both --map-cleanup and --map-reuse flags
- Update all error messages from "cleanup=False" to "reuse=True"
- Maintain backward compatibility: cleanup takes priority when set

The cleanup parameter will be removed in a future version.
Complete the cleanup parameter deprecation by:
- Migrate all test files from cleanup= to reuse= parameter
- Update CLI documentation to reference --map-reuse instead of --map-cleanup
- Update all mapping option descriptions to mention "reuse behavior"

All tests now use the new reuse parameter exclusively while maintaining
backward compatibility through the deprecated cleanup parameter.
- Add stacklevel parameter to _handle_cleanup_deprecation() for proper warning location
- Replace duplicated deprecation logic in all user-facing functions with helper
- Functions updated: Pipeline.map(), Pipeline.map_async(), run_map(), run_map_async(), run_map_eager(), run_map_eager_async()
- Remove deprecation warning from RunInfo.create() (now handled at user-facing layer)
- Maintains same behavior while eliminating code duplication

codecov Bot commented Nov 4, 2025
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%> (ø)
pipefunc/_pipeline/_cli.py 100.00% <100.00%> (ø)
pipefunc/map/_prepare.py 100.00% <ø> (ø)
pipefunc/map/_run.py 100.00% <100.00%> (ø)
pipefunc/map/_run_eager.py 100.00% <100.00%> (ø)
pipefunc/map/_run_eager_async.py 100.00% <100.00%> (ø)
pipefunc/map/_run_info.py 100.00% <100.00%> (ø)
pipefunc/map/adaptive.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codspeed-hq Bot commented Nov 4, 2025
edited
Loading

Copy link
Copy Markdown

CodSpeed Performance Report

Merging #921 will not alter performance

Comparing reuse (2877a61) with main (cd662ab)

Summary

✅ 6 untouched

- Set cleanup=None after handling deprecation in Pipeline.map() and Pipeline.map_async()
- This prevents lower-level functions from issuing duplicate warnings
- User-facing functions now emit exactly one warning per invocation

Fixes issue where pipeline.map(..., cleanup=False) would emit two identical
DeprecationWarnings (once in Pipeline.map, once in run_map/run_map_eager).
Renamed parameter 'reuse' to 'resume' for better semantic clarity:
- 'resume' better conveys the ability to continue incomplete runs
- Aligns with checkpoint/restart terminology in scientific computing
- More intuitive user mental model: 'resume from previous run'

Changes:
- Parameter rename: reuse → resume
- Parameter rename: reuse_validation → resume_validation
- CLI flag rename: --map-reuse → --map-resume
- File rename: test_reuse_validation.py → test_resume_validation.py
- Updated all docstrings, error messages, and documentation
- Deprecation warning now references 'resume' instead of 'reuse'

Affected files:
- 8 source files in pipefunc/
- 5 test files
- 1 documentation file
- Total: 210+ occurrences updated
basnijholt changed the title MAINT: Deprecate cleanup parameter in favor of reuse parameter MAINT: Deprecate cleanup parameter in favor of resume parameter Nov 4, 2025
Comment thread pipefunc/map/_run.py Dismissed

github-actions Bot commented Nov 5, 2025

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 16bc9b2 into main Nov 5, 2025
20 of 21 checks passed
basnijholt deleted the reuse branch November 5, 2025 00:28
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.

2 participants


Back | FazBrowse Home | New Git URL