Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pattern for modifying workflows using map and reduce? #35

Open
SimonHeybrock opened this issue Jun 10, 2024 · 0 comments
Open

Pattern for modifying workflows using map and reduce? #35

SimonHeybrock opened this issue Jun 10, 2024 · 0 comments

Comments

@SimonHeybrock
Copy link
Member

SimonHeybrock commented Jun 10, 2024

Context

Using Sciline's (Cycleban's) map/reduce we modify workflows. See scipp/esssans#135 and scipp/esssans#135 (comment) 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.
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

No branches or pull requests

1 participant