phenotypic.gui.builder._state.Edge#
- class phenotypic.gui.builder._state.Edge(edge_id: str, source_block_id: str, source_port: str = 'out', target_block_id: str = '', target_port: str = '', target_slot: int | None = None, kind: Literal['image', 'aux'] = 'image')[source]#
Bases:
objectOne wire between two block ports within a scope.
Wires connect either an image-out port to an image-in port (
kind == "image") or an image-out port to an aux-in port (kind == "aux").target_slotis set for list-typed aux ports (0-based) andNonefor scalar aux + all image-flow edges.- Parameters:
- edge_id#
Stable identifier. Generated as
uuid.uuid4().hexon creation but accepted as-is on JSON round-trip.- Type:
- source_port#
Source port name — currently always
"out"(one image-output per block). Field kept for future multi-output ops.- Type:
- target_block_id#
block_idof the downstream block. The default of""is a dataclass-ordering artifact (Python forbids non-default fields after defaulted ones); the__post_init__asserts the value is non-empty.- Type:
- target_port#
Target port name:
"in"for image-flow,"<param>"for aux (scalar or list — list slot index is intarget_slot).- Type:
- target_slot#
List-aux slot index (0-based);
Nonefor scalar aux and for image-flow.- Type:
int | None
- kind#
Edge kind —
"image"for blue image-flow wires,"aux"for purple consumer-into-aux wires. Redundant withtarget_portsemantics but kept explicit for fast validation.- Type:
Literal[‘image’, ‘aux’]
Methods
__init__Attributes