phenotypic.gui.builder._state.BlockNode#

class phenotypic.gui.builder._state.BlockNode(block_id: str, class_name: str, params: ~typing.Dict[str, ~typing.Any], label: str | None = None, nested: ~phenotypic.gui.builder._state._DagBuilderScope | None = None, collapsed: bool = False, list_slot_counts: ~typing.Dict[str, int] = <factory>)[source]#

Bases: object

One canvas block — single op, container, or Input Image source.

A BlockNode is the DAG-canvas counterpart of a single operation (or the Input Image sentinel, or a Pipeline container) in an ImagePipeline. It captures the class to instantiate, the scalar parameter values entered by the user, and (when the block is a Pipeline container) the inner _DagBuilderScope.

Aux wiring is not stored on the block — it lives on the enclosing scope’s edges list as one Edge per wire.

Parameters:
block_id#

Stable identifier (uuid.uuid4().hex — 32 chars).

Type:

str

class_name#

Registry key (e.g. "GaussianBlur"), the "ImagePipeline" sentinel for container blocks, or the "InputImage" sentinel for the scope’s source block.

Type:

str

params#

Scalar parameter values (no op-typed values — those come from edges now).

Type:

Dict[str, Any]

label#

User-editable display name; None falls back to class_name at render time.

Type:

str | None

nested#

Inner _DagBuilderScope populated only when class_name == "ImagePipeline".

Type:

phenotypic.gui.builder._state._DagBuilderScope | None

collapsed#

Container-only flag; True hides children on the canvas.

Type:

bool

list_slot_counts#

Per list-aux param name, the total slot count for layout. Empty slots = slot positions in [0, count) not covered by any Edge. Increments on list_aux_add_empty_slot / edge_create to a list port; never decrements except via slot delete.

Type:

Dict[str, int]

Methods

__init__

Attributes

block_id: str#
class_name: str#
params: Dict[str, Any]#
label: str | None = None#
nested: _DagBuilderScope | None = None#
collapsed: bool = False#
list_slot_counts: Dict[str, int]#