itacart.integer_index.int_parent
- itacart.integer_index.int_parent(value, target_res=None)[source]
The lexical parent of an integer, by division of its position.
The arithmetic counterpart of
itacart.get_parent(), and lexical in the same way: the result is the integer of the prefix one level up (or attarget_res), and that prefix may name no cell. At the domain border it does not, for a child spelled under the next column’s prefix;int_to_cell()refuses it there exactly asitacart.is_valid_cell()denies the string.- Parameters:
- Return type:
- Returns:
The parent integer, or a list aligned with the input.
- Raises:
InvalidIndexError – If a value is not an int, or lies outside the integer index.
MinResolutionError – If a value is a quadrant, which has no parent.
ResolutionError – If
target_resis not coarser than a value’s resolution, or is negative.
Example
>>> int_parent(cell_to_int("NE(0625/0451(3))")) == cell_to_int("NE(0625/0451)") True