Summary
Add support for the pairwise dispatch mode in n→1 computations (e.g. arithmetic between two object lists), matching DataLab Qt's Conf.proc.operation_mode = "pairwise".
Motivation
DataLab Qt offers two policies for n→1 operations:
- single operand (current Web behaviour): the user picks one object and the operation is applied between each selected object and that single operand →
n → n.
- pairwise: two selections of size n are zipped, yielding n results from the i-th object of each list →
n + n → n.
The pairwise mode is heavily used for differential workflows (subtract reference batch from measurement batch, divide signal-by-noise pair by pair, etc.). Without it, users must script the loop manually.
Architectural impact
- Dispatcher rewrite:
src/runtime/processor.py's apply_2_to_1 currently iterates the selection against a single operand; pairwise mode needs a second selection picker and a paired iteration.
- UI: the second operand selector (currently a single combo box) must become a multi-select bound to the same panel and validated against the source selection's length.
- Action registry: each n→1 action descriptor needs a flag declaring whether it supports pairwise; the menu builder must inject the mode somewhere (per-action submenu? global toggle in Preferences? both?).
- Result naming: paired results need a deterministic title scheme that references both operands.
- Sigima alignment: confirm Sigima's
register_n_to_1 machinery exposes the policy or whether the choice is purely a host-side concern.
Acceptance criteria
References
- DataLab desktop:
datalab/gui/processor/base.py and Conf.proc.operation_mode
- Web equivalent today:
DataLab-Web/src/runtime/processor.py
Summary
Add support for the pairwise dispatch mode in n→1 computations (e.g. arithmetic between two object lists), matching DataLab Qt's
Conf.proc.operation_mode = "pairwise".Motivation
DataLab Qt offers two policies for n→1 operations:
n → n.n + n → n.The pairwise mode is heavily used for differential workflows (subtract reference batch from measurement batch, divide signal-by-noise pair by pair, etc.). Without it, users must script the loop manually.
Architectural impact
src/runtime/processor.py'sapply_2_to_1currently iterates the selection against a single operand; pairwise mode needs a second selection picker and a paired iteration.register_n_to_1machinery exposes the policy or whether the choice is purely a host-side concern.Acceptance criteria
processor.pyexposes amode: "single" | "pairwise"argument on every n→1 dispatch entry point.tests/python/cover both modes, including the validation error on mismatched list lengths.References
datalab/gui/processor/base.pyandConf.proc.operation_modeDataLab-Web/src/runtime/processor.py