states

Contents

states#

class brainstate.graph.states(node, *filters, allowed_hierarchy=(0, 2147483647))#

Collect State objects from a graph node as ``FlattedDict``(s).

Shared State objects (reachable via multiple paths) are deduplicated by identity: each unique State appears exactly once, matching the behaviour of treefy_states().

Parameters:
Returns:

All states (single filter or none), or one mapping per filter.

Return type:

FlattedDict | Tuple[FlattedDict, ...]