itacart.topology.are_neighbor_cells

itacart.topology.are_neighbor_cells(origin, destination)[source]

Whether two cells share an edge.

Edge adjacency only; cells meeting at a single vertex are not neighbours, which is what separates this relation from the Chebyshev disk, where meeting at a vertex is enough.

Asked from both sides, because a cell in the geometric exception set can name a neighbour that cannot name it back with a single step: a trapezoid has up to three cells along one edge and only one of them is the step. Adjacency itself is symmetric, so answering from either side is enough.

Parameters:
  • origin (str) – Atomic index of the first cell.

  • destination (str) – Atomic index of the second cell.

Return type:

bool

Returns:

True when the cells are edge-adjacent.

Raises:
  • ResolutionError – If the cells sit at different resolutions.

  • NonExistentCellError – If any cell of the index names no cell. The predicate is the arbiter and the contract ends there: a spelling it denies is refused rather than answered for the cell it would otherwise fold onto.