Repository navigation
Description
uw.workflows (on feature/fault-system-workflow) gives a step a DAG through the decorator:
@workflow_step(
description="Configure advection-diffusion solver for temperature",
produces=["adv_diff"],
requires=["mesh", "stokes"],
)
def create_advdiff(mesh, v, config): ...mesh, stokes, adv_diff are live Python objects: they exist inside one process and are gone when the kernel dies. So what view() renders is a call graph, not a product graph. In a script that does everything in one pass the two look alike, and they come apart as soon as somebody wants only part of the work.
The products of a convection run are the checkpoint and the figures, and the dependency that matters runs over those:
figure ← checkpoint ← solve ← mesh
That is the chain that lets a reader open a notebook, load the checkpoint and redraw a figure in seconds instead of re-solving for two minutes — the whole point of a one-click launch. WorkflowProducts is the right layer for it and docs/examples/workflows/convection_config.py never touches it, so the pattern is demonstrated without the half that makes it worth having.
What this needs
- Products named as files.
T_checkpoint,fig_temperature— steps declare those, notstokes. A constructor output is not a product. - A file product type.
_products._detect_typedispatches on UW objects (mesh, mesh variable, surface, surface collection); a PNG or annpzhas nowhere to go. A passthrough file type covers both. - Staleness, not just existence.
exists()checks the manifest and the disk. Selective rebuild — which the module docstring promises — needs "is this older than the things it requires", and that only means anything oncerequiresnames products. - A fork in the demo. Two figure-producing steps, so
view()shows a graph worth reading.
Why now
Examples shipped with the technical notes are moving to this pattern, so that a note's examples launch on binder and document their own dependencies. The semantics of the decorator and view() are right; it is the vocabulary of produces/requires that has to mean files. Recorded in docs/developer/guides/notebook-style-guide.md as provisional, pending this issue.
Note also that the existing style guide specifies uw.Params for tunable settings while the workflow pattern uses a pydantic WorkflowConfig. Worth settling which applies where.
Activity
Merge pull request #761 from underworldcode/docs/examples-workflow-pa…
Style guide: the workflow pattern for examples, marked provisional
Review of 06c6db0: a refresh keeps the units and the description
lmoresi commentedon Nov 13, 2026
This is a planning item and not a defect of its own (it carries the
roadmaplabel), so it moves to the roadmap project and this issue is closed.Roadmap item: "uw.workflows: produces and requires name products (files), not constructor outputs", in the Underworld roadmap, status Inbox. The item says what is asked for and what would settle it. The history and the measurements stay here.
The close reason reads "not planned" because GitHub has no state for "moved to the roadmap"; the work is not rejected. If something here turns out to be a defect, it gets an issue of its own.
Underworld development team with AI support from Claude Code