itacart.index.compose

itacart.index.compose(cells)[source]

Fold a list of atomic indices back into one compositional index.

Inverse of decompose(). Factors out shared ancestry so siblings collapse under their common parent. Cells may sit at different resolutions and in different quadrants; the result then carries several roots separated by commas.

Siblings keep the order in which they first appear, and no completeness collapse is applied: rewriting spelling is normalize()’s job, and keeping the two apart is what makes compose(decompose(x)) == x an exact identity rather than an approximate one.

Parameters:

cells (Iterable[str]) – Index strings. Atomic in the usual case, but a compositional entry is accepted and merged like any other.

Return type:

str

Returns:

A single compositional index string.

Raises:

InvalidIndexError – If any entry is malformed, or the iterable is empty — no index denotes the empty region.

The fold, and how far it reaches. A western zero-column spelling names no cell – column zero is the prime-meridian column and the meridian belongs to the eastern quadrants – and this layer takes it anyway, because analysing a spelling is not the same act as answering for a cell. Two functions rewrite it onto its eastern twin (normalize and compose) and two hand it straight back (decompose and iter_cells). Anything that answers about the cell refuses it instead, so the reach of this leniency is exactly the layer that reads index strings.