archimedes.treeΒΆ
Utilities for working with hierarchical tree-structured data.
Functions
|
Check if all leaves in the tree evaluate to True. |
|
Create a field specification with struct-related metadata. |
|
Return a tuple describing the fields of this dataclass. |
|
Flatten a tree into a list of leaves and a treedef. |
|
Check if a value is a leaf in a tree. |
|
Check if an object is a registered struct class. |
|
Extract all leaf values from a tree. |
|
Apply a function to each leaf in a tree. |
|
Flatten a tree to a single 1D array. |
|
Reduce a tree to a single value using a function and initializer. |
|
Register a dataclass as tree-compatible with customized field handling. |
|
Register a custom type as a tree-compatible dataclass. |
|
Return a new object replacing specified fields with new values. |
|
Decorator to convert a class into a tree-compatible frozen dataclass. |
|
Extract the structure of a tree without the leaf values. |
|
Reconstruct a tree from a list of leaves and a treedef. |
Classes
|
|
Base class for creating configuration objects with automatic type discrimination. |
|
Discriminated union of StructConfig subclasses. |