scipp / scipp/ess

Pattern for modifying workflows using `map` and `reduce`?

Open
#148 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

essreduce
Dominant language
Python
Stars
1
Forks
3
Avg merge
2d 11h
Merged PRs (30d)
17

Description

Context

Using Sciline's (Cycleban's) map/reduce we modify workflows. See scipp/esssans#135 and https://github.com/scipp/esssans/pull/135#discussion_r1629386269 for an example. The use of helper functions is not great UX (example: workflow = sans.with_banks(workflow, banks=[...])).

We should gain some more experience and get "data" on how well this works, then consider the alternatives below (or find more alternatives)

Alternatives
  • Make this arguments of the workflow creation, LokiWorkflow(sample_runs=..., ...).
  • Turn LokiWorkflow into a builder (using builder pattern):
    workflow = LokiWorkflow()
    workflow.set_sample_runs([...])
    workflow.build()  # or build automatically in `workflow.compute()`, by making this a wrapper.
    
  • Turn LokiWorkflow into a wrapper, with internal reference to the pipeline. Dedicated methods can set and update the internal workflow.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the map/reduce workflow example in scipp/esssans#135 and its linked pull-request discussion. Compare the current helper-function approach with the LokiWorkflow constructor, builder, and wrapper alternatives, or identify further options. The issue is complete when experience and data support a documented direction for the workflow-modification API.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-engineering
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.