access
access
#
Value-level access nodes that navigate a materialized value.
Navigate a materialized Struct/Array/Map value the way the
destination/access path family navigates a Path[...].
Each one is the value twin of a path node: where PathField walks a
Path[Struct] to Path[FieldType], StructField reads a struct value
and yields the field's value. They compose, so the structured value a node
returns can be drilled into — CapturePanorama().frames[1].angle is
StructField → ArrayIndex → StructField — and the result cached at a
path (root.angle &= …).
Like the path family, every node takes the position it descends as source.
| operation | path-level (destination/access) |
value-level (here) |
|---|---|---|
| struct field | PathField |
StructField |
| array index | PathIndex |
ArrayIndex |
| map key | PathKey |
MapKey |
A node can return a Map value — CaptureImagesByLabel collects one image
sequence per label — so map access has a value twin too: MapKey reads a Map
value and yields one entry's value, the way PathKey walks a Path[Map] to
Path[V]. A key the map lacks at runtime yields no value rather than aborting
the run. .keys() / .values() enumeration stays path-level
(PathKeys/PathValues).
ArrayIndex
#
Select one element of an array value (negative indexes from the end).
Returns the array's element type E. The value-level twin of
PathIndex. The
element type carries through: indexing an Array[Path[V]] yields a
navigable Path[V] (so values()[-1].primary keeps navigating), while
indexing an Array[Time] yields a Time value (keys()[0]).
Attributes:
| Name | Type | Description |
|---|---|---|
source |
Procedure[Array]
|
A procedure producing the |
index |
Setting[int]
|
The integer position ( |
Source code in capturegraph-lib/capturegraph/procedures/nodes/process/access.py
__post_init__()
#
Resolve _return_type to the source array's element type.
Source code in capturegraph-lib/capturegraph/procedures/nodes/process/access.py
MapKey
#
Select one entry of a map value by key. Returns the map's element type V.
The value-level twin of
PathKey: PathKey
navigates a Path[Map] to Path[V], while MapKey reads a Map
value and yields the entry's value. It is what indexing a map-returning
node builds — cg.CaptureImagesByLabel(labels=["A", "B"])["A"].
A key the map lacks at runtime yields no value (the access produces nothing, so caching it stores nothing) and the executing client reports the unknown key, rather than aborting the run.
Attributes:
| Name | Type | Description |
|---|---|---|
source |
Procedure[Map]
|
A procedure producing the |
key |
Procedure[CGType]
|
A procedure producing the key value (a keyable scalar matching the map's key type). |
Source code in capturegraph-lib/capturegraph/procedures/nodes/process/access.py
__post_init__()
#
Resolve _return_type to the source map's element type.
Source code in capturegraph-lib/capturegraph/procedures/nodes/process/access.py
StructField
#
Read a named field of a struct value. Returns the field's type.
The value-level twin of
PathField:
PathField navigates a Path[Struct] to Path[FieldType], while
StructField reads a struct value and yields the field's value.
Attributes:
| Name | Type | Description |
|---|---|---|
source |
Procedure[Struct]
|
A procedure producing the |
field |
Setting[str]
|
The field name to read. |
Source code in capturegraph-lib/capturegraph/procedures/nodes/process/access.py
__post_init__()
#
Resolve _return_type to the source struct's field type.