Idx: Hierarchical Cell Index#

class arch.base.Idx.Idx(root=PydanticUndefined)#

An architectonic index, locating a cell within the four-level tree.

The root string holds up to four digits in 0123; non-actual indices may instead end in an a or b suffix naming the abstract half that groups digits 01 or 23.

classmethod validate_idx(val)#

Assert that the given root string is a well-formed index.

classmethod new(val='')#

Build an index from a string, int, or existing Idx; None yields the root index.

classmethod is_valid(val)#

Return True if the given string is a well-formed index.

property complexity#

Return the tree depth of this index, not counting any abstract suffix.

property is_concrete#

Return True if this index has no abstract a/b suffix.

property is_actual#

Return True if this index reaches the maximum depth of four.

property base#

Return the base index, which is the index without any abstract suffixes.

property parent#

the abstract half this index’s last digit belongs to.

Type:

Return the immediate parent

property concrete_parent#

Return the concrete parent, i.e. this index with its last character removed.

property children#

abstract halves if concrete, digits otherwise.

Type:

Return the immediate children

property concrete_children#

Return the four concrete children, skipping over the abstract halves.

property ancestors#

Yield every ancestor of this index, from the root down to the immediate parent.

property concrete_ancestors#

Yield every concrete ancestor, from the root down to the concrete parent.

property descendants#

Yield all the nodes “below” this one in the architectonic, in depth-first order.

property concrete_descendants#

Yield all concrete descendants of this index, in depth-first order.

property parts#

Return the four characters of the index as a tuple, padded with empty strings.

model_config = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].