phenotypic.abc_.Control#

class phenotypic.abc_.Control(label: str, kind: Literal['float', 'select', 'bool', 'text'], default: Any, bounds: tuple[float, float] | None = None, step: float | None = None, options: tuple[Any, ...] | None = None, help: str | None = None)[source]#

Bases: object

Renderer-neutral input bound to a figure method’s keyword argument.

Bound by identity: the same instance referenced by several @figure methods renders as one shared widget; distinct instances (even with the same label) are independent widgets. There is no global name namespace, so two unrelated figures may each have a sigma kwarg without colliding.

Parameters:
  • label (str) – Human-readable widget label.

  • kind (Literal['float', 'select', 'bool', 'text']) – One of "float", "select", "bool", "text".

  • default (Any) – Initial value. Must be consistent with kind (within bounds for float; a member of options for select; a bool for bool).

  • bounds (tuple[float, float] | None) – (low, high) range — required for "float".

  • step (float | None) – Optional slider step for "float".

  • options (tuple[Any, ...] | None) – Allowed values — required for "select".

  • help (str | None) – Optional tooltip text.

Raises:

ValueError – If the kind-specific requirements are not met.

Methods

__init__

Attributes

label: str#
kind: Literal['float', 'select', 'bool', 'text']#
default: Any#
bounds: tuple[float, float] | None = None#
step: float | None = None#
options: tuple[Any, ...] | None = None#
help: str | None = None#