Pyinter is a python interval library which deals with interval arithmetic and sets of intervals (discontinous ranges).
Instances of Interval provide the following operations:
Note: comparison is performed solely on the lower value of the Interval.
Tests x to see if it is in the range specified by the Interval i.
Performs interval intersection just as intersect()
Returns a new Interval representing the intersection of this Interval with the other Interval
Performs interval union just as union()
Returns a new Interval or an IntervalSet representing the union of this Interval with the other Interval.
If the two intervals are overlaping then this will return an Interval, otherwise this returns an IntervalSet.
Helper function to construct an interval object with closed lower and upper.
For example:
>>> closed(100.2, 800.9)
[100.2, 800.9]
Helper function to construct an interval object with a closed lower and open upper.
For example:
>>> closedopen(100.2, 800.9)
[100.2, 800.9)
Helper function to construct an interval object with open lower and upper.
For example:
>>> open(100.2, 800.9)
(100.2, 800.9)
Helper function to construct an interval object with a open lower and closed upper.
For example:
>>> openclosed(100.2, 800.9)
(100.2, 800.9]
A class to hold collections of intervals, otherwise known as discontinous ranges
Returns a new IntervalSet which represents the intersection of each of the intervals in this IntervalSet with each of the intervals in the other IntervalSet. :param other: An IntervalSet to intersect with this one.
Returns a new IntervalSet which represents the union of each of the intervals in this IntervalSet with each of the intervals in the other IntervalSet :param other: An IntervalSet to union with this one.