fields
fields
#
Field classification — split a node's dataclass fields into the three roles.
A field's role is decided by its annotation alone (the marker), so an empty substep list or an unset optional input still classifies correctly. The roles:
- [FieldRole.INPUT][] — an
Input[T]data-flow edge. - [FieldRole.SUBSTEPS][] — the
Substepscontrol-flow list. - [FieldRole.SETTING][] — any
Setting[T]baked-in value. - [FieldRole.LABEL][] — the inherited
labelfield, serialized on its own.
[partition][] turns an instance into its (inputs, substeps, settings),
which is what the serializer's reachability walk and validation
all consume. The Procedure.{_inputs, _substeps, _settings} properties are
thin wrappers over it.
FieldRole
#
Bases: Enum
What a node dataclass field is — fixed by its annotation marker.
Source code in capturegraph-lib/capturegraph/procedures/procedure/type_checking/fields.py
field_roles(cls)
#
Every declared field as (name, role, annotation), in field order.
Reads the dataclass fields directly, so private state (_uuid and the
_return_type ClassVar) — which are not fields — never appear.
Source code in capturegraph-lib/capturegraph/procedures/procedure/type_checking/fields.py
inputs(node)
#
Input fields holding a procedure.
A set optional input is included; an unset one — value None — is not.
Source code in capturegraph-lib/capturegraph/procedures/procedure/type_checking/fields.py
role_of(name, annotation)
#
The role of a field, from its name and annotation marker.
Source code in capturegraph-lib/capturegraph/procedures/procedure/type_checking/fields.py
settings(node)
#
Every Setting field with a non-None value, in field order.
Source code in capturegraph-lib/capturegraph/procedures/procedure/type_checking/fields.py
substeps(node)
#
Every element of every Substeps field, flattened in field order.