A source that documents itself through a specific downstream node depends on that node to be understood, and that node already depends on this one for frames. The README pointed at one by name and the CI workflow still carried a comment about the dataflow that wired it, which no longer exists. The output is documented by its type instead: wire `image` into anything that takes std/media/v1/Image. PREVIEW covers seeing the frames without naming anyone. Generic words like "a viewer" or "a consumer" stay, since they describe a role rather than a repository.
This commit is contained in:
@@ -75,8 +75,6 @@ jobs:
|
|||||||
- name: Validate the dataflow
|
- name: Validate the dataflow
|
||||||
run: dora validate dataflow.yml
|
run: dora validate dataflow.yml
|
||||||
|
|
||||||
# dataflow_view.yml is deliberately not run: it fetches dora-image-view
|
|
||||||
# over the network and needs a tag to exist there.
|
|
||||||
# CAPTURE_FRAMES bounds the run so it ends on its own; CI=true is already
|
# CAPTURE_FRAMES bounds the run so it ends on its own; CI=true is already
|
||||||
# set by the runner, which makes a failed capture publish a placeholder
|
# set by the runner, which makes a failed capture publish a placeholder
|
||||||
# frame rather than raising on a machine with no camera.
|
# frame rather than raising on a machine with no camera.
|
||||||
|
|||||||
@@ -48,8 +48,9 @@ A window opens showing the frames as they are published. Press `q` to stop. That
|
|||||||
enough to check a camera, an encoding or a flip without wiring a second node — which is
|
enough to check a camera, an encoding or a flip without wiring a second node — which is
|
||||||
why there is one dataflow here rather than one per consumer.
|
why there is one dataflow here rather than one per consumer.
|
||||||
|
|
||||||
For a real pipeline, wire `image` into a viewer such as `dora-image-view` from your own
|
For a real pipeline, wire `image` into any node that takes `std/media/v1/Image`, from
|
||||||
dataflow.
|
your own dataflow. This repository names no consumer: it is a source, and depending on
|
||||||
|
something downstream of it only to demonstrate it would be a cycle.
|
||||||
|
|
||||||
## Output
|
## Output
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
"""Packing a frame as std/media/v1/Image.
|
"""Packing a frame as std/media/v1/Image.
|
||||||
|
|
||||||
The struct is respelled here rather than imported from the viewer: node
|
The struct is respelled here rather than imported: node repositories share no
|
||||||
repositories share no source package, so the manifest and this schema are the
|
source package, so the manifest and this schema are the whole contract a
|
||||||
whole contract between them.
|
consumer has.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|||||||
@@ -137,8 +137,8 @@ def test_a_good_read_is_returned_as_is():
|
|||||||
assert frame.shape == (4, 4, 3)
|
assert frame.shape == (4, 4, 3)
|
||||||
|
|
||||||
|
|
||||||
def test_the_struct_matches_what_the_viewer_expects():
|
def test_the_struct_matches_the_published_type():
|
||||||
# The viewer respells this schema in its own repository; they share no
|
# A consumer respells this schema in its own repository; they share no
|
||||||
# package, so the field names and types are the entire contract.
|
# package, so the field names and types are the entire contract.
|
||||||
assert image.IMAGE_TYPE == pa.struct([
|
assert image.IMAGE_TYPE == pa.struct([
|
||||||
("width", pa.uint32()),
|
("width", pa.uint32()),
|
||||||
|
|||||||
Reference in New Issue
Block a user