Skip to content

feat: parallel and map branch name#387

Open
wangyb-A wants to merge 2 commits intomainfrom
feat/item_namer
Open

feat: parallel and map branch name#387
wangyb-A wants to merge 2 commits intomainfrom
feat/item_namer

Conversation

@wangyb-A
Copy link
Copy Markdown
Contributor

@wangyb-A wangyb-A commented May 8, 2026

Issue #, if available:
close #303

Description of changes:

Add support for custom naming of map iterations and parallel branches.

Map:

  • item_namer on MapConfig[T]
  • Make MapConfig generic over T (the item type)
  • Add optional item_namer: Callable[[T, int], str] field
  • When provided, replaces the default map-item-{index} naming scheme
  • Receives the item and its index, returns a custom name string

Parallel:

  • Add ParallelBranch frozen dataclass with func and optional name
  • ParallelBranch implements call, making it directly usable anywhere a plain callable is accepted
  • When name is provided, replaces the default parallel-branch-{index} naming in execution history

Shared mechanism:

  • Add get_iteration_name(index) method to ConcurrentExecutor base class
  • MapExecutor and ParallelExecutor override it for custom naming

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Testing:

iShot_2026-05-07_17 18 37 iShot_2026-05-07_17 19 32

@wangyb-A wangyb-A marked this pull request as ready for review May 8, 2026 00:28
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.

[Feature]: branch/iteration namer for concurrent operations

2 participants