Collections#
- class caskade.NodeCollection(name: str | None = None, link: Node | tuple[Node] | None = None, description: str = '')[source]#
Bases:
Node,GetSetValuesBase mixin for collections of nodes that track parameters.
Provides shared functionality for traversing, querying, and converting parameters within a graph of nodes. Subclasses such as
NodeTupleandNodeListcombine this mixin with a standard Python sequence type.- property dynamic#
Whether any node in this collection has dynamic parameters.
- Returns:
Trueif at least one contained node is dynamic.- Return type:
bool
- property dynamic_param_groups: tuple[int]#
Sorted unique group identifiers of all dynamic parameters.
- Returns:
Sorted group indices present among the dynamic parameters.
- Return type:
tuple of int
- property dynamic_params: tuple[Param]#
All dynamic parameters in the graph below this node.
- Returns:
Dynamic (non-static, non-pointer) parameters found via topological ordering.
- Return type:
tuple of Param
- property pointer_params: tuple[Param]#
All pointer parameters in the graph below this node.
- Returns:
Parameters that act as pointers to other parameters, found via topological ordering.
- Return type:
tuple of Param
- property static#
Whether all nodes in this collection are static.
- Returns:
Trueif no contained node is dynamic.- Return type:
bool
- property static_params: tuple[Param]#
All static parameters in the graph below this node.
- Returns:
Static (non-dynamic, non-pointer) parameters found via topological ordering.
- Return type:
tuple of Param
- class caskade.NodeList(iterable=(), name=None)[source]#
Bases:
NodeCollection,listMutable, ordered collection of nodes.
Behaves like a standard
listbut also participates in the caskade node graph. All elements must beNodeinstances. Graph links are automatically updated whenever the list is modified.- Parameters:
iterable (iterable of Node, optional) – Nodes to include in the list. Defaults to an empty iterable.
name (str, optional) – Human-readable name for this collection node.
- class caskade.NodeTuple(iterable=None, name=None)[source]#
Bases:
NodeCollection,tupleImmutable, ordered collection of nodes.
Behaves like a standard
tuplebut also participates in the caskade node graph. All elements must beNodeinstances and are automatically linked as children upon construction.- Parameters:
iterable (iterable of Node, optional) – Nodes to include in the tuple.
name (str, optional) – Human-readable name for this collection node.