pystencils.flow.flowgraph.Cases#
- class pystencils.flow.flowgraph.Cases(branches, predecessors, name=None)#
Case distinction.
- Parameters:
predecessors (Iterable[FlowgraphNode])
name (str | None)
- property free_symbols: frozenset[Symbol]#
Free symbols of this node.
A symbol is free if it is used in this node’s equations but not defined in this node. Free symbols must be imported from predecessors.
- subs(substitutions, **kwargs)#
Apply substitutions inside this case distinction. :rtype:
CasesNote
Substitutions of expressions for symbols (
symbol -> expr) are only applied to a branch subgraph ifsymbolis a free symbol of that subgraph.
- replace_predecessors(predecessors)#
Return a copy of this node with a new list of predecessors
- Return type:
- Parameters:
predecessors (Iterable[FlowgraphNode])