itacart.hierarchy.get_ancestors

itacart.hierarchy.get_ancestors(index)[source]

Every ancestor of a cell, coarse to fine.

Strict: a cell is not among its own ancestors. The reflexive relation is contains().

Parameters:

index (str) – Compositional index string.

Return type:

list[str] | list[list[str]]

Returns:

An ancestor chain for a single cell, or a positionally aligned list of chains. Entries are prefixes under the same caveat as get_parent().