Skip to content

Pairwise n→1 computation dispatch mode #3

@PierreRaybaut

Description

@PierreRaybaut

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

  • processor.py exposes a mode: "single" | "pairwise" argument on every n→1 dispatch entry point.
  • At least one canonical n→1 operation (e.g. signal difference) ships with a UI selector for the second operand list and a working pairwise execution path.
  • Unit tests in tests/python/ cover both modes, including the validation error on mismatched list lengths.
  • A Playwright spec exercises a pairwise difference between two 3-signal lists and asserts 3 result objects with the expected titles.
  • Documented in the user guide alongside the existing single-operand mode.

References

  • DataLab desktop: datalab/gui/processor/base.py and Conf.proc.operation_mode
  • Web equivalent today: DataLab-Web/src/runtime/processor.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions