Standard Types (Notebook)
The notebook companion to Standard Types: import a
few payloads from retriever.types.*, see why type identity (not field shape)
is the contract, construct a couple, and wire one onto a Flow port. Every output
block below is captured from a real run — nothing here needs a backend, camera,
or robot.
⬇ Download .ipynb▶ Open in Colab
One import path per domain
Section titled “One import path per domain”Standard payloads live under retriever.types, split by domain. You import the
class you need directly — there is no separate registration step to do in your
own code. Here we pull a few from three domains at once.
Output
Takeaway: the stable surface (retriever.types.spatial) re-exports the versioned module’s class, so you import from the short path while the runtime tracks the versioned home.
Type identity is the contract
Section titled “Type identity is the contract”The rule that makes these types useful is that they are the same class object
everywhere — not two look-alikes with matching fields. The stable surface and
the versioned module (.v1) re-export one object, so is holds. Every payload
is also @io-decorated, which is what lets it sit on a Flow port.
Output
Takeaway: because it is one class, a component that emits PoseStamped and one that consumes it mean the identical type — no adapter, no “which PoseStamped?”. Never redefine a standard type locally, even with identical fields.
Construct a couple
Section titled “Construct a couple”Composite spatial types (SE3Pose, PoseStamped) nest Vector3,
Quaternion, and Header, so nested access reads the way you’d expect.
Perception and language types compose the same way.
Output
Takeaway: composite payloads carry their own helpers — Quaternion.is_unit(), BBox2D.area() — so downstream code reads a payload instead of re-deriving it.
_signals says which fields arrived
Section titled “_signals says which fields arrived”@io makes every field optional, so a standard type can carry a partial
payload. _signals reports the fields whose value is set (non-None) — the
same mechanism a Flow uses to branch on what a step() actually received.
Output
Use a standard type as a Flow port
Section titled “Use a standard type as a Flow port”Since each payload is already @io, it becomes a Flow input or output with no
wrapping. Flow[DetectionBatch, Caption] is the type boundary Retriever
checks, and the clock (@ Trigger(...)) fires on a field of the input type.
Output
Takeaway: standard types are the wire format between Flows. Because both ends import the same @io class, the graph type-checks the edge for free — see Flow for how ports and clocks fit together.
This page is generated from notebooks/src/standard_types.py (jupytext py:percent source). Grab the runnable notebook and run every cell yourself.
