itacart.intervals.intervals_difference

itacart.intervals.intervals_difference(first, second)[source]

Every position of the first list that is not in the second.

Raises:
  • InvalidIndexError – If either is not a list of ranges of one resolution.

  • NonExistentCellError – If the coarser list covers an address that names no cell, which its refinement finds.

Parameters:
Return type:

list[tuple[int, int]]

Example

>>> a = cells_to_intervals("NE(0625/0451)")
>>> b = cells_to_intervals("NE(0625/0451(4))")
>>> intervals_to_cells(intervals_difference(a, b))
'NE(0625/0451(1,2,3))'
Parameters:
Return type:

list[tuple[int, int]]